Your IP : 216.73.216.196


Current Path : /opt/alt/python37/lib64/python3.7/site-packages/wrapt/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/site-packages/wrapt/__pycache__/arguments.cpython-37.pyc

B

���X��@s$ddlmZmZddlZdd�ZdS)�)�
getargspec�ismethodNcs�t|�\}}}}|j}i�g����fdd����fdd��t|�rZ|jdk	rZ|jf|}t|�}|t|�}	t|�}
|r�t|�nd}x t||�D]\}}
�||
�q�W|r�||
krΈ||||
d��n
�|d�n�d|
kr�|k�r$nn0td||�rd	nd
|
|
dk�rdnd
|	f��n>|
dk�rb|	�rb|�rR|�rbtd||	f��ntd||	f��xP|D]H}t|t��rh||k�rh�|��r�td||f��n�||�	|���qhW|�r�x6t||d�|�D]\}}
�|��sЈ||
��q�W|�r�||�n>|�rBt
t|��}t|t��r2|�
t��d�}td||f��|
t�fdd�|D��}|�r�|
|}td||�rzdnd
||dk�r�dnd
|	f���S)z�Get the mapping of arguments to values.

    A dict is returned, with keys the function argument names (including the
    names of the * and ** arguments, if any), and values the respective bound
    values from 'positional' and 'named'.c	s�t|t�r|�|<n���|�t|�}x\t|�D]P\}}yt|�}Wn0tk
rttd||dkrfdndf��YnX�||�q0Wyt|�Wntk
r�Yn
Xtd��dS)Nzneed more than %d %s to unpack��values�valueztoo many values to unpack)�
isinstance�str�append�iter�	enumerate�next�
StopIteration�
ValueError)�argr�iZsubargZsubvalue)�	arg2value�assign�assigned_tuple_params��B/opt/alt/python37/lib64/python3.7/site-packages/wrapt/arguments.pyrs 


zgetcallargs.<locals>.assigncst|t�r|�kS|�kS)N)rr)r)rrrr�is_assigned(s
z getcallargs.<locals>.is_assignedNrrz%s() takes %s %d %s (%d given)zat mostZexactlyrZ	argumentsZargumentz)%s() takes exactly 0 arguments (%d given)z"%s() takes no arguments (%d given)z2%s() got multiple values for keyword argument '%s'�replacez,%s() got an unexpected keyword argument '%s'csg|]}�|�r|�qSrr)�.0r)rrr�
<listcomp>Zszgetcallargs.<locals>.<listcomp>zat least)r�__name__rZim_self�len�zip�	TypeErrorrr�poprr
Zunicode�encode�sys�getdefaultencoding)�funcZ
positional�named�argsZvarargsZvarkw�defaultsZf_nameZnum_posZ	num_totalZnum_argsZnum_defaultsrrZ
unexpectedZ
unassignedZnum_requiredr)rrrrr�getcallargs	sl


r&)�inspectrrr r&rrrr�<module>s