Your IP : 3.142.195.79


Current Path : /opt/alt/python35/lib64/python3.5/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/__pycache__/inspect.cpython-35.opt-2.pyc



���]��@s�ddfZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlmZddlmZmZe�Zx+ejj�D]\ZZeede<qWdd>Zd	d
�Zdd�Zd
d�Z dd�Z!dd�Z"e#ed�r�dd�Z$ndd�Z$e#ed�r�dd�Z%ndd�Z%dd�Z&dd�Z'dd �Z(d!d"�Z)d#d$�Z*d%d&�Z+d'd(�Z,d)d*�Z-d+d,�Z.d-d.�Z/d/d0�Z0d1d2�Z1dd3d4�Z2ed5d6�Z3d7d8�Z4d9d:�Z5d;dd<d=�Z6d>d?�Z7d@dA�Z8dBdC�Z9dDdE�Z:dFdG�Z;dHdI�Z<edJdK�Z=dLdM�Z>dNdO�Z?dPdQ�Z@ddRdS�ZAiZBiZCddTdU�ZDdVdW�ZEdXdY�ZFGdZd[�d[eG�ZHGd\d]�d]�ZId^d_�ZJd`da�ZKdbdc�ZLddde�ZMdfdgdh�ZNedidj�ZOdkdl�ZPdmdn�ZQedodp�ZRdqdr�ZSedsdt�ZTdudv�ZUedwdx�ZVdydz�ZWdd{d|�ZXd}d~�ZYdddfiieZdd��d�d��d�d��d�d��eXd�d��Z[eZd�d��d�d��d�d��d�d��Z\d�d��Z]d�d��Z^d�d��Z_ed�d��Z`d�d��Zaed�d��Zbdd�d��Zcd�d��Zded�d�febje�Zfdd�d��Zgdd�d��Zhd�d��Zidd�d��Zjdd�d��Zkel�Zmd�d��Znd�d��Zod�d��Zpd�d��Zqd�d��Zremd�d��Zsd�Ztd�Zud�Zvd�Zwd�d��Zxd�d��Zyd�Zzd�Z{d�Z|d�Z}d�d��Z~d�d��Ze�e�j��Z�e�e�j��Z�e�e�j�d��Z�e�e�e�ej�fZ�d�d��Z�fd�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d�d��Z�d�d�d��Z�d�d��Z�d�d�d�d�d�d��Z�Gd�d��d��Z�Gd�d��d��Z�Gd�d��d�ej��Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�Gd�d��d��Z�Gd�d��d��Z�Gd�d��d��Z�d�d�d�d��Z�d�d��Z�e�d�kr�e��dS)�zKa-Ping Yee <ping@lfw.org>z'Yury Selivanov <yselivanov@sprymix.com>�N)�
attrgetter)�
namedtuple�OrderedDictZCO_��cCst|tj�S)N)�
isinstance�types�
ModuleType)�object�r�,/opt/alt/python35/lib64/python3.5/inspect.py�ismodule?sr
cCs
t|t�S)N)r�type)r
rrr�isclassHsrcCst|tj�S)N)rr�
MethodType)r
rrr�ismethodPsrcCsQt|�s$t|�s$t|�r(dSt|�}t|d�oPt|d�S)NF�__get__�__set__)rr�
isfunctionr�hasattr)r
�tprrr�ismethoddescriptorZs$rcCsPt|�s$t|�s$t|�r(dSt|�}t|d�oOt|d�S)NFrr)rrrrr)r
rrrr�isdatadescriptorns$r�MemberDescriptorTypecCst|tj�S)N)rrr)r
rrr�ismemberdescriptor~srcCsdS)NFr)r
rrrr�s�GetSetDescriptorTypecCst|tj�S)N)rrr)r
rrr�isgetsetdescriptor�srcCsdS)NFr)r
rrrr�scCst|tj�S)N)rr�FunctionType)r
rrrr�srcCs,tt|�st|�o(|jjt@�S)N)�boolrr�__code__�co_flagsZCO_GENERATOR)r
rrr�isgeneratorfunction�sr!cCs,tt|�st|�o(|jjt@�S)N)rrrrr ZCO_COROUTINE)r
rrr�iscoroutinefunction�sr"cCst|tj�S)N)rr�
GeneratorType)r
rrr�isgenerator�sr$cCst|tj�S)N)rr�
CoroutineType)r
rrr�iscoroutine�sr&cCsMt|tj�pLt|tj�r:t|jjt@�pLt|tj	j
�S)N)rrr%r#r�gi_coder ZCO_ITERABLE_COROUTINE�collections�abc�	Awaitable)r
rrr�isawaitable�sr+cCst|tj�S)N)rr�
TracebackType)r
rrr�istraceback�sr-cCst|tj�S)N)rr�	FrameType)r
rrr�isframe�sr/cCst|tj�S)N)rr�CodeType)r
rrr�iscode�sr1cCst|tj�S)N)rr�BuiltinFunctionType)r
rrr�	isbuiltinsr3cCs.t|�p-t|�p-t|�p-t|�S)N)r3rrr)r
rrr�	isroutinesr4cCs tt|t�o|jt@�S)N)rrr�	__flags__�TPFLAGS_IS_ABSTRACT)r
rrr�
isabstractsr7cCsxt|�r"|ft|�}nf}g}t�}t|�}yWxP|jD]E}x<|jj�D]+\}}t|tj	�rf|j
|�qfWqPWWntk
r�YnXx�|D]�}	y%t||	�}
|	|kr�t�WnCtk
r&x.|D]#}|	|jkr�|j|	}
Pq�Ww�YnX|s:||
�rM|j
|	|
f�|j
|	�q�W|jddd��|S)N�keycSs|dS)Nrr)Zpairrrr�<lambda>Eszgetmembers.<locals>.<lambda>)r�getmro�set�dir�	__bases__�__dict__�itemsrr�DynamicClassAttribute�append�AttributeError�getattr�add�sort)r
�	predicate�mro�results�	processed�names�base�k�vr8�valuerrr�
getmemberss:	





rO�	Attributezname kind defining_class objectcCst|�}tt|��}tdd�|D��}|f|}||}t|�}xM|D]E}x<|jj�D]+\}}t|tj�rw|j	|�qwWqaWg}	t
�}
xF|D]>}d}d}
d}||
kr�y+|dkr�td��t||�}
Wn%tk
r6}zWYdd}~Xn�Xt|
d|�}||kr�d}d}x2|D]*}t||d�}||
krh|}qhWxN|D]F}y|j
||�}Wntk
r�w�YnX||
kr�|}q�W|dk	r�|}x=|D]5}||jkr|j|}||kr4|}PqW|dkrHq�|
dk	rZ|
n|}t|t�r~d}|}nWt|t�r�d}|}n9t|t�r�d}|}nt|�r�d	}nd
}|	j	t||||��|
j|�q�W|	S)NcSs(g|]}|ttfkr|�qSr)rr
)�.0�clsrrr�
<listcomp>gs	z(classify_class_attrs.<locals>.<listcomp>r>z)__dict__ is special, don't want the proxy�__objclass__z
static methodzclass method�property�method�data)r:r�tupler<r>r?rrr@rAr;�	ExceptionrC�__getattr__rB�staticmethod�classmethodrUr4rPrD)rRrGZmetamroZclass_basesZ	all_basesrJrKrLrM�resultrI�nameZhomeclsZget_objZdict_obj�excZlast_clsZsrch_clsZsrch_obj�obj�kindrrr�classify_class_attrsJs�


	







				rbcCs|jS)N)�__mro__)rRrrrr:�sr:�stopcs��dkrdd�}n�fdd�}|}t|�h}xS||�r�|j}t|�}||kr�tdj|���|j|�qEW|S)NcSs
t|d�S)N�__wrapped__)r)�frrr�_is_wrapper�szunwrap.<locals>._is_wrappercst|d�o�|�S)Nre)r)rf)rdrrrg�sz!wrapper loop when unwrapping {!r})�idre�
ValueError�formatrD)�funcrdrgrf�memoZid_funcr)rdr�unwrap�s	rmcCs&|j�}t|�t|j��S)N)�
expandtabs�len�lstrip)�lineZexplinerrr�
indentsize�srrcCsotjj|j�}|dkr%dSx3|jjd�dd�D]}t||�}qBWt|�skdS|S)N�.r���)�sys�modules�get�
__module__�__qualname__�splitrCr)rkrRr^rrr�
_findclass�s#r{cCsbt|�rexR|jD]G}|tk	ry
|j}Wntk
rLwYnX|dk	r|SqWdSt|�r�|jj}|j}t|�r�t	t	||d�d�|jkr�|}q|j
}nAt|�r|j}t|�}|dks
t	||�|k	rdSn�t
|�rm|j}|j}t|�ra|jd||jkra|}q|j
}n�t|t�r�|j}|j}t|�}|dks�t	||�|k	rdSnJt|�s�t|�r|j}|j}t	||�|k	rdSndSxO|jD]D}yt	||�j}Wntk
rIwYnX|dk	r|SqWdS)N�__func__rs)rrcr
�__doc__rBrr|�__name__�__self__rC�	__class__rr{r3ryrrU�fgetrrrT)r`rK�docr^�selfrRrkrrr�_finddoc�sb

	$		!					!		
r�cCs~y
|j}Wntk
r%dSYnX|dkrayt|�}Wnttfk
r`dSYnXt|t�stdSt|�S)N)r}rBr��	TypeErrorr�str�cleandoc)r
r�rrr�getdoc/s

		r�cCsFy|j�jd�}Wntk
r1dSYnXtj}xO|dd�D]=}t|j��}|rLt|�|}t||�}qLW|r�|dj�|d<|tjkr�x5tdt|��D]}|||d�||<q�Wx|r|dr|j	�q�Wx"|r4|dr4|j	d�qWdj
|�SdS)N�
rrrt)rnrz�UnicodeErrorru�maxsizerorp�min�range�pop�join)r��lines�marginrqZcontent�indent�irrrr�Bs(
		r�cCst|�r7t|d�r"|jStdj|���t|�r�t|d�r}tjj|j	�}t|d�r}|jStdj|���t
|�r�|j}t|�r�|j
}t|�r�|j}t|�r�|j}t|�r�|jStdj|���dS)N�__file__z{!r} is a built-in modulerxz{!r} is a built-in classzO{!r} is not a module, class, method, function, traceback, frame, or code object)r
rr�r�rjrrurvrwrxrr|rrr-�tb_framer/�f_coder1�co_filename)r
rrr�getfile_s,					r��
ModuleInfozname suffix mode module_typec
Cs�tjdtd�tj��!tjdt�ddl}WdQRXtjj	|�}dd�|j
�D�}|j�xM|D]E\}}}}||d�|krt|d|�|||�SqWdS)Nz%inspect.getmoduleinfo() is deprecated��ignorercSs2g|](\}}}t|�|||f�qSr)ro)rQ�suffix�mode�mtyperrrrS�s	z!getmoduleinfo.<locals>.<listcomp>)
�warnings�warn�DeprecationWarning�catch_warnings�simplefilter�PendingDeprecationWarning�imp�os�path�basenameZget_suffixesrEr�)r�r��filename�suffixes�neglenr�r�r�rrr�
getmoduleinfozs
	
r�cCsptjj|�}dd�tjj�D�}|j�x1|D])\}}|j|�r?|d|�Sq?WdS)NcSs#g|]}t|�|f�qSr)ro)rQr�rrrrS�s	z!getmodulename.<locals>.<listcomp>)r�r�r��	importlib�	machinery�all_suffixesrE�endswith)r�Zfnamer�r�r�rrr�
getmodulename�s	
r�cs�t|��tjjdd�}|tjjdd�7}t�fdd�|D��r�tjj��dtjj	d�n)t�fdd�tjj
D��r�dStjj��r��Stt
|��dd�dk	r��S�tjkr��SdS)Nc3s|]}�j|�VqdS)N)r�)rQ�s)r�rr�	<genexpr>�sz getsourcefile.<locals>.<genexpr>rc3s|]}�j|�VqdS)N)r�)rQr�)r�rrr��s�
__loader__)r�r�r��DEBUG_BYTECODE_SUFFIXES�OPTIMIZED_BYTECODE_SUFFIXES�anyr�r��splitext�SOURCE_SUFFIXES�EXTENSION_SUFFIXES�existsrC�	getmodule�	linecache�cache)r
Zall_bytecode_suffixesr)r�r�
getsourcefile�s!r�cCs@|dkr$t|�p!t|�}tjjtjj|��S)N)r�r�r�r��normcase�abspath)r
�	_filenamerrr�
getabsfile�sr�c

Cs�t|�r|St|d�r2tjj|j�S|dk	r^|tkr^tjjt|�Syt||�}Wntk
r�dSYnX|tkr�tjjt|�Sx�t	tjj
��D]�\}}t|�r�t|d�r�|j}|tj|d�krq�|t|<t|�}|j
t|<ttjj|�<q�W|tkrftjjt|�Stjd}t|d�s�dSt||j
�r�t||j
�}||kr�|Stjd}t||j
�r�t||j
�}	|	|kr�|SdS)Nrxr��__main__r~�builtins)r
rrurvrwrx�
modulesbyfiler�r��listr?r��_filesbymodnamer~r�r��realpathrC)
r
r��file�modname�modulerf�mainZ
mainobjectZbuiltinZ
builtinobjectrrrr��sD
	"	
%

r�c
Csnt|�}|r"tj|�n6t|�}|jd�oI|jd�sXtd��t||�}|r�tj||j	�}ntj|�}|s�td��t
|�r�|dfSt|�r�|j}t
jd|d�}g}xmtt|��D]Y}|j||�}|r||ddkr>||fS|j|jd	�|f�qW|r�|j�||dd	fStd
��t|�r�|j}t|�r�|j}t|�r�|j}t|�r�|j}t|�r^t|d�std��|jd	}	t
jd
�}x.|	dkrS|j||	�rFP|	d	}	q&W||	fStd��dS)N�<�>zsource code not availablezcould not get source coderz^(\s*)class\s*z\b�crzcould not find class definition�co_firstlinenoz"could not find function definitionz>^(\s*def\s)|(\s*async\s+def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)zcould not find code object) r�r��
checkcacher��
startswithr��OSErrorr��getlinesr>r
rr~�re�compiler�ro�matchrA�grouprErr|rrr-r�r/r�r1rr�)
r
r�r�r�r^�patZ
candidatesr�r��lnumrrr�
findsource�s^
	
 
				

r�cCs�yt|�\}}Wnttfk
r4dSYnXt|�rBd}|rm|ddd�dkrmd}x6|t|�kr�||j�dkr�|d}qpW|t|�kr�||dd�dkr�g}|}xQ|t|�kr1||dd�dkr1|j||j��|d}q�Wdj|�Sn�|dkr�t	||�}|d}|dkr�||j
�dd�dkr�t	||�|kr�||j�j
�g}|dkrb|d}||j�j
�}xp|dd�dkrat	||�|kra|g|dd�<|d}|dkrHP||j�j
�}q�Wx0|r�|dj�dkr�g|dd�<qeWx0|r�|dj�dkr�g|d	d�<q�Wdj|�SdS)
Nrr�z#!r��#)r�r�rtrt)r�r�r�r
ro�striprArnr�rrrp)r
r�r��startZcomments�endr�Zcommentrrr�getcomments.sJ	 +,/
,
/
r�c@seZdZdS)�
EndOfBlockN)r~rxryrrrrr�[sr�c@s(eZdZdd�Zdd�ZdS)�BlockFindercCsCd|_d|_d|_d|_d|_d|_d|_dS)NrFr)r��islambda�started�passline�indecorator�decoratorhasargs�last)r�rrr�__init___s						zBlockFinder.__init__cCs�|jrb|jrb|dkr,d|_n*|dkrV|dkrMd|_d|_d|_n9|dkr�|jr�d|_n|dkr�|jr�d|_d|_n�|tjkrd|_|d	|_|jr�t�|jr�|jr�d|_n�|jrn�|tj	kr7|j
d
|_
d|_nd|tjkrn|j
d
|_
|j
d	kr�t�n-|j
d	kr�|tjtj
fkr�t�dS)N�@T�def�class�lambda�(�)Frr)r�r�r�)r�r�r�r�r��tokenize�NEWLINEr�r��INDENTr��DEDENT�COMMENT�NL)r�r�tokenZsrowcolZerowcolrqrrr�
tokeneaterhsB						
			'zBlockFinder.tokeneaterN)r~rxryr�r�rrrrr�]s	r�cCsot�}y:tjt|�j�}x|D]}|j|�q+WWnttfk
r]YnX|d|j�S)N)	r�r��generate_tokens�iter�__next__r�r��IndentationErrorr�)r�Zblockfinder�tokensZ_tokenrrr�getblock�s	
r�cCsVt|�}t|�\}}t|�r4|dfSt||d��|dfSdS)Nrr)rmr�r
r�)r
r�r�rrr�getsourcelines�s

rcCst|�\}}dj|�S)Nr�)rr�)r
r�r�rrr�	getsource�srcCssg}|jdtdd��xM|D]E}|j||jf�||kr&|jt||||��q&W|S)Nr8rxr~)rErrAr=�walktree)�classes�children�parentrHr�rrrr�s
!rFcCs�i}g}x�|D]�}|jr�xw|jD]P}||krHg||<|||kri||j|�|r,||kr,Pq,Wq||kr|j|�qWx'|D]}||kr�|j|�q�Wt||d�S)N)r=rAr)r�uniquer�rootsr�rrrr�getclasstree�s"	
	

r�	Argumentszargs, varargs, varkwcCs,t|�\}}}}t||||�S)N)�_getfullargsr	)�co�args�varargs�
kwonlyargs�varkwrrr�getargs�src	Cs�t|�s!tdj|���|j}|j}|j}t|d|��}t||||��}d}||7}d}|jt@r�|j|}|d}d}|jt	@r�|j|}||||fS)Nz{!r} is not a code objectrr)
r1r�rj�co_argcount�co_varnames�co_kwonlyargcountr�r �
CO_VARARGS�CO_VARKEYWORDS)	r�nargsrJZnkwargsrr�stepr
rrrrr
�s"			





r
�ArgSpeczargs varargs keywords defaultscCsbtjdtdd�t|�\}}}}}}}|sC|rOtd��t||||�S)NzCinspect.getargspec() is deprecated, use inspect.signature() instead�
stacklevelr�zcFunction has keyword-only arguments or annotations, use getfullargspec() API which can support them)r�r�r��getfullargspecrir)rkrr
r�defaultsr�kwonlydefaults�annrrr�
getargspecs	!r�FullArgSpeczGargs, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotationsc
Cs�y"t|dddddt�}Wn4tk
rX}ztd�|�WYdd}~XnXg}d}d}g}f}i}f}i}	|j|jk	r�|j|d<x|jj�D]�}
|
j}|
j	}|t
kr�|j|�n�|tkr*|j|�|
j
|
jk	r�||
j
f7}nb|tkr?|}nM|tkrz|j|�|
j
|
jk	r�|
j
|	|<n|tkr�|}|
j|
jk	r�|
j||<q�W|	s�d}	|s�d}t||||||	|�S)N�follow_wrapper_chainsF�skip_bound_arg�sigclszunsupported callable�return)�_signature_from_callable�	SignaturerYr��return_annotation�empty�
parameters�valuesrar^�_POSITIONAL_ONLYrA�_POSITIONAL_OR_KEYWORD�default�_VAR_POSITIONAL�
_KEYWORD_ONLY�_VAR_KEYWORD�
annotationr)
rk�sig�exrr
rrr�annotations�
kwdefaults�paramrar^rrrr!sT	
"
		
	
r�ArgInfozargs varargs keywords localscCs.t|j�\}}}t||||j�S)N)rr�r6�f_locals)�framerr
rrrr�getargvalues~sr9cCsut|dd�dkr.t|�jdd�St|t�rk|jd|fkrY|jS|jd|jSt|�S)NrxZtypingztyping.r�r�rs)rC�repr�replacerrrxry)r0Zbase_modulerrr�formatannotation�sr<cs(t|dd���fdd�}|S)Nrxcs
t|��S)N)r<)r0)r�rr�_formatannotation�sz5formatannotationrelativeto.<locals>._formatannotation)rC)r
r=r)r�r�formatannotationrelativeto�sr>cCsd|S)N�*r)r^rrrr9�sr9cCsd|S)Nz**r)r^rrrr9�scCsdt|�S)N�=)r:)rNrrrr9�scCsd|S)Nz -> r)�textrrrr9�sc
s����fdd�}
g}|r:t|�t|�}x]t|�D]O\}}|
|�}|r�||kr�||
|||�}|j|�qGW|dk	r�|j||
|���n|r�|jd�|r+xM|D]E}|
|�}|r||kr||
||�7}|j|�q�W|dk	rP|j|	|
|���ddj|�d}d�kr�||��d��7}|S)Ncs4�|�}|�kr0|d��|�7}|S)Nz: r)�argr])r3r<�	formatargrr�formatargandannotation�sz-formatargspec.<locals>.formatargandannotationr?r�z, r�r#)ro�	enumeraterAr�)rr
rrrrr3rC�
formatvarargs�formatvarkw�formatvalueZ
formatreturnsr<rD�specsZfirstdefaultr�rB�specZ	kwonlyargr]r)r3r<rCr�
formatargspec�s2

rKcCsd|S)Nr?r)r^rrrr9�scCsd|S)Nz**r)r^rrrr9�scCsdt|�S)Nr@)r:)rNrrrr9�scCs�|||dd�}g}	x1tt|��D]}
|	j|||
��q.W|rv|	j||�|||��|r�|	j||�|||��ddj|	�dS)NcSs||�|||�S)Nr)r^�localsrCrHrrr�convert�sz formatargvalues.<locals>.convertr�z, r�)r�rorAr�)rr
rrLrCrFrGrHrMrIr�rrr�formatargvalues�s!!rNcs��fdd�|D�}t|�}|dkr>|d}nW|dkr\dj|�}n9dj|dd��}|dd�=dj|�|}td	|||r�d
nd|dkr�dnd
|f��dS)Ncs(g|]}|�krt|��qSr)r:)rQr^)r)rrrS�s	z&_missing_arguments.<locals>.<listcomp>rrr�z	{} and {}z, {} and {}z, z*%s() missing %i required %s argument%s: %s�
positionalzkeyword-onlyr�r����rP)rorjr�r�)�f_nameZargnames�posr)rJ�missingr��tailr)r)r�_missing_arguments�s

rUc
	s.t|�|}t�fdd�|D��}|rQ|dk}	d|f}
nI|rvd}	d|t|�f}
n$t|�dk}	tt|��}
d}|r�d}||dkr�d	nd||dkr�d	ndf}td
||
|	r�d	nd|||dkr|rdndf��dS)
Ncs"g|]}|�kr|�qSrr)rQrB)r)rrrS�s	z_too_many.<locals>.<listcomp>rzat least %dTz
from %d to %dr�z7 positional argument%s (and %d keyword-only argument%s)r�z5%s() takes %s positional argument%s but %d%s %s givenZwasZwere)ror�r�)
rQrZkwonlyr
ZdefcountZgivenr)ZatleastZkwonly_given�pluralr1Z
kwonly_sig�msgr)r)r�	_too_many�s$rXcOs�|d}|dd�}t|�}|\}}}}}	}
}|j}i}
t|�r{|jdk	r{|jf|}t|�}t|�}|r�t|�nd}t||�}x&t|�D]}|||
||<q�W|rt||d��|
|<t||	�}|r#i|
|<x|j	�D]q\}}||kru|sdt
d||f��||
||<q0||
kr�t
d||f��||
|<q0W||kr�|r�t|||	||||
�||kri|d||�}x-|D]%}||
kr�t||d|
�q�WxBt
|||d��D]&\}}||
kr?|||
|<q?Wd}xG|	D]?}||
krv|
r�||
kr�|
||
|<qv|d7}qvW|r�t||	d|
�|
S)Nrrz*%s() got an unexpected keyword argument %rz(%s() got multiple values for argument %rTF)rr~rrror�r�rXr;r?r�rXrUrE)Zfunc_and_positional�namedrkrOrJrr
rrrrrrQZ	arg2valueZnum_posZnum_argsZnum_defaults�nr�Zpossible_kwargs�kwrNZreqrBrS�kwargrrr�getcallargssd
	


'
r]�ClosureVarsz"nonlocals globals builtins unboundc	CsRt|�r|j}t|�s6tdj|���|j}|jdkrWi}n"dd�t|j|j�D�}|j	}|j
dtj�}t
|�r�|j}i}i}t�}x{|jD]p}|dkr�q�y||||<Wq�tk
r:y||||<Wntk
r5|j|�YnXYq�Xq�Wt||||�S)	Nz'{!r}' is not a Python functioncSs"i|]\}}|j|�qSr)�
cell_contents)rQ�varZcellrrr�
<dictcomp>Ws	z"getclosurevars.<locals>.<dictcomp>�__builtins__�None�True�False)rcrdre)rr|rr�rjr�__closure__�zip�co_freevars�__globals__rwr�r>r
r;�co_names�KeyErrorrDr^)	rk�codeZ
nonlocal_varsZ	global_nsZ
builtin_nsZglobal_varsZbuiltin_varsZ
unbound_namesr^rrr�getclosurevarsBs8								

	rm�	Tracebackz+filename lineno function code_context indexcCs#t|�r!|j}|j}n	|j}t|�sKtdj|���t|�p`t|�}|dkr�|d|d}yt	|�\}}Wnt
k
r�d}}YqXtdt|t
|�|��}||||�}|d|}n
d}}t|||jj||�S)Nz'{!r} is not a frame or traceback objectrrr�)r-�	tb_linenor��f_linenor/r�rjr�r�r�r��maxr�rornr��co_name)r8�context�linenor�r�r�r��indexrrr�getframeinfoys$		
"
rvcCs|jS)N)rp)r8rrr�	getlineno�srw�	FrameInfor8cCsIg}x<|rD|ft||�}|jt|��|j}q	W|S)N)rvrArx�f_back)r8rs�	framelist�	frameinforrr�getouterframes�s	
r|cCsLg}x?|rG|jft||�}|jt|��|j}q	W|S)N)r�rvrArx�tb_next)�tbrsrzr{rrr�getinnerframes�s	
rcCs ttd�rtjd�SdS)N�	_getframer)rrur�rrrr�currentframe�sr�cCsttjd�|�S)Nr)r|rur�)rsrrr�stack�sr�cCsttj�d|�S)Nr�)rru�exc_info)rsrrr�trace�sr�cCstjdj|�S)Nrc)rr>r)�klassrrr�_static_getmro�sr�cCsDi}ytj|d�}Wntk
r0YnXtj||t�S)Nr>)r
�__getattribute__rB�dictrw�	_sentinel)r`�attrZ
instance_dictrrr�_check_instance�s
r�cCsWxPt|�D]B}tt|��tkr
y|j|SWq
tk
rNYq
Xq
WtS)N)r��_shadowed_dictrr�r>rk)r�r��entryrrr�_check_class�s
	r�cCs+yt|�Wntk
r&dSYnXdS)NFT)r�r�)r`rrr�_is_type�s

	r�cCs�tjd}xwt|�D]i}y|j|�d}Wntk
rKYqXt|�tjko||jdko||j|ks|SqWt	S)Nr>)
rr>r�rrkrrr~rTr�)r��	dict_attrr�Z
class_dictrrrr��s

r�cCsit}t|�s]t|�}t|�}|tksKt|�tjkrct||�}n|}t||�}|tk	r�|tk	r�tt|�d�tk	r�tt|�d�tk	r�|S|tk	r�|S|tk	r�|S||krIxVtt|��D]B}tt|��tkry|j	|SWqt
k
rDYqXqW|tk	rY|St|��dS)Nrr)r�r�rr�rrr�r�r�r>rkrB)r`r�r,Zinstance_resultr�r�Zklass_resultr�rrr�getattr_static�s6
	r��GEN_CREATED�GEN_RUNNING�
GEN_SUSPENDED�
GEN_CLOSEDcCs:|jr
tS|jdkr tS|jjdkr6tStS)Nrrt)�
gi_runningr��gi_framer��f_lastir�r�)�	generatorrrr�getgeneratorstate(s		r�cCsQt|�s!tdj|���t|dd�}|dk	rI|jjSiSdS)Nz '{!r}' is not a Python generatorr�)r$r�rjrCr�r7)r�r8rrr�getgeneratorlocals:s
r��CORO_CREATED�CORO_RUNNING�CORO_SUSPENDED�CORO_CLOSEDcCs:|jr
tS|jdkr tS|jjdkr6tStS)Nrrt)�
cr_runningr��cr_framer�r�r�r�)�	coroutinerrr�getcoroutinestateRs		r�cCs-t|dd�}|dk	r%|jSiSdS)Nr�)rCr7)r�r8rrr�getcoroutinelocalsdsr��
from_bytescCsCyt||�}Wntk
r+dSYnXt|t�s?|SdS)N)rCrBr�_NonUserDefinedCallables)rRZmethod_name�methrrr�"_signature_get_user_defined_method�s
	r�cCs|j}t|j��}|jp'f}|jp6i}|rI||}y|j||�}WnCtk
r�}z#dj|�}	t|	�|�WYdd}~XnXd}
xZ|j�D]L\}}y|j	|}
Wnt
k
r�Yn�X|jtkr	|j
|�q�|jtkrV||krCd}
|jd|
�||<n|j
|j�q�|jtkr{|jd|
�||<|
r�|jtkr�||jdt�}|||<|j|�q�|jttfkr�|j|�q�|jtkr�|j
|j�q�W|jd|j��S)Nz+partial object {!r} has incorrect argumentsFTr,rar()r(rr?r�keywords�bind_partialr�rjri�	argumentsrkrar*r�r+r;r^r.�move_to_endr/r-r))�wrapped_sig�partial�
extra_argsZ
old_params�
new_paramsZpartial_argsZpartial_keywordsZbar2rWZtransform_to_kwonly�
param_namer5Z	arg_valueZ	new_paramrrr�_signature_get_partial�sL	
"



r�cCs�t|jj��}|s5|djttfkrAtd��|dj}|ttfkrs|dd�}n|t	k	r�td��|j
d|�S)Nrzinvalid method signaturerzinvalid argument typer()rXr(r)rar/r.rir+r*r-r;)r1�paramsrarrr�_signature_bound_method�s 
r�cCs7t|�p6t|�p6t|t�p6|ttfkS)N)r3rrr�rr
)r`rrr�_signature_is_builtin�sr�cCs�t|�st|�rdSt|dd�}t|dd�}t|dt�}t|dt�}t|dd�}t|tj�o�t|t�o�|dks�t|t�o�|dks�t|t	�o�t|t	�S)NFr~r�__defaults__�__kwdefaults__�__annotations__)
�callablerrC�_voidrrr0r�rXr�)r`r^rlrr4r3rrr�_signature_is_functionlikesr�cCsV|jd�}|dkr*|jd�}|jd�}|jd�}|d|�S)N�,rr��:r@r�rt)�find)rJrRZcposrrr�_signature_get_bound_params
r�cCs�|s|ddfSd}d}dd�|jd�D�}t|�j}tj|�}d}d}g}|j}	d}
tj}tj}t|�}
x�|D]�}
|
j	|
j
}}||kr|dkr�|r�d}q�d}|
d7}
q�|d	krd}|
d}q�||kr2|d
kr2|
}q�|r`d}||koS|dks`|	d�|	|�|dkr�|	d
�q�Wdj|�}|||fS)NcSsg|]}|jd��qS)�ascii)�encode)rQ�lrrrrSEs	z6_signature_strip_non_python_syntax.<locals>.<listcomp>r�Frr�Tr�/�$r�z, � r�)rzr�r�r�rAr��OP�
ERRORTOKEN�nextr�stringr�)�	signature�self_parameter�last_positional_onlyr�r�Ztoken_streamZ
delayed_commaZskip_next_commarArDZcurrent_parameterr�r��trr��clean_signaturerrr�"_signature_strip_non_python_syntax2sP

			
	



r�Tcs,|j�t|�\}}}d|d}ytj|�}Wntk
rYd}YnXt|tj�s�tdj|���|j	d}	g��j
�t��d}i�t|dd�}
|
r�t
jj|
d�}|r�|j�t
j�dd����fdd	��	G�	fd
d�dtj����������fdd
�}t|	jj�}t|	jj�}
tj||
dd�}|dk	r��j�n	�j�xNttt|���D]4\}\}}|||�||kr��j�q�W|	jjr4�j�||	jj���j�x6t|	jj|	jj �D]\}}|||�qYW|	jj!r��j"�||	jj!��|dk	rt|dd�}|dk	}t#|�}|r�|s�|r��j$d�n#�dj%d�j�}|�d<|�d|j
�S)Nzdef fooz: passz"{!r} builtin has invalid signaturerrxcSs"|jdkrtd��|jS)Nz'Annotations are not currently supported)r0rirB)�noderrr�
parse_name�sz&_signature_fromstr.<locals>.parse_namecs�yt|��}WnCtk
rXyt|��}Wntk
rSt��YnXYnXt|t�rutj|�St|ttf�r�tj	|�St|t
�r�tj|�S|dkr�tj|�St��dS)NTF)TFN)
�eval�	NameError�RuntimeErrorrr��astZStr�int�floatZNum�bytesZBytesZNameConstant)r�rN)�module_dict�sys_module_dictrr�
wrap_value�s 





z&_signature_fromstr.<locals>.wrap_valuecs4eZdZ�fdd�Z�fdd�ZdS)z,_signature_fromstr.<locals>.RewriteSymbolicscs�g}|}x/t|tj�r=|j|j�|j}qWt|tj�sYt��|j|j�dj	t
|��}�|�S)Nrs)rr�rPrAr�rN�Namer�rhr��reversed)r�r��arZrN)r�rr�visit_Attribute�s
	z<_signature_fromstr.<locals>.RewriteSymbolics.visit_Attributecs+t|jtj�st���|j�S)N)r�ctxr�ZLoadrirh)r�r�)r�rr�
visit_Name�s	z7_signature_fromstr.<locals>.RewriteSymbolics.visit_NameN)r~rxryr�r�r)r�rr�RewriteSymbolics�sr�cs��|�}|�krdS|r�|tk	r�y%��j|�}tj|�}Wntk
rm�}YnX|�kr~dS|�k	r�|n|}�j�|�d|d���dS)Nr,r0)�_emptyZvisitr�Zliteral_evalrirA)Z	name_nodeZdefault_noder,r^�o)�	Parameterr�r'�invalidrar(r�rr�p�s
z_signature_fromstr.<locals>.p�	fillvaluerrar&)&�_parameter_clsr�r��parse�SyntaxErrorrZModulerirjZbodyr'r
rCrurvrwr>ZNodeTransformerr�rr�	itertools�zip_longest�POSITIONAL_ONLY�POSITIONAL_OR_KEYWORDrEr�Zvararg�VAR_POSITIONAL�KEYWORD_ONLYrgrZkw_defaultsr\�VAR_KEYWORDr
r�r;)rRr`r�r!r�r�r�Zprogramr�rf�module_namer�rrr�r�r^r,�_selfZself_isboundZ
self_ismoduler)
r�r�r'r�rar�r(r�r�r�r�_signature_fromstrzsj	

				'	+

		(	
r�cCsat|�s!tdj|���t|dd�}|sNtdj|���t||||�S)Nz%{!r} is not a Python builtin function�__text_signature__z#no signature found for builtin {!r})r�r�rjrCrir�)rRrkr!r�rrr�_signature_from_builtins	r�cCs�d}t|�s<t|�r'd}ntdj|���|j}|j}|j}|j}t|d|��}|j	}||||�}	|j
}
|j}|j}|r�t
|�}
nd}
g}||
}xI|d|�D]7}|
j|t�}|j||d|dt��q�Wx_t||d��D]G\}}|
j|t�}|j||d|dtd||��q<W|jt@r�|||}|
j|t�}|j||d|dt��xi|	D]a}t}|dk	r|j|t�}|
j|t�}|j||d|dtd|��q�W|jt@r�||}|jt@rm|d7}||}|
j|t�}|j||d|dt��||d	|
jd
t�d|�S)NFTz{!r} is not a Python functionrr0rar,rr&r#�__validate_parameters__)rr�r�rjr�rrrrXrr�r�r�rorwr�rAr+rEr rr-r.rr/)rRrkZis_duck_functionr�Z	func_codeZ	pos_countZ	arg_namesrOZkeyword_only_countZkeyword_onlyr3rr4Zpos_default_countr(Znon_default_countr^r0�offsetr,rurrr�_signature_from_functionsj									
#








	r�r r!c!Cs�t|�s!tdj|���t|tj�rht|jd|d|d|�}|rdt|�S|S|r�t	|ddd��}t|tj�r�t|d|d|d|�Sy
|j
}Wntk
r�Yn5X|dk	r
t|t�stdj|���|Sy
|j
}Wntk
r+Yn�Xt|tj�r�t|jd|d|d|�}t||d�}t|jj��d	}|jtjkr�|St|jj��}|f|}	|jd
|	�St|�s�t|�r�t||�St|�rt||d|�St|tj�rVt|jd|d|d|�}t||�Sd}t|t�r�t t|�d�}
|
dk	r�t|
d|d|d|�}nut |d�}|dk	r�t|d|d|d|�}n9t |d
�}|dk	r"t|d|d|d|�}|dkrqxS|j!dd�D]>}
y
|
j"}Wntk
riYqBX|rBt#|||�SqBWt|j!krq|j$t%j$kr�|j&t%j&kr�t't%�St(dj|���n�t|t)�sqt t|�d�}
|
dk	rqy"t|
d|d|d|�}WnCt(k
rp}z#dj|�}t(|�|�WYdd}~XnX|dk	r�|r�t|�S|St|tj*�r�dj|�}t(|��t(dj|���dS)Nz{!r} is not a callable objectr r!r"rdcSs
t|d�S)N�
__signature__)r)rfrrrr9�sz*_signature_from_callable.<locals>.<lambda>z1unexpected object {!r} in __signature__ attributerr(�__call__�__new__r�rz(no signature found for builtin type {!r}zno signature found for {!r}z,no signature found for builtin function {!r}z+callable {!r} is not supported by signature)Nrt)+r�r�rjrrrr$r|r�rmr�rBr%�_partialmethod�	functools�
partialmethodrkr�rXr(r)rar�r�r;rr�r�r�r�r�rr�rcr�r�r�r
r�r�rir�r2)r`r r!r"r1rr�Zfirst_wrapped_paramZ
sig_paramsr��call�newZinitrKZtext_sigr2rWrrrr$hs�			




		

		
	



"
r$c@seZdZdS)r�N)r~rxryrrrrr�0	sr�c@seZdZdS)r�N)r~rxryrrrrr�4	sr�c@s:eZdZdZdZdZdZdZdd�ZdS)	�_ParameterKindrrr���cCs|jS)N)�_name_)r�rrr�__str__?	sz_ParameterKind.__str__N)	r~rxryr�r�r�r�r�rrrrrr8	src
@seZdZd"ZeZeZeZ	e
ZeZ
eZdededd�Zd	d
�Zdd�Zed
d��Zedd��Zedd��Zedd��Zdededededd�Zdd�Zdd�Zdd�Zdd �Zd!S)#r��_name�_kind�_default�_annotationr,r0cCs�|tttttfkr'td��||_|tk	ri|ttfkridj|�}t|��||_	||_
|tkr�td��t|t�s�t
dj|���|j�s�tdj|���||_dS)Nz,invalid value for 'Parameter.kind' attributez({} parameters cannot have default valuesz*name is a required attribute for Parameterzname must be a str, not a {!r}z"{!r} is not a valid parameter name)r*r+r-r.r/rir	r�rjr
rrr�r��isidentifierr)r�r^rar,r0rWrrrr�j	s"				zParameter.__init__cCs1t|�|j|jfd|jd|jifS)Nr
r)rrr	r
r)r�rrr�
__reduce__�	s		zParameter.__reduce__cCs|d|_|d|_dS)Nr
r)r
r)r��staterrr�__setstate__�	s
zParameter.__setstate__cCs|jS)N)r)r�rrrr^�	szParameter.namecCs|jS)N)r
)r�rrrr,�	szParameter.defaultcCs|jS)N)r)r�rrrr0�	szParameter.annotationcCs|jS)N)r	)r�rrrra�	szParameter.kindr^racCss|tkr|j}|tkr*|j}|tkr?|j}|tkrT|j}t|�||d|d|�S)Nr,r0)r�rr	rr
r)r�r^rar0r,rrrr;�	s				zParameter.replacecCs�|j}|j}|jtk	r<dj|t|j��}|jtk	rfdj|t|j��}|tkrd|}n|t	kr�d|}|S)Nz{}:{}z{}={}r?z**)
rarrr�rjr<r
r:r-r/)r�ra�	formattedrrrr�	s			

zParameter.__str__cCsdj|jj|�S)Nz	<{} "{}">)rjr�r~)r�rrr�__repr__�	szParameter.__repr__cCs"t|j|j|j|jf�S)N)�hashr^rar0r,)r�rrr�__hash__�	szParameter.__hash__cCsi||krdSt|t�s#tS|j|jkoh|j|jkoh|j|jkoh|j|jkS)NT)rr��NotImplementedrr	r
r)r��otherrrr�__eq__�	szParameter.__eq__N)rr	r
r)r~rxry�	__slots__r*r�r+r�r-r�r.r�r/r�r�r'r�r
rrUr^r,r0rar�r;rrrrrrrrr�J	s(r�c@s�eZdZdZdd�Zedd��Zedd	��Zed
d��Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�BoundArgumentsr��
_signature�__weakref__cCs||_||_dS)N)r�r)r�r�r�rrrr��	s	zBoundArguments.__init__cCs|jS)N)r)r�rrrr��	szBoundArguments.signaturecCs�g}x�|jjj�D]u\}}|jttfkr;Py|j|}Wntk
raPYqX|jtkr�|j	|�q|j
|�qWt|�S)N)rr(r?rar/r.r�rkr-�extendrArX)r�rr�r5rBrrrr�	s
zBoundArguments.argscCs�i}d}x�|jjj�D]�\}}|sg|jttfkrOd}n||jkrgd}q|spqy|j|}Wntk
r�YqX|jtkr�|j|�q|||<qW|S)NFT)	rr(r?rar/r.r�rk�update)r��kwargsZkwargs_startedr�r5rBrrrr
s&	
zBoundArguments.kwargscCs�|j}g}x�|jjj�D]�\}}y|j|||f�Wq"tk
r�|jtk	rt|j}n3|jt	kr�f}n|jt
kr�i}nw"|j||f�Yq"Xq"Wt|�|_dS)N)r�rr(r?rArkr,r�rar-r/r)r�r�Z
new_argumentsr^r5�valrrr�apply_defaults#
s		
		zBoundArguments.apply_defaultscCsE||krdSt|t�s#tS|j|jkoD|j|jkS)NT)rrrr�r�)r�rrrrr?
szBoundArguments.__eq__cCs|d|_|d|_dS)Nrr�)rr�)r�rrrrrG
s
zBoundArguments.__setstate__cCsd|jd|jiS)Nrr�)rr�)r�rrr�__getstate__K
szBoundArguments.__getstate__cCs^g}x6|jj�D]%\}}|jdj||��qWdj|jjdj|��S)Nz{}={!r}z	<{} ({})>z, )r�r?rArjr�r~r�)r�rrBrNrrrrN
szBoundArguments.__repr__N)r�rr)r~rxryrr�rUr�rrrrrr rrrrrr�	src@s9eZdZd-ZeZeZeZ	ddedddd�Z
ed	d
��Zedd��Z
ed
ddd��Zedd��Zedd��Zdededd�Zdd�Zdd�Zdd�Zdddd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�ZdS).r%�_return_annotation�_parametersNr&r�TcCs[|dkrt�}n$|r#t�}t}d}xt|�D]�\}}|j}	|j}
|	|kr�d}|j||	�}t|��n|	|kr�d}|	}|	ttfkr�|jt	kr�|r�d}t|��nd}|
|krdj|
�}t|��|||
<q@Wntdd�|D��}t
j|�|_||_
dS)NFz'wrong parameter order: {!r} before {!r}z-non-default argument follows default argumentTzduplicate parameter name: {!r}css|]}|j|fVqdS)N)r^)rQr5rrrr��
sz%Signature.__init__.<locals>.<genexpr>)rr*rErar^rjrir+r,r�r�MappingProxyTyper"r!)r�r(r&r�r�Ztop_kindZ
kind_defaults�idxr5rar^rWrrrr�s
s<			
zSignature.__init__cCs#tjdtdd�t||�S)NzNinspect.Signature.from_function() is deprecated, use Signature.from_callable()rr�)r�r�r�r�)rRrkrrr�
from_function�
s	
zSignature.from_functioncCs#tjdtdd�t||�S)NzMinspect.Signature.from_builtin() is deprecated, use Signature.from_callable()rr�)r�r�r�r�)rRrkrrr�from_builtin�
s	
zSignature.from_builtin�follow_wrappedcCst|d|d|�S)Nr"r )r$)rRr`r'rrr�
from_callable�
szSignature.from_callablecCs|jS)N)r")r�rrrr(�
szSignature.parameterscCs|jS)N)r!)r�rrrr&�
szSignature.return_annotationr(cCsF|tkr|jj�}|tkr0|j}t|�|d|�S)Nr&)r�r(r)r!r)r�r(r&rrrr;�
s	zSignature.replacecCsNtdd�|jj�D��}dd�|jj�D�}|||jfS)Ncss$|]}|jtkr|VqdS)N)rar.)rQr5rrrr��
sz(Signature._hash_basis.<locals>.<genexpr>cSs+i|]!}|jtkr||j�qSr)rar.r^)rQr5rrrra�
s	z)Signature._hash_basis.<locals>.<dictcomp>)rXr(r)r&)r�r��
kwo_paramsrrr�_hash_basis�
s"zSignature._hash_basiscCs:|j�\}}}t|j��}t|||f�S)N)r*�	frozensetr)r)r�r�r)r&rrrr�
szSignature.__hash__cCs9||krdSt|t�s#tS|j�|j�kS)NT)rr%rr*)r�rrrrr�
s
zSignature.__eq__r�FcCset�}t|jj��}f}t|�}x�yt|�}Wntk
rMyt|�}	Wntk
rxPYn�X|	jtkr�Pn�|	j|kr�|	jt	kr�d}
|
j
d|	j�}
t|
�d�|	f}Pnh|	jtks�|	j
tk	r|	f}Pn=|r|	f}Pn*d}
|
j
d|	j�}
t|
�d�Yq3Xyt|�}	Wn!tk
r�td�d�Yq3X|	jttfkr�td�d�|	jtkr�|g}|j|�t|�||	j<P|	j|krtdj
d|	j��d�|||	j<q3Wd}x�tj||�D]�}	|	jtkrT|	}q6|	jtkrfq6|	j}
y|j|
�}WnRtk
r�|r�|	jtkr�|	j
tkr�tdj
d|
��d�Yq6X|	jt	krtdj
d|	j���|||
<q6W|rU|dk	r1|||j<n$tdj
dtt|�����|j||�S)NzA{arg!r} parameter is positional only, but was passed as a keywordrBz$missing a required argument: {arg!r}ztoo many positional argumentsz$multiple values for argument {arg!r}z*got an unexpected keyword argument {arg!r})rr�r(r)r��
StopIterationrar-r^r*rjr�r/r,r�r.rrXr��chainr�rk�_bound_arguments_cls)r�rrr�r�r(Z
parameters_exZarg_valsZarg_valr5rWr)Zkwargs_paramr�rrr�_bind�
s�	

			
	
		
	zSignature._bindcOs|dj|dd�|�S)Nrr)r/)rrrrr�bindmszSignature.bindcOs$|dj|dd�|dd�S)Nrrr�T)r/)rrrrrr�tszSignature.bind_partialcCs.t|�t|jj��fd|jifS)Nr!)rrXr"r)r!)r�rrrr
{s	zSignature.__reduce__cCs|d|_dS)Nr!)r!)r�rrrrr�szSignature.__setstate__cCsdj|jj|�S)Nz<{} {}>)rjr�r~)r�rrrr�szSignature.__repr__c	Csg}d}d}x�|jj�D]�}t|�}|j}|tkrRd}n|rk|jd�d}|tkr�d}n%|tkr�|r�|jd�d}|j|�q"W|r�|jd�djdj	|��}|j
tk	rt|j
�}|dj|�7}|S)NFTr�r?z({})z, z -> {})
r(r)r�rar*rAr-r.rjr�r&r�r<)	r�r]Zrender_pos_only_separatorZrender_kw_only_separatorr5rraZrenderedZannorrrr�s0		
	

zSignature.__str__)r!r")r~rxryrr�r�rr.r�r'r�r\r%r&r(rUr(r&r�r;r*rrr/r0r�r
rrrrrrrr%U
s.2			�r%r'cCstj|d|�S)Nr')r%r()r`r'rrrr��sr�cCs^ddl}ddl}|j�}|jddd�|jdddddd	�|j�}|j}|jd
�\}}}y|j|�}}	Wn`tk
r�}
z@dj	|t
|
�j|
�}t|dt
j�td
�WYdd}
~
XnX|r5|jd�}|	}x|D]}
t||
�}qW|	jt
jkrdtddt
j�td�|jrJtdj	|��tdj	t|	���tdj	|	j��||	kr�tdj	t|	j���t|	d�r=tdj	|	j��n>yt|�\}}Wntk
r)YnXtdj	|��td�ntt|��dS)Nrr
�helpzCThe object to be analysed. It supports the 'module:qualname' syntaxz-dz	--details�action�
store_truez9Display info about the module rather than its source coder�zFailed to import {} ({}: {})r�r�rsz#Can't get info for builtin modules.rz
Target: {}z
Origin: {}z
Cached: {}z
Loader: {}�__path__zSubmodule search path: {}zLine: {}r�)�argparser��ArgumentParser�add_argument�
parse_argsr
�	partition�
import_modulerYrjrr~�printru�stderr�exitrzrC�builtin_module_namesZdetailsr��
__cached__r:r�rr4r�r)r5r��parserr�targetZmod_nameZ	has_attrsZattrsr`r�r_rW�parts�part�__rtrrr�_main�sV			

	

rEr�)��
__author__r�Zdis�collections.abcr(�enumZimportlib.machineryr�r�r�r�r�rur�r�rr�r�r��operatorrrr�globalsZmod_dictZCOMPILER_FLAG_NAMESr?rLrMr6r
rrrrrrrrr!r"r$r&r+r-r/r1r3r4r7rOrPrbr:rmrrr{r�r�r�r�r�r�r�r�r�r�r�r�r�r�rYr�r�r�rrrrr	rr
rrrrr6r9r<r>r�rKrNrUrXr]r^rmrnrvrw�_fieldsrxr|rr�r�r�r
r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�Z_WrapperDescriptor�allZ_MethodWrapperr�r>Z_ClassMethodWrapperr2r�r�r�r�r�r�r�r�r�r�r�r$r�r��IntEnumrr�r*r�r+r�r-r�r.r�r/r�rr%r�rEr~rrrr�<module>sN		
	

	
	,t!
;	.I-7


	[
							)		>5 			0LH�Q�					���`:

?>