U
    a                     @   sZ   d dl Z d dlmZmZ ddlmZ eeedddZeeddd	dZdd
dZdS )    N)Anyoverload   )ModuleAware)thingreturnc                 C   s   d S N )r   r	   r	   `/mounts/lovelace/software/anaconda3/envs/rescript-2/lib/python3.8/site-packages/public/public.pypublic   s    r   )kwsr   c                  K   s   d S r   r	   )r   r	   r	   r
   r      s    c                 K   s   | dkrt djnt j| j j}|dg }t|tsJt	dt
| | dkr| D ]"\}}||krt|| |||< qZn*t|dkstd| j|kr|| j | S )a  Add a name or names to __all__

    There are two forms of use for this function.  Most commonly it will
    be used as a decorator on a class or function at module scope.  In
    this case, `thing` will be an object with both __module__ and
    __name__ attributes, and the name is added to the module's __all__
    list, creating that if necessary.

    When used in its function call form, `thing` will be None.  __all__
    is looked up in the globals at the function's call site, and each
    key in the keyword arguments is added to the __all__.  In addition,
    the key will be bound to the value in the globals.

    Only one or the other format may be used.

    :param thing: None, or an object with both a __module__ and a __name__
        argument.
    :param kws: Keyword arguments.
    :return: The original `thing` object.
    :raises ValueError: When the inputs are invalid, or this function finds
        a non-list __all__ attribute.
    Nr   __all__z__all__ must be a list not: r   z8Keyword arguments are incompatible with use as decorator)sys	_getframe	f_globalsmodules
__module____dict__
setdefault
isinstancelist
ValueErrortypeitemsappendlenAssertionError__name__)r   r   mdict
dunder_allkeyvaluer	   r	   r
   r      s&    !



)N)r   typingr   r   typesr   r   r	   r	   r	   r
   <module>   s   