OwlCyberSecurity - MANAGER
Edit File: inspect.cpython-39.pyc
a ����?�g�����������������������@���s���d�Z�dZddlZddlZddlZddlZddlZddlZ ddl Z ddlZddlZddl Z ddlZddlZddlZddlZddlZddlZddlZddlmZ�ddlmZmZ�e��Zej���D�]\ZZeede�<�q�dZdd ��Z d d��Z!dd ��Z"dd��Z#dd��Z$e%ed��rdd��Z&ndd��Z&e%ed��r2dd��Z'ndd��Z'dd��Z(dd��Z)dd��Z*d d!��Z+d"d#��Z,d$d%��Z-d&d'��Z.d(d)��Z/d*d+��Z0d,d-��Z1d.d/��Z2d0d1��Z3d2d3��Z4d4d5��Z5d6d7��Z6d�d8d9�Z7ed:d;�Z8d<d=��Z9d>d?��Z:dd@�dAdB�Z;dCdD��Z<dEdF��Z=dGdH��Z>dIdJ��Z?dKdL��Z@dMdN��ZAdOdP��ZBdQdR��ZCd�dSdT�ZDi�ZEi�ZFd�dUdV�ZGG�dWdX��dXeH�ZIG�dYdZ��dZejJ�ZKd[d\��ZLd]d^��ZMG�d_d`��d`eH�ZNG�dadb��db�ZOdcdd��ZPdedf��ZQdgdh��ZRdidj��ZSd�dldm�ZTedndo�ZUdpdq��ZVedrds�ZWdtdu��ZXedvdw�ZYdxdy��ZZedzd{�Z[d|d}��Z\d�d~d�Z]d�d���Z^dddd�i�i�e_d�d���d�d���d�d���d�d���e]fd�d��Z`e_d�d���d�d���d�d���fd�d��Zad�d���Zbd�d���Zcd�d���Zded�d��Zed�d���Zfed�d��Zgd�d�d��Zhd�d���Zied�d�egjj��Zkd�d�d��Zld�d�d��Zmd�d���Zn�d�d�d��Zo�dd�d��Zpeq��Zrd�d���Zsd�d���Ztd�d���Zud�d���Zvd�d���Zwerfd�d��Zxd�Zyd�Zzd�Z{d�Z|d�d���Z}d�d���Z~d�Zd�Z�d�Z�d�Z�d�dń�Z�d�dDŽ�Z�e�e�j��Z�e�e�j��Z�e�e�j�d���Z�e�e�e�ej�fZ�d�dʄ�Z��dd�d̄Z�d�d΄�Z�d�dЄ�Z�d�d҄�Z�d�dԄ�Z�d�dք�Z��dd�dلZ��dd�dۄZ��dd�d݄Z�d�d�dޜd�d�Z�G�d�d��d�Z�G�d�d��d�Z�G�d�d��d�ej��Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�e�d�e�d�e�d�e�d�e�d�iZ�G�d�d��d�Z�G�d�d��d�Z�G�d�d��d�Z�d�d�d�d�Z�d�d���Z�e�d�k�r�e����dS�(��a��Get useful information from live Python objects. This module encapsulates the interface provided by the internal special attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion. It also provides some help for examining source code and class layout. Here are some of the useful functions provided by this module: ismodule(), isclass(), ismethod(), isfunction(), isgeneratorfunction(), isgenerator(), istraceback(), isframe(), iscode(), isbuiltin(), isroutine() - check object types getmembers() - get members of an object that satisfy a given condition getfile(), getsourcefile(), getsource() - find an object's source code getdoc(), getcomments() - get documentation on an object getmodule() - determine the module that an object came from getclasstree() - arrange classes so as to represent their hierarchy getargvalues(), getcallargs() - get info about function arguments getfullargspec() - same, with support for Python 3 features formatargvalues() - format an argument spec getouterframes(), getinnerframes() - get info about frames currentframe() - get the current stack frame stack(), trace() - get info about frames on the stack or in a traceback signature() - get a Signature object for the callable )zKa-Ping Yee <ping@lfw.org>z'Yury Selivanov <yselivanov@sprymix.com>�����N)� attrgetter)� namedtuple�OrderedDictZCO_i���c�����������������C���s���t�|�tj�S�)z�Return true if the object is a module. Module objects provide these attributes: __cached__ pathname to byte compiled file __doc__ documentation string __file__ filename (missing for built-in modules))� isinstance�types� ModuleType��object��r ����,/opt/alt/python39/lib64/python3.9/inspect.py�ismodule@���s����r���c�����������������C���s ���t�|�t�S�)z�Return true if the object is a class. Class objects provide these attributes: __doc__ documentation string __module__ name of module in which this class was defined)r����typer���r ���r ���r����isclassI���s����r���c�����������������C���s���t�|�tj�S�)a_��Return true if the object is an instance method. Instance method objects provide these attributes: __doc__ documentation string __name__ name with which this method was defined __func__ function object containing implementation of method __self__ instance to which this method is bound)r���r���� MethodTyper���r ���r ���r����ismethodQ���s����r���c�����������������C���s:���t�|��st|��st|��rdS�t|��}t|d�o8t|d��S�)a���Return true if the object is a method descriptor. But not if ismethod() or isclass() or isfunction() are true. This is new in Python 2.2, and, for example, is true of int.__add__. An object passing this test has a __get__ attribute but not a __set__ attribute, but beyond that the set of attributes varies. __name__ is usually sensible, and __doc__ often is. Methods implemented via descriptors that also pass one of the other tests return false from the ismethoddescriptor() test, simply because the other tests promise more -- you can, e.g., count on having the __func__ attribute (etc) when an object passes ismethod().F�__get__�__set__�r���r���� isfunctionr ����hasattr�r ����tpr ���r ���r����ismethoddescriptor[���s����r���c�����������������C���s8���t�|��st|��st|��rdS�t|��}t|d�p6t|d�S�)a}��Return true if the object is a data descriptor. Data descriptors have a __set__ or a __delete__ attribute. Examples are properties (defined in Python) and getsets and members (defined in C). Typically, data descriptors will also have __name__ and __doc__ attributes (properties, getsets, and members have both of these attributes), but this is not guaranteed.Fr���� __delete__r���r���r ���r ���r����isdatadescriptoro���s����r����MemberDescriptorTypec�����������������C���s���t�|�tj�S�)��Return true if the object is a member descriptor. Member descriptors are specialized descriptors defined in extension modules.)r���r���r���r���r ���r ���r����ismemberdescriptor���s����r���c�����������������C���s���dS�)r���Fr ���r���r ���r ���r���r�������s�����GetSetDescriptorTypec�����������������C���s���t�|�tj�S�)��Return true if the object is a getset descriptor. getset descriptors are specialized descriptors defined in extension modules.)r���r���r���r���r ���r ���r����isgetsetdescriptor����s����r ���c�����������������C���s���dS�)r���Fr ���r���r ���r ���r���r �������s����c�����������������C���s���t�|�tj�S�)a(��Return true if the object is a user-defined function. Function objects provide these attributes: __doc__ documentation string __name__ name with which this function was defined __code__ code object containing compiled function bytecode __defaults__ tuple of any default values for arguments __globals__ global namespace in which this function was defined __annotations__ dict of parameter annotations __kwdefaults__ dict of keyword only parameters with defaults)r���r����FunctionTyper���r ���r ���r���r�������s����r���c�����������������C���s6���t�|��r|�j}�q�t�|��}�t|��s&dS�t|�jj|@��S�)z�Return true if ``f`` is a function (or a method or functools.partial wrapper wrapping a function) whose code object has the given ``flag`` set in its flags.F)r����__func__� functools�_unwrap_partialr����bool�__code__�co_flags)�f�flagr ���r ���r����_has_code_flag����s���� r*���c�����������������C���s ���t�|�t�S�)z�Return true if the object is a user-defined generator function. Generator function objects provide the same attributes as functions. See help(isfunction) for a list of attributes.)r*���ZCO_GENERATOR��objr ���r ���r����isgeneratorfunction����s����r-���c�����������������C���s ���t�|�t�S�)zuReturn true if the object is a coroutine function. Coroutine functions are defined with "async def" syntax. )r*���ZCO_COROUTINEr+���r ���r ���r����iscoroutinefunction����s����r.���c�����������������C���s ���t�|�t�S�)z�Return true if the object is an asynchronous generator function. Asynchronous generator functions are defined with "async def" syntax and have "yield" expressions in their body. )r*���ZCO_ASYNC_GENERATORr+���r ���r ���r����isasyncgenfunction����s����r/���c�����������������C���s���t�|�tj�S�)z7Return true if the object is an asynchronous generator.)r���r����AsyncGeneratorTyper���r ���r ���r���� isasyncgen����s����r1���c�����������������C���s���t�|�tj�S�)a��Return true if the object is a generator. Generator objects provide these attributes: __iter__ defined to support iteration over container close raises a new GeneratorExit exception inside the generator to terminate the iteration gi_code code object gi_frame frame object or possibly None once the generator has been exhausted gi_running set to 1 when generator is executing, 0 otherwise next return the next item from the container send resumes the generator and "sends" a value that becomes the result of the current yield-expression throw used to raise an exception inside the generator)r���r���� GeneratorTyper���r ���r ���r����isgenerator����s����r3���c�����������������C���s���t�|�tj�S�)z)Return true if the object is a coroutine.)r���r���� CoroutineTyper���r ���r ���r����iscoroutine����s����r5���c�����������������C���s6���t�|�tj�p4t�|�tj�r(t|�jjt@��p4t�|�tj j �S�)z?Return true if object can be passed to an ``await`` expression.)r���r���r4���r2���r%����gi_coder'���ZCO_ITERABLE_COROUTINE�collections�abc� Awaitabler���r ���r ���r����isawaitable����s������r:���c�����������������C���s���t�|�tj�S�)ab��Return true if the object is a traceback. Traceback objects provide these attributes: tb_frame frame object at this level tb_lasti index of last attempted instruction in bytecode tb_lineno current line number in Python source code tb_next next inner traceback object (called by this level))r���r���� TracebackTyper���r ���r ���r����istraceback����s����r<���c�����������������C���s���t�|�tj�S�)a`��Return true if the object is a frame object. Frame objects provide these attributes: f_back next outer frame object (this frame's caller) f_builtins built-in namespace seen by this frame f_code code object being executed in this frame f_globals global namespace seen by this frame f_lasti index of last attempted instruction in bytecode f_lineno current line number in Python source code f_locals local namespace seen by this frame f_trace tracing function for this frame, or None)r���r���� FrameTyper���r ���r ���r����isframe����s����r>���c�����������������C���s���t�|�tj�S�)a���Return true if the object is a code object. Code objects provide these attributes: co_argcount number of arguments (not including *, ** args or keyword only arguments) co_code string of raw compiled bytecode co_cellvars tuple of names of cell variables co_consts tuple of constants used in the bytecode co_filename name of file in which this code object was created co_firstlineno number of first line in Python source code co_flags bitmap: 1=optimized | 2=newlocals | 4=*arg | 8=**arg | 16=nested | 32=generator | 64=nofree | 128=coroutine | 256=iterable_coroutine | 512=async_generator co_freevars tuple of names of free variables co_posonlyargcount number of positional only arguments co_kwonlyargcount number of keyword only arguments (not including ** arg) co_lnotab encoded mapping of line numbers to bytecode indices co_name name with which this code object was defined co_names tuple of names other than arguments and function locals co_nlocals number of local variables co_stacksize virtual machine stack space required co_varnames tuple of names of arguments and local variables)r���r����CodeTyper���r ���r ���r����iscode��s����r@���c�����������������C���s���t�|�tj�S�)a,��Return true if the object is a built-in function or method. Built-in functions and methods provide these attributes: __doc__ documentation string __name__ original name of this function or method __self__ instance to which a method is bound, or None)r���r����BuiltinFunctionTyper���r ���r ���r���� isbuiltin��s����rB���c�����������������C���s ���t�|��pt|��pt|��pt|��S�)z<Return true if the object is any kind of function or method.)rB���r���r���r���r���r ���r ���r���� isroutine'��s�������rC���c�����������������C���s����t�|�t�sdS�|�jt@�rdS�tt|��tj�s0dS�t|�d�r>dS�|�j� ��D�]\}}t |dd�rH�dS�qH|�jD�]6}t |dd�D�]$}t |�|d�}t |dd�rz��dS�qzqjdS�)z:Return true if the object is an abstract base class (ABC).FT�__abstractmethods__�__isabstractmethod__r ���N)r���r ���� __flags__�TPFLAGS_IS_ABSTRACT� issubclassr8����ABCMetar����__dict__�items�getattr� __bases__)r ����name�value�baser ���r ���r���� isabstract.��s"���� rQ���c�������������� ���C���s��t�|��r|�ft|���}nd}g�}t��}t|��}z:|�jD�].}|j���D�]\}}t|tj �rD|� |��qDq6W�n�tyz���Y�n0�|D�]|} zt|�| �} | |v�r�t�W�n8�ty����|D�]}| |jv�r�|j| �} �q�q�Y�q�Y�n0�|r�|| �r�|� | | f��|� | ��q�|jdd��d��|S�)z�Return all members of an object as (name, value) pairs sorted by name. Optionally, only return members that satisfy a given predicate.r ���c�����������������S���s���|�d�S�)Nr���r ���)Zpairr ���r ���r����<lambda>o�������zgetmembers.<locals>.<lambda>��key)r����getmro�set�dirrM���rJ���rK���r���r����DynamicClassAttribute�append�AttributeErrorrL����add�sort)r ���Z predicate�mro�results� processed�namesrP����k�vrU���rO���r ���r ���r���� getmembersF��s:���� rd���� Attributezname kind defining_class objectc�����������������C���sT��t�|��}t�t|���}tdd��|D���}|�f|�}||�}t|��}|D�].}|j���D�]\}}t|tj�rR|� |��qRqDg�} t ��} |D��]�}d}d} d}|| v�rzz|dkr�td��t|�|�} W�n$�ty��}�zW�Y�d}~n�d}~0�0�t| d|�}||v�rzd}d}|D�] }t||d�}|| u��r|}�q|D�]@}z|� |�|�}W�n�t�yX���Y��q*Y�n0�|| u��r*|}�q*|du�rz|}|D�]0}||jv��r~|j|�}||v�r�|}��q��q~|du��r�q�| du�r�| n|}t|ttjf��r�d}|}nFt|ttjf��rd}|}n*t|t��rd }|}nt|��r,d }nd}| � t||||���| �|��q�| S�)aN��Return list of attribute-descriptor tuples. For each name in dir(cls), the return list contains a 4-tuple with these elements: 0. The name (a string). 1. The kind of attribute this is, one of these strings: 'class method' created via classmethod() 'static method' created via staticmethod() 'property' created via property() 'method' any other flavor of method or descriptor 'data' not a method 2. The class which defined this attribute (a class). 3. The object as obtained by calling getattr; if this fails, or if the resulting object does not live anywhere in the class' mro (including metaclasses) then the object is looked up in the defining class's dict (found by walking the mro). If one of the items in dir(cls) is stored in the metaclass it will now be discovered and not have None be listed as the class in which it was defined. Any items whose home class cannot be discovered are skipped. c�����������������s���s���|�]}|t�tfvr|V��qd�S��N)r ���r ���)�.0�clsr ���r ���r���� <genexpr>���rS���z'classify_class_attrs.<locals>.<genexpr>NrJ���z)__dict__ is special, don't want the proxy�__objclass__z static methodzclass method�property�method�data)rV���r ����tuplerX���rJ���rK���r���r���rY���rZ���rW���� ExceptionrL����__getattr__r[����staticmethod�BuiltinMethodType�classmethod�ClassMethodDescriptorTyperk���rC���re���r\���)rh���r^���ZmetamroZclass_basesZ all_basesra���rP���rb���rc����resultr`���rN���ZhomeclsZget_objZdict_obj�excZlast_clsZsrch_clsZsrch_objr,����kindr ���r ���r����classify_class_attrst��s����� rx���c�����������������C���s���|�j�S�)zHReturn tuple of base classes (including cls) in method resolution order.)�__mro__)rh���r ���r ���r���rV������s����rV�����stopc�������������������s|�����du�rdd��}n��fdd�}|�}t�|�|i}t���}||��rx|�j}�t�|��}||v�s`t|�|krntd�|���|�||<�q6|�S�)an��Get the object wrapped by *func*. Follows the chain of :attr:`__wrapped__` attributes returning the last object in the chain. *stop* is an optional callback accepting an object in the wrapper chain as its sole argument that allows the unwrapping to be terminated early if the callback returns a true value. If the callback never returns a true value, the last object in the chain is returned as usual. For example, :func:`signature` uses this to stop unwrapping if any object in the chain has a ``__signature__`` attribute defined. :exc:`ValueError` is raised if a cycle is encountered. Nc�����������������S���s ���t�|�d�S��N�__wrapped__�r����r(���r ���r ���r����_is_wrapper���s����zunwrap.<locals>._is_wrapperc��������������������s���t�|�d�o��|���S�r|���r~���r���rz���r ���r���r������s����z!wrapper loop when unwrapping {!r})�id�sys�getrecursionlimitr}����len� ValueError�format)�funcr{���r����r(����memoZrecursion_limitZid_funcr ���rz���r����unwrap���s���� r����c�����������������C���s���|�����}t|�t|�����S�)zBReturn the indent size, in spaces, at the start of a line of text.)� expandtabsr�����lstrip)�lineZexpliner ���r ���r���� indentsize��s����r����c�����������������C���sN���t�j�|�j�}|d�u�rd�S�|�j�d�d�d��D�]}t||�}q.t|�sJd�S�|S�)N�.���)r�����modules�get� __module__�__qualname__�splitrL���r���)r����rh���rN���r ���r ���r���� _findclass��s����r����c�������������� ���C���s��t�|��rR|�jD�]>}|turz |j}W�n�ty:���Y�qY�n0�|d�ur|��S�qd�S�t|��r�|�jj}|�j}t�|�r�t t ||d��d�|�ju�r�|}n|j }�n$t|��r�|�j}t|��}|d�u�s�t ||�|�ur�d�S�n�t |���r|�j}|�j}t�|��r|jd�|�|�jk�r|}n|j }n�t|�t��rN|�j}|j}t|�}|d�u��sHt ||�|�u�r�d�S�nnt|���sbt|���r�|�j}|�j}t ||�|�u�r�d�S�t|���r�t |dd��}t|t��r�||v��r�||�S�nd�S�|jD�]D}zt ||�j}W�n�t�y����Y��q�Y�n0�|d�u�r�|��S��q�d�S�)Nr"���r����� __slots__)r���ry���r ����__doc__r[���r���r"����__name__�__self__rL���� __class__r���r����rB���r����r���rk����fgetr���r���rj���r����dict)r,���rP����docrN����selfrh���r�����slotsr ���r ���r����_finddoc!��sn���� � � r����c�������������� ���C���sd���z |�j�}W�n�ty���Y�dS�0�|du�rNzt|��}W�n�ttfyL���Y�dS�0�t|t�s\dS�t|�S�)z�Get the documentation string for an object. All tabs are expanded to spaces. To clean up docstrings that are indented to line up with blocks of code, any whitespace than can be uniformly removed from the second line onwards is removed.N)r����r[���r����� TypeErrorr����str�cleandoc)r ���r����r ���r ���r����getdoc_��s���� r����c�����������������C���s����z|������d�}W�n�ty&���Y�dS�0�tj}|dd��D�]*}t|����}|r:t|�|�}t||�}q:|rz|d����|d<�|tjk�r�tdt|��D�]}||�|d��||<�q�|r�|d�s�|� ���q�|r�|d�s�|� d��q�d� |�S�dS�)z�Clean up indentation from docstrings. Any whitespace that can be uniformly removed from the second line onwards is removed.� N����r���r����)r����r�����UnicodeErrorr�����maxsizer����r�����min�range�pop�join)r�����linesZmarginr����Zcontent�indent�ir ���r ���r���r����r��s&���� ( r����c�����������������C���s����t�|��r(t|�dd�r|�jS�td�|����t|��rht|�d�rZtj� |�j �}t|dd�rZ|jS�td�|����t|��rv|�j}�t |��r�|�j}�t|��r�|�j}�t|��r�|�j}�t|��r�|�jS�td�t|��j���dS�)z@Work out which source or compiled file an object was defined in.�__file__Nz{!r} is a built-in moduler����z{!r} is a built-in classzVmodule, class, method, function, traceback, frame, or code object was expected, got {})r���rL���r����r����r����r���r���r����r����r����r����r���r"���r���r&���r<����tb_framer>����f_coder@����co_filenamer ���r����)r ����moduler ���r ���r����getfile���s.���� �r����c�����������������C���sT���t�j�|��}dd��tj���D��}|����|D�]"\}}|�|�r,|d|����S�q,dS�)z1Return the module name for a given file, or None.c�����������������S���s���g�|�]}t�|��|f�qS�r ���)r����)rg����suffixr ���r ���r���� <listcomp>���s����z!getmodulename.<locals>.<listcomp>N)�os�path�basename� importlib� machinery�all_suffixesr]����endswith)r����Zfname�suffixesZneglenr����r ���r ���r���� getmodulename���s����� r����c��������������������s����t�|����tjjdd��}|tjjdd��7�}t��fdd�|D���r`tj����d�tjj d����nt��fdd�tjj D���r~dS�tj����r���S�tt |����dd�dur���S���tjv�r���S�dS�)z�Return the filename that can be used to locate an object's source. Return None if no way can be identified to get the source. Nc�����������������3���s���|�]}����|�V��qd�S�rf����r�����rg����s��filenamer ���r���ri������rS���z getsourcefile.<locals>.<genexpr>r���c�����������������3���s���|�]}����|�V��qd�S�rf���r����r����r����r ���r���ri������rS���� __loader__)r����r����r�����DEBUG_BYTECODE_SUFFIXES�OPTIMIZED_BYTECODE_SUFFIXES�anyr����r�����splitext�SOURCE_SUFFIXES�EXTENSION_SUFFIXES�existsrL���� getmodule� linecache�cache)r ���Zall_bytecode_suffixesr ���r����r���� getsourcefile���s"���� �� r����c�����������������C���s,���|du�rt�|��pt|��}tj�tj�|��S�)z�Return an absolute path to the source or compiled file for an object. The idea is for each object to have a unique origin, so this routine normalizes the result as much as possible.N)r����r����r����r�����normcase�abspath)r ���� _filenamer ���r ���r���� getabsfile���s����r����c����������� ��� ���C���s���t�|��r|�S�t|�d�r$tj�|�j�S�|durD|tv�rDtj�t|��S�zt|�|�}W�n�tt fyj���Y�dS�0�|tv�r�tj�t|��S�tj� �����D�]\\}}t�|�r�t|d�r�|j}|t �|d�kr�q�|t |<�t|�}|j�t|<�ttj�|�<�q�|tv��r tj�t|��S�tjd�}t|�d��s$dS�t||�j��rLt||�j�}||�u��rL|S�tjd�}t||�j��r~t||�j�} | |�u��r~|S�dS�)zAReturn the module an object was defined in, or None if not found.r����Nr�����__main__r�����builtins)r���r���r����r����r����r����� modulesbyfiler����r�����FileNotFoundError�copyrK���r�����_filesbymodnamer����r����r�����realpathrL���) r ���r�����file�modnamer����r(����mainZ mainobjectZbuiltinZ builtinobjectr ���r ���r���r�������sJ���� � � r����c�������������������@���s���e�Zd�ZdS�)�ClassFoundExceptionN�r����r����r����r ���r ���r ���r���r������s���r����c�������������������@���s(���e�Zd�Zdd��Zdd��ZeZdd��ZdS�)�_ClassFinderc�����������������C���s���g�|�_�||�_d�S�rf���)�stack�qualname)r����r����r ���r ���r����__init__��s����z_ClassFinder.__init__c�����������������C���s<���|�j��|j��|�j��d��|��|��|�j�����|�j�����d�S�)Nz<locals>)r����rZ���rN���� generic_visitr�����r�����noder ���r ���r����visit_FunctionDef��s ���� z_ClassFinder.visit_FunctionDefc�����������������C���sb���|�j��|j��|�jd�|�j��krJ|jr4|jd�j}n|j}|d8�}t|��|��|��|�j�� ���d�S�)Nr����r���r����) r����rZ���rN���r����r�����decorator_list�linenor����r����r����)r����r�����line_numberr ���r ���r����visit_ClassDef��s���� z_ClassFinder.visit_ClassDefN)r����r����r����r����r����Zvisit_AsyncFunctionDefr����r ���r ���r ���r���r���� ��s���r����c����������� ��� ���C���s���t�|��}|rt�|��n$t|��}|�d�r4|�d�s<td��t|�|�}|rZt�||j �}n t�|�}|sptd��t |��r�|dfS�t|����r�|�j}d� |�}t�|�}t|�}z|�|��W�n6�ty��}�z|jd�} || fW��Y�d}~S�d}~0�0�td��t|���r |�j}�t|���r|�j}�t|���r*|�j}�t|���r:|�j}�t|���r�t|�d ��sXtd ��|�jd�} t� d�}| dk�r�z|| �}W�n�t!�y����td ��Y�n0�|�"|��r��q�| d�} �ql|| fS�td��dS�)ab��Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An OSError is raised if the source code cannot be retrieved.�<�>zsource code not availablezcould not get source coder�����Nzcould not find class definition�co_firstlinenoz"could not find function definitionr����z>^(\s*def\s)|(\s*async\s+def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)zlineno is out of boundszcould not find code object)#r����r����� checkcacher����� startswithr�����OSErrorr�����getlinesrJ���r���r���r����r�����ast�parser�����visitr�����argsr���r"���r���r&���r<���r����r>���r����r@���r���r�����re�compile� IndexError�match) r ���r����r����r����r�����sourceZtreeZclass_finder�er�����lnumZpatr����r ���r ���r���� findsource)��s`���� r��c�������������� ���C���s,��zt�|��\}}W�n�ttfy(���Y�dS�0�t|��r�d}|rR|d�dd��dkrRd}|t|�k�rx||����dv�rx|d�}qR|t|�k�r�||�dd��dkr�g�}|}|t|�k�r�||�dd��dkr�|�||������|d�}q�d�|�S��n>|dk�r(t ||��}|d�}|dk�r(||�� ��dd��dk�r(t ||��|k�r(||����� ��g}|dk�r�|d�}||����� ��}|dd��dk�r�t ||��|k�r�|g|dd�<�|d�}|dk��r��q�||����� ��}�qr|�r�|d����dk�r�g�|dd�<��q�|�r|d ����dk�rg�|d d�<��q�d�|�S�dS�) zwGet lines of comments immediately preceding an object's source code. Returns None when source can't be found. Nr�������z#!r����)r�����#r��r����r����)r��r����r����r���r�����striprZ���r����r����r����r����)r ���r����r����startZcomments�endr����Zcommentr ���r ���r����getcommentsm��sH���� $� $r��c�������������������@���s���e�Zd�ZdS�)� EndOfBlockNr����r ���r ���r ���r���r�����rS���r��c�������������������@���s ���e�Zd�ZdZdd��Zdd��ZdS�)�BlockFinderz@Provide a tokeneater() method to detect the end of a code block.c�����������������C���s4���d|�_�d|�_d|�_d|�_d|�_d|�_d|�_d�|�_d�S�)Nr���Fr����)r�����islambda�started�passline�indecorator�decoratorhasargs�last� body_col0�r����r ���r ���r���r�������s����zBlockFinder.__init__c�����������������C���sr��|�j�sB|�jsB|dkrd|�_n|dv�r8|dkr2d|�_d|�_�d|�_�n,|dkrZ|�jrVd|�_�n|dkrv|�jrtd|�_d|�_n�|tjkr�d|�_|d�|�_|�jr�t�|�jr�|�js�d|�_n�|�jr�n�|tj kr�|�j d�u�r�|�j�r�|d �|�_ |�jd �|�_d|�_n�|tjk�r|�jd �|�_|�jdk�rnt�nV|tj k�rL|�j d�u�rn|d �|�j k�rn|d�|�_n"|�jdk�rn|tj tjfv�rnt�d�S�) N�@T)�def�class�lambdar���(�)Fr���r����)r��r ��r ��r��r���tokenize�NEWLINEr��r���INDENTr��r�����DEDENT�COMMENT�NL)r����r ����tokenZsrowcolZerowcolr����r ���r ���r���� tokeneater���sL���� zBlockFinder.tokeneaterN)r����r����r����r����r����r��r ���r ���r ���r���r �����s��� r ��c�������������� ���C���sT���t���}z(t�t|��j�}|D�]}|j|���qW�n�ttfyD���Y�n0�|�d|j��S�)z@Extract the block of code at the top of the given list of lines.N) r ��r���generate_tokens�iter�__next__r��r���IndentationErrorr��)r����Zblockfinder�tokensZ_tokenr ���r ���r����getblock���s����r%��c�����������������C���sb���t�|��}�t|��\}}t|��r"|�j}�t|��s>t|��rF|�jjdkrF|dfS�t||d���|d�fS�dS�)a���Return a list of source lines and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of the lines corresponding to the object and the line number indicates where in the original source file the first line of code was found. An OSError is raised if the source code cannot be retrieved.z<module>r���Nr����) r����r��r<���r����r���r>���r�����co_namer%���r ���r����r���r ���r ���r����getsourcelines���s����� �r(��c�����������������C���s���t�|��\}}d�|�S�)a��Return the text of the source code for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a single string. An OSError is raised if the source code cannot be retrieved.r����)r(��r����r'��r ���r ���r���� getsource���s����r)��c�����������������C���sR���g�}|�j�tdd�d��|�D�]2}|�||jf��||v�r|�t||�||���q|S�)z-Recursive helper function for getclasstree().r����r����rT���)r]���r���rZ���rM����walktree)�classes�children�parentr_����cr ���r ���r���r*����s����r*��Fc�����������������C���s����i�}g�}|�D�]d}|j�r^|j�D�]>}||vr0g�||<�|||�vrJ||��|��|r||�v�r�qpqq||vr|�|��q|D�]}||�vrv|�|��qvt||d�S�)a���Arrange the given list of classes into a hierarchy of nested lists. Where a nested list appears, it contains classes derived from the class whose entry immediately precedes the list. Each entry is a 2-tuple containing a class and a tuple of its base classes. If the 'unique' argument is true, exactly one entry appears in the returned structure for each class in the given list. Otherwise, classes using multiple inheritance and their descendants will appear multiple times.N)rM���rZ���r*��)r+���uniquer,���rootsr.��r-��r ���r ���r����getclasstree��s ���� r1��� Argumentszargs, varargs, varkwc����������� ������C���s����t�|��std�|����|�j}|�j}|�j}t|d|���}t||||����}d}||7�}d}|�jt@�rx|�j|�}|d�}d}|�jt @�r�|�j|�}t ||�||�S�)a��Get information about the arguments accepted by a code object. Three things are returned: (args, varargs, varkw), where 'args' is the list of argument names. Keyword-only arguments are appended. 'varargs' and 'varkw' are the names of the * and ** arguments or None.z{!r} is not a code objectNr���r����)r@���r����r�����co_varnames�co_argcount�co_kwonlyargcount�listr'���� CO_VARARGS�CO_VARKEYWORDSr2��) �cora����nargsZnkwargsr����� kwonlyargs�step�varargs�varkwr ���r ���r����getargs+��s"���� r?���ArgSpeczargs varargs keywords defaultsc�����������������C���sD���t�jdtdd��t|��\}}}}}}}|s.|r6td��t||||�S�)ae��Get the names and default values of a function's parameters. A tuple of four things is returned: (args, varargs, keywords, defaults). 'args' is a list of the argument names, including keyword-only argument names. 'varargs' and 'keywords' are the names of the * and ** parameters or None. 'defaults' is an n-tuple of the default values of the last n parameters. This function is deprecated, as it does not support annotations or keyword-only parameters and will raise ValueError if either is present on the supplied callable. For a more structured introspection API, use inspect.signature() instead. Alternatively, use getfullargspec() for an API with a similar namedtuple based interface, but full support for annotations and keyword-only parameters. Deprecated since Python 3.5, use `inspect.getfullargspec()`. zhinspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()r���� stacklevelzgFunction has keyword-only parameters or annotations, use inspect.signature() API which can support them)�warnings�warn�DeprecationWarning�getfullargspecr����r@��)r����r����r=��r>���defaultsr;���kwonlydefaults�annr ���r ���r���� getargspecH��s������rJ���FullArgSpeczGargs, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotationsc�������������� ���C���sz��zt�|�ddtd�}W�n.�tyB�}�ztd�|�W�Y�d}~n d}~0�0�g�}d}d}g�}g�}i�}d} i�} |j|jurz|j|d<�|j���D�]�}|j}|j } |t u�r�|�| ��|j|jur�| |jf7�} nv|t u�r�|�| ��|j|jur�| |jf7�} nJ|tu�r�| }n<|tu��r(|�| ��|j|ju�r6|j| | <�n|tu��r6| }|j|jur�|j|| <�q�| �sXd} | �sbd} t||�||| || |�S�)a$��Get the names and default values of a callable object's parameters. A tuple of seven things is returned: (args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations). 'args' is a list of the parameter names. 'varargs' and 'varkw' are the names of the * and ** parameters or None. 'defaults' is an n-tuple of the default values of the last n parameters. 'kwonlyargs' is a list of keyword-only parameter names. 'kwonlydefaults' is a dictionary mapping names from kwonlyargs to defaults. 'annotations' is a dictionary mapping parameter names to annotations. Notable differences from inspect.signature(): - the "self" parameter is always reported, even for bound methods - wrapper chains defined by __wrapped__ *not* unwrapped automatically F��follow_wrapper_chains�skip_bound_arg�sigclszunsupported callableNr ����return)�_signature_from_callable� Signaturero���r�����return_annotation�empty� parameters�valuesrw���rN����_POSITIONAL_ONLYrZ����default�_POSITIONAL_OR_KEYWORD�_VAR_POSITIONAL� _KEYWORD_ONLY�_VAR_KEYWORD� annotationrK��)r�����sig�exr����r=��r>���posonlyargsr;���annotationsrG��� kwdefaults�paramrw���rN���r ���r ���r���rF��i��s\����� �rF���ArgInfozargs varargs keywords localsc�����������������C���s ���t�|�j�\}}}t||||�j�S�)a9��Get information about arguments passed into a particular frame. A tuple of four things is returned: (args, varargs, varkw, locals). 'args' is a list of the argument names. 'varargs' and 'varkw' are the names of the * and ** arguments or None. 'locals' is the locals dictionary of the given frame.)r?��r����rd���f_locals)�framer����r=��r>��r ���r ���r����getargvalues���s����rg��c�����������������C���sj���t�|�dd��dkr t|���dd�S�t|�tj�r4t|��S�t|�t�rb|�jd|fv�rR|�j S�|�jd�|�j �S�t|��S�)Nr�����typingztyping.r����r����r����) rL����repr�replacer���r����GenericAliasr����r ���r����r����)r]��Zbase_moduler ���r ���r����formatannotation���s���� rl��c��������������������s���t�|�dd������fdd�}|S�)Nr����c��������������������s ���t�|����S�rf���)rl��)r]���r����r ���r����_formatannotation���s����z5formatannotationrelativeto.<locals>._formatannotation)rL���)r ���rn��r ���rm��r����formatannotationrelativeto���s����ro��r ���c�����������������C���s���d|��S��N�*r ����rN���r ���r ���r���rR������rS���rR���c�����������������C���s���d|��S��N�**r ���rr��r ���r ���r���rR������rS���c�����������������C���s���dt�|���S��N�=�ri���rO���r ���r ���r���rR������rS���c�����������������C���s���d|��S�)Nz -> r ���)�textr ���r ���r���rR������rS���c ��������������������s<��ddl�m} �| dtdd������fdd�}g�}|rBt|��t|��}t|��D�]:\}}||�}|rz||krz|| |||����}|�|��qJ|dur�|�|||����n|r�|�d ��|r�|D�]2}||�}|r�||v�r�|| ||��7�}|�|��q�|du�r|�| ||����d d�|��d�}d ��v��r8||���d ���7�}|S�)a���Format an argument spec from the values returned by getfullargspec. The first seven arguments are (args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations). The other five arguments are the corresponding optional formatting functions that are called to turn names and values into strings. The last argument is an optional function to format the sequence of arguments. Deprecated since Python 3.5: use the `signature` function and `Signature` objects. r���)rD��zc`formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directlyr��rA��c��������������������s(����|��}|���v�r$|d���|����7�}|S�)Nz: r ���)�argru����ra��rl��� formatargr ���r����formatargandannotation���s����z-formatargspec.<locals>.formatargandannotationNrq��r���, r��rP��)rC��rD��rE��r����� enumeraterZ���r����)r����r=��r>��rG��r;��rH��ra��r|��� formatvarargs�formatvarkw�formatvalueZ formatreturnsrl��rD��r}���specsZfirstdefaultr����rz���specZ kwonlyargru���r ���r{��r���� formatargspec���s<����� r���c�����������������C���s���d|��S�rp��r ���rr��r ���r ���r���rR�����rS���c�����������������C���s���d|��S�rs��r ���rr��r ���r ���r���rR�����rS���c�����������������C���s���dt�|���S�ru��rw��rx��r ���r ���r���rR��� ��rS���c�����������������C���s����|||fdd�}g�} t�t|���D�]} | �||�| ����q |rV| �||�|||�����|rt| �||�|||�����dd�| ��d�S�)af��Format an argument spec from the 4 values returned by getargvalues. The first four arguments are (args, varargs, varkw, locals). The next four arguments are the corresponding optional formatting functions that are called to turn names and values into strings. The ninth argument is an optional function to format the sequence of arguments.c�����������������S���s���||��|||����S�rf���r ���)rN����localsr|��r���r ���r ���r����convert'��s����z formatargvalues.<locals>.convertr��r~��r��)r����r����rZ���r����)r����r=��r>��r���r|��r���r���r���r���r���r����r ���r ���r����formatargvalues��s����� r���c��������������������s������fdd�|D��}t�|�}|dkr,|d�}n>|dkr@dj|��}n*dj|dd�����}|dd��=�d �|�|�}td |�||rzdnd|dkr�d nd|f���d�S�)Nc��������������������s���g�|�]}|��vrt�|��qS�r ���rw��)rg���rN����rV��r ���r���r����4��rS���z&_missing_arguments.<locals>.<listcomp>r����r���r��z {} and {}z, {} and {}���r~��z*%s() missing %i required %s argument%s: %s� positional�keyword-onlyr����r����)r����r����r����r����)�f_nameZargnames�posrV��ra����missingr�����tailr ���r���r����_missing_arguments3��s���� ��r���c����������� ��� ������s����t�|�|�}t���fdd�|D���}|r:|dk} d|f�} n2|rTd} d|t�|�f�} nt�|�dk} tt�|��} d}|r�d}||dkr�d nd||dkr�d ndf�}td |�| | r�d nd|||dkr�|s�dndf���d�S�) Nc��������������������s���g�|�]}|��v�r|�qS�r ���r ���)rg���rz��r���r ���r���r����E��rS���z_too_many.<locals>.<listcomp>r����zat 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)r����r����r����) r���r����Zkwonlyr=��ZdefcountZgivenrV��ZatleastZkwonly_givenZpluralr^��Z kwonly_sig�msgr ���r���r���� _too_manyC��s*�������r���c����������������O���s��t�|��}|\}}}}}} } |�j}i�}t|��rB|�jdurB|�jf|�}t|�} t|�}|r^t|�nd}t| |�}t|�D�]}||�|||�<�qt|r�t||d���||<�t||��}|r�i�||<�|� ��D�]T\}}||vr�|s�t d||f���|||�|<�q�||v��rt d||f���|||<�q�| |k�r<|�s<t|||||| |��| |k��r�|d||���}|D�]}||v�rZt||d|���qZt |||�d���D�] \}}||v�r�||�||<��q�d}|D�]6}||v�r�| �r�|| v��r�| |�||<�n|d7�}�q�|�rt||d|��|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'.Nr���z*%s() got an unexpected keyword argument %rz(%s() got multiple values for argument %rTr����F)rF��r����r���r����r����r����r����rn���rW���rK���r����r���r���r��)r����r���Znamedr���r����r=��r>��rG��r;��rH��rI��r���Z arg2valueZnum_posZnum_argsZnum_defaults�nr����Zpossible_kwargs�kwrO���Zreqrz��r����kwargr ���r ���r����getcallargsX��sf���� � � � r����ClosureVarsz"nonlocals globals builtins unboundc����������� ������C���s����t�|��r|�j}�t|��s$td�|����|�j}|�jdu�r:i�}ndd��t|j|�j�D��}|�j }|� dtj�}t |�rt|j}i�}i�}t��}|jD�]`}|dv�r�q�z||�||<�W�q��ty����z||�||<�W�n�ty����|�|��Y�n0�Y�q�0�q�t||||�S�)a�� Get the mapping of free variables to their current values. Returns a named tuple of dicts mapping the current nonlocal, global and builtin references as seen by the body of the function. A final set of unbound names that could not be resolved is also provided. �{!r} is not a Python functionNc�����������������S���s���i�|�]\}}||j��qS�r ���)� cell_contents)rg����varZcellr ���r ���r���� <dictcomp>���s����z"getclosurevars.<locals>.<dictcomp>�__builtins__)�None�True�False)r���r"���r���r����r����r&����__closure__�zip�co_freevars�__globals__r����r����rJ���r���rW����co_names�KeyErrorr\���r���) r�����codeZ nonlocal_varsZ global_nsZ builtin_nsZglobal_varsZbuiltin_varsZ unbound_namesrN���r ���r ���r����getclosurevars���s<���� � �r���� Tracebackz+filename lineno function code_context indexr����c�����������������C���s����t�|��r|�j}|�j}�n|�j}t|��s2td�|����t|��p@t|��}|dkr�|d�|d��}zt |��\}}W�n�t y����d�}}Y�q�0�tdt|t |�|���}||||���}|d�|�}nd�}}t|||�jj||�S�)a���Get information about a frame or traceback object. A tuple of five things is returned: the filename, the line number of the current line, the function name, a list of lines of context from the source code, and the index of the current line within that list. The optional second argument specifies the number of lines of context to return, which are centered around the current line.z'{!r} is not a frame or traceback objectr���r����r��N)r<���� tb_linenor�����f_linenor>���r����r����r����r����r��r�����maxr����r����r���r����r&��)rf���contextr����r����r��r����r����indexr ���r ���r����getframeinfo���s$����r���c�����������������C���s���|�j�S�)zCGet the line number from a frame object, allowing for optimization.)r����rf��r ���r ���r���� getlineno���s����r���� FrameInfor���c�����������������C���s2���g�}|�r.|�ft�|�|��}|�t|����|�j}�q|S�)z�Get a list of records for a frame and all higher (calling) frames. Each record contains a frame object, filename, line number, function name, a list of lines of context, and index within the context.)r���rZ���r����f_back)rf��r���� framelist� frameinfor ���r ���r����getouterframes���s����r���c�����������������C���s4���g�}|�r0|�j�ft|�|��}|�t|����|�j}�q|S�)z�Get a list of records for a traceback's frame and all lower frames. Each record contains a frame object, filename, line number, function name, a list of lines of context, and index within the context.)r����r���rZ���r����tb_next)�tbr���r���r���r ���r ���r����getinnerframes���s����r���c�������������������C���s���t�td�rt�d�S�dS�)z?Return the frame of the caller or None if this is not possible.� _getframer����N)r���r����r���r ���r ���r ���r����currentframe��s����r���c�����������������C���s���t�t�d�|��S�)z@Return a list of records for the stack above the caller's frame.r����)r���r����r����r���r ���r ���r���r������s����r����c�����������������C���s���t�t���d�|��S�)zCReturn a list of records for the stack below the current exception.r��)r���r�����exc_infor���r ���r ���r����trace��s����r���c�����������������C���s���t�jd��|��S�)Nry���)r ���rJ���r���)�klassr ���r ���r����_static_getmro��s����r���c�����������������C���s6���i�}zt��|�d�}W�n�ty&���Y�n0�t�||t�S��NrJ���)r ����__getattribute__r[���r����r����� _sentinel)r,����attrZ instance_dictr ���r ���r����_check_instance ��s����r���c�������������� ���C���sF���t�|��D�]8}tt|��tu�rz|j|�W���S��ty>���Y�q0�qtS�rf���)r����_shadowed_dictr ���r���rJ���r���)r���r����entryr ���r ���r����_check_class)��s����r���c�����������������C���s&���zt�|���W�n�ty ���Y�dS�0�dS��NFT)r���r����r+���r ���r ���r����_is_type2��s ����r���c�������������� ���C���sl���t�jd�}t|��D�]T}z|�|�d�}W�n�ty:���Y�q0�t�|�tju�r^|jdkr^|j|u�s|��S�qt S�r���) r ���rJ���r���r���r���r���r���r����rj���r���)r���� dict_attrr���Z class_dictr ���r ���r���r���9��s���� �� r���c�������������� ���C���s��t�}t|��s>t|��}t|�}|t�u�s2t|�tju�rBt|�|�}n|�}t||�}|t�ur�|t�ur�tt|�d�t�ur�tt|�d�t�ur�|S�|t�ur�|S�|t�ur�|S�|�|u�r�tt|��D�]8}tt|��t�u�r�z|j |�W���S��t y����Y�q�0�q�|t�ur�|S�t|��dS�)a���Retrieve attributes without triggering dynamic lookup via the descriptor protocol, __getattr__ or __getattribute__. Note: this function may not be able to retrieve all attributes that getattr can fetch (like dynamically created attributes) and may find attributes that getattr can't (like descriptors that raise AttributeError). It can also return descriptor objects instead of instance members in some cases. See the documentation for details. r���r���N)r���r���r ���r���r���r���r���r���r���rJ���r���r[���)r,���r���rX��Zinstance_resultr���r���Zklass_resultr���r ���r ���r����getattr_staticG��s:����� �r����GEN_CREATED�GEN_RUNNING� GEN_SUSPENDED� GEN_CLOSEDc�����������������C���s,���|�j�r tS�|�jdu�rtS�|�jjdkr(tS�tS�)a#��Get current state of a generator-iterator. Possible states are: GEN_CREATED: Waiting to start execution. GEN_RUNNING: Currently being executed by the interpreter. GEN_SUSPENDED: Currently suspended at a yield expression. GEN_CLOSED: Execution has completed. Nr����)� gi_runningr����gi_framer����f_lastir���r���)� generatorr ���r ���r����getgeneratorstate|��s���� r���c�����������������C���s:���t�|��std�|����t|�dd�}|dur2|�jjS�i�S�dS�)z� Get the mapping of generator local variables to their current values. A dict is returned, with the keys the local variable names and values the bound values.z{!r} is not a Python generatorr���N)r3���r����r����rL���r���re��)r���rf��r ���r ���r����getgeneratorlocals���s����r����CORO_CREATED�CORO_RUNNING�CORO_SUSPENDED�CORO_CLOSEDc�����������������C���s,���|�j�r tS�|�jdu�rtS�|�jjdkr(tS�tS�)a&��Get current state of a coroutine object. Possible states are: CORO_CREATED: Waiting to start execution. CORO_RUNNING: Currently being executed by the interpreter. CORO_SUSPENDED: Currently suspended at an await expression. CORO_CLOSED: Execution has completed. Nr����)� cr_runningr����cr_framer���r���r���r���)� coroutiner ���r ���r����getcoroutinestate���s���� r���c�����������������C���s"���t�|�dd�}|dur|jS�i�S�dS�)z� Get the mapping of coroutine local variables to their current values. A dict is returned, with the keys the local variable names and values the bound values.r���N)rL���re��)r���rf��r ���r ���r����getcoroutinelocals���s����r���� from_bytesc�����������������C���s6���zt�|�|�}W�n�ty"���Y�dS�0�t|t�s2|S�dS�)z�Private helper. Checks if ``cls`` has an attribute named ``method_name`` and returns it only if it is a pure python function. N)rL���r[���r����_NonUserDefinedCallables)rh���Zmethod_nameZmethr ���r ���r����"_signature_get_user_defined_method���s���� r���c�������������� ���C���s���|�j�}t|����}|jpd}|jp$i�}|r2||�}z|�j|i�|��}W�n8�ty~�}�z d�|�} t| �|�W�Y�d}~n d}~0�0�d} |���D��] \}}z|j |�} W�n�t y����Y�nl0�|jtu�r�|� |��q�|jtu��r||v�r�d} |j| d�||<�n|� |j��q�|jtu��r"|j| d�||<�| r�|jtu�s6J��|jtu��rf||�jtd�}|||<�|�|��q�|jttfv��r�|�|��q�|jtu�r�|� |j��q�|�j|���d�S�) z�Private helper to calculate how 'wrapped_sig' signature will look like after applying a 'functools.partial' object (or alike) on it. r ���z+partial object {!r} has incorrect argumentsNFT)rX���rw����rU��)rU��r���rK���r�����keywords�bind_partialr����r����r����� argumentsr���rw���rW��r����rY��rj��rN���r[���move_to_endr\��rZ��rV��)�wrapped_sig�partialZ extra_argsZ old_params� new_paramsZpartial_argsZpartial_keywordsZbar_��r���Ztransform_to_kwonly� param_namerc��Z arg_valueZ new_paramr ���r ���r����_signature_get_partial���sN���� r���c�����������������C���sl���t�|�j����}|r$|d�jttfv�r,td��|d�j}|ttfv�rP|dd��}n|t ur`td��|�j |d�S�)zWPrivate helper to transform signatures for unbound functions to bound methods. r���zinvalid method signaturer����Nzinvalid argument typer���)rn���rU��rV��rw���r\��r[��r����rY��rW��rZ��rj��)r^���paramsrw���r ���r ���r����_signature_bound_method0��s���� r���c�����������������C���s&���t�|��p$t|��p$t|�t�p$|�ttfv�S�)zxPrivate helper to test if `obj` is a callable that might support Argument Clinic's __text_signature__ protocol. )rB���r���r���r���r ���r ���r+���r ���r ���r����_signature_is_builtinJ��s������ �r���c�����������������C���s����t�|��rt|��rdS�t|�dd�}t|�dd�}t|�dt�}t|�dt�}t|�dd�}t|tj�o�t|t�o�|du�sxt|t�o�|du�s�t|t �o�t|t �S�)z�Private helper to test if `obj` is a duck type of FunctionType. A good example of such objects are functions compiled with Cython, which have all attributes that a pure Python function would have, but have their code statically compiled. Fr����Nr&����__defaults__�__kwdefaults__�__annotations__) �callabler���rL����_voidr���r���r?���r����rn���r����)r,���rN���r���rG��rb��ra��r ���r ���r����_signature_is_functionlikeV��s ��������r���c�����������������C���sr���|���d�sJ��|��d�}|dkr*|��d�}|��d�}|dksH||ksHJ��|��d�}|dksf||ksfJ��|�d|��S�)z� Private helper to get first parameter name from a __text_signature__ of a builtin method, which should be in the following format: '($param1, ...)'. Assumptions are that the first argument won't have a default value or an annotation. z($�,r����r���:rv��r��)r�����find)r���r���Zcposr ���r ���r����_signature_get_bound_paramo��s���� r���c�����������������C���sd��|�s|�ddfS�d}d}dd��|���d�D��}t|�j}t�|�}d}d}g�}|j} d} tj}tj}t|�} | j tj ksxJ��|D�]�} | j | j�}}||kr�|dkr�|r�d}q||r�J��d}| d 7�} q||d kr�|r�J��|du�s�J��d}| d �}q|||k�r|dk�r|du��s J��| }q||�r6d}||k�r.|dk�s6| d ��| |��|dkr|| d��q|d�|�}|||fS�)a��� Private helper function. Takes a signature in Argument Clinic's extended signature format. Returns a tuple of three things: * that signature re-rendered in standard Python syntax, * the index of the "self" parameter (generally 0), or None if the function does not have a "self" parameter, and * the index of the last "positional only" parameter, or None if the signature has no positional-only parameters. Nc�����������������S���s���g�|�]}|��d���qS�)�ascii)�encode)rg����lr ���r ���r���r�������rS���z6_signature_strip_non_python_syntax.<locals>.<listcomp>r����Fr���r���Tr�����/�$r��r~��� r����) r����r!��r"��r��rZ���r���OP� ERRORTOKEN�nextr ����ENCODING�stringr����)� signature�self_parameter�last_positional_onlyr����r���Ztoken_streamZ delayed_commaZskip_next_commary��r\���Zcurrent_parameterr��r���tr ���r���clean_signaturer ���r ���r����"_signature_strip_non_python_syntax���sZ���� r��Tc�������������� ������sh��ddl��|�j��t|�\}}}d|�d�}z��|�}W�n�tyL���d}Y�n0�t|�j�shtd�|���|j d�} g����j �t���d}i��t|dd�} | r�t j�| d�}|r�|j�t j���� �fdd����� fd d �� G��� fdd�d�j���f���������fd d� }t| jj�}t| jj�} tj|| dd�}|du�rH��j�n��j�ttt|���D�](\}\}}|||��||k�r^��j��q^| jj�r���j�|| jj�����j�t| jj | jj!�D�]\}}|||���q�| jj"�r��j#�|| jj"���|du�rZ��sJ��t|dd�}|du}t$|�}|�r@|�s4|�r@��%d��n�d�j&��jd�}|�d<�|��|�j d�S�)zdPrivate helper to parse content of '__text_signature__' and return a Signature based on it. r���Nzdef fooz: passz"{!r} builtin has invalid signaturer����c��������������������s(���t�|���j�sJ��|�jd�ur"td��|�jS�)Nz'Annotations are not currently supported)r���rz��r]��r����)r����)r����r ���r���� parse_name���s���� z&_signature_fromstr.<locals>.parse_namec��������������������sx���zt�|���}W�n:�tyH���zt�|���}W�n�tyB���t���Y�n0�Y�n0�t|tttttt d��f�rn��� |�S�t���d�S�rf���)�eval� NameError�RuntimeErrorr���r�����int�float�bytesr%���r ���ZConstant)r����rO���)r�����module_dict�sys_module_dictr ���r���� wrap_value���s���� z&_signature_fromstr.<locals>.wrap_valuec�����������������������s(���e�Zd�Z���fdd�Z���fdd�ZdS�)z,_signature_fromstr.<locals>.RewriteSymbolicsc��������������������s\���g�}|}t�|��j�r(|�|j��|j}qt�|��j�s:t���|�|j��d�t |��}�|�S�)Nr����) r���re���rZ���r���rO����Namer��r����r�����reversed)r����r�����ar���rO����r����r��r ���r����visit_Attribute��s����z<_signature_fromstr.<locals>.RewriteSymbolics.visit_Attributec��������������������s���t�|j��j�st����|j�S�rf���)r����ctxZLoadr����r����r����r��r ���r���� visit_Name��s����z7_signature_fromstr.<locals>.RewriteSymbolics.visit_NameN)r����r����r����r��r��r ���r��r ���r����RewriteSymbolics��s���r��c��������������������s�����|��}|�u�rd�S�|rn|t�urnz����|�}��|�}W�n�tyP����}Y�n0�|�u�r^d�S�|�urj|n|}����|�|�d���d�S�)N�rX��r]��)�_emptyr����Zliteral_evalr����rZ���)Z name_nodeZdefault_noderX��rN����o)� Parameterr��r����rT���invalidrw���rU��r��r ���r����p��s���� z_signature_fromstr.<locals>.p)� fillvaluer����r����rS��)'r�����_parameter_clsr��r�����SyntaxErrorr���ZModuler����r�����bodyrT��r ���rL���r����r����r����rJ���r����ZNodeTransformerr��r����rG��� itertools�zip_longest�POSITIONAL_ONLY�POSITIONAL_OR_KEYWORDr��r6���vararg�VAR_POSITIONAL�KEYWORD_ONLYr���r;���kw_defaultsr����VAR_KEYWORDr���r����rj��)rh���r,���r����rN��r ��r��r��Zprogramr����r(���Zmodule_namer#��r����rG��r!��r����rN���rX��Z_selfZself_isboundZ self_ismoduler ���)r!��r��r����rT��r"��rw���r��rU��r��r��r��r����_signature_fromstr���sp����� r2��c�����������������C���sB���t�|�std�|���t|dd�}|s4td�|���t|�|||�S�)zHPrivate helper function to get signature for builtin callables. z%{!r} is not a Python builtin function�__text_signature__Nz#no signature found for builtin {!r})r���r����r����rL���r����r2��)rh���r����rN��r����r ���r ���r����_signature_from_builtinX��s�����r4��c�������������� ���C���sH��d}t�|�s(t|�rd}ntd�|���t|dd�}|rFt|�|||�S�|�j}|j}|j}|j }|j } |d|��} |j}||||���}|j} |j }|j}|r�t|�}nd}g�}||�}| }| d|��D�]<}|r�tnt}| �|t�}|�||||d���|r�|d8�}q�t| |d���D�]L\}}|�r&tnt}| �|t�}|�||||||�d ���|�r|d8�}�q|jt@��r�|||��}| �|t�}|�|||td���|D�]B}t}|du�r�|�|t�}| �|t�}|�|||t|d ����q�|jt@��r2||�}|jt@��r |d7�}||�}| �|t�}|�|||td���|�|| �d t�|d�S�)zCPrivate helper: constructs Signature for the given python function.FTr���r3��Nr���)r]��rw���r����)r]��rw���rX��rP���rS���__validate_parameters__)r���r���r����r����rL���r2��r&��r&���r4��r3���co_posonlyargcountr5��r���r���r���r����rW��rY��r����r��rZ���r��r'���r7��rZ��r[��r8��r\��)rh���r����rN��Zis_duck_functionr����r!��Z func_code� pos_count� arg_namesZ posonly_countr���Zkeyword_only_countZkeyword_onlyra��rG��rb��Zpos_default_countrU��Znon_default_countZposonly_leftrN���rw���r]���offsetrX��r���r ���r ���r����_signature_from_functionh��s����� � � � � � �r;��)rM��rN��c������������� ���C���s���t�jt|||d�}t|��s(td�|����t|�tj�rN||�j �}|rJt |�S�|S�|rvt|�dd��d�}�t|�tj�rv||��S�z |�j}W�n�t y����Y�n&0�|dur�t|t�s�td�|���|S�z |�j}W�n�t y����Y�n�0�t|t�j��rZ||j�}t||d�}t|j����d �}|jtju��r|S�t|j����} | �rD|| d �u�sDJ��|f| �} |j| d �S�t|���snt|���r|t||�|d�S�t|���r�t||�|d�S�t|�t�j��r�||�j�}t||��S�d}t|�t��r�t t|��d�}|du�r�||�}nld}t |�d �} t |�d�}d |�j!v��r| }n0d|�j!v��r$|}n| du�r4| }n|du�rB|}|du�rT||�}|du��rX|�j"dd��D�]<}z |j#}W�n�t �y����Y�n0�|�rlt$|||���S��qlt|�j"v�rX|�j%t&j%u��r�|�j't&j'u��r�|�(t&�S�t)d�|����nlt|�t*��sXt t|��d�}|du�rXz||�}W�n:�t)�yV�}�z d�|��}t)|�|�W�Y�d}~n d}~0�0�|du�rt|�rpt |�S�|S�t|�tj+��r�d�|��}t)|��t)d�|����dS�)zQPrivate helper function to get signature for arbitrary callable objects. rL��z{!r} is not a callable objectc�����������������S���s ���t�|�d�S�)N� __signature__r~���r���r ���r ���r���rR������rS���z*_signature_from_callable.<locals>.<lambda>rz���Nz1unexpected object {!r} in __signature__ attributerf���r���r���)rN���__call__�__new__r����r����z(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),r#���r���rQ��r���r����r����r���r���r���r"���r���r����r<��r[���rR���_partialmethod� partialmethodr����r���rn���rU��rV��rw���r!��r.��rj��r���r���r;��r���r4��r ���r���rJ���ry���r3��r2��r����r ���r>��� from_callabler����r���rA���)r,���rM��rN��rO��Z_get_signature_ofr^��r@��r���Zfirst_wrapped_paramZ sig_paramsr���ZcallZfactory_method�new�initrP���Ztext_sigr_��r���r ���r ���r���rQ�����s����� � �� � � � � � rQ��c�������������������@���s���e�Zd�ZdZdS�)r���z1A private marker - used in Parameter & Signature.N�r����r����r����r����r ���r ���r ���r���r���} ��s���r���c�������������������@���s���e�Zd�ZdZdS�)r��z6Marker object for Signature.empty and Parameter.empty.NrD��r ���r ���r ���r���r��� ��s���r��c�������������������@���s4���e�Zd�ZdZdZdZdZdZdd��Ze dd ���Z d S�)�_ParameterKindr���r����r����������c�����������������C���s���|�j�S�rf���)�_name_r��r ���r ���r����__str__� ��s����z_ParameterKind.__str__c�����������������C���s���t�|��S�rf���)�_PARAM_NAME_MAPPINGr��r ���r ���r����description� ��s����z_ParameterKind.descriptionN)r����r����r����r+��r,��r.��r/��r1��rI��rk���rK��r ���r ���r ���r���rE��� ��s���rE��zpositional-onlyzpositional or keywordzvariadic positionalr���zvariadic keywordc�������������������@���s����e�Zd�ZdZdZeZeZe Z eZe ZeZeed�dd�Zdd��Zdd ��Zed d���Zedd ���Zedd���Zedd���Zeeeed�dd�Zdd��Zdd��Zdd��Zdd��ZdS�)r!��a��Represents a parameter in a function signature. Has the following public attributes: * name : str The name of the parameter as a string. * default : object The default value for the parameter if specified. If the parameter has no default value, this attribute is set to `Parameter.empty`. * annotation The annotation for the parameter if specified. If the parameter has no annotation, this attribute is set to `Parameter.empty`. * kind : str Describes how argument values are bound to the parameter. Possible values: `Parameter.POSITIONAL_ONLY`, `Parameter.POSITIONAL_OR_KEYWORD`, `Parameter.VAR_POSITIONAL`, `Parameter.KEYWORD_ONLY`, `Parameter.VAR_KEYWORD`. )�_name�_kind�_default�_annotationr��c����������������C���s��zt�|�|�_W�n"�ty0���td|�d���Y�n0�|turb|�jttfv�rbd}|�|�jj�}t|��||�_||�_ |tu�r~td��t |t�s�d�t|�j �}t|��|d�dkr�|dd������r�|�jtkr�d }|�|�jj�}t|��t|�_d �|dd����}|����std�|���||�_d�S�)Nzvalue z is not a valid Parameter.kindz({} parameters cannot have default valuesz*name is a required attribute for Parameterzname must be a str, not a {}r���r����r����zLimplicit arguments must be passed as positional or keyword arguments, not {}z implicit{}z"{!r} is not a valid parameter name)rE��rM��r����r��rZ��r\��r����rK��rN��rO��r���r����r ���r����r�����isdigitrY��rW���isidentifierrL��)r����rN���rw���rX��r]��r���r ���r ���r���r����� ��s6���� � zParameter.__init__c�����������������C���s ���t�|��|�j|�jf|�j|�jd�fS�)N�rN��rO��)r ���rL��rM��rN��rO��r��r ���r ���r���� __reduce__� ��s���� ��zParameter.__reduce__c�����������������C���s���|d�|�_�|d�|�_d�S�)NrN��rO��rR���r�����stater ���r ���r����__setstate__� ��s���� zParameter.__setstate__c�����������������C���s���|�j�S�rf���)rL��r��r ���r ���r���rN���� ��s����zParameter.namec�����������������C���s���|�j�S�rf���)rN��r��r ���r ���r���rX��� ��s����zParameter.defaultc�����������������C���s���|�j�S�rf���)rO��r��r ���r ���r���r]��� ��s����zParameter.annotationc�����������������C���s���|�j�S�rf���)rM��r��r ���r ���r���rw���� ��s����zParameter.kind)rN���rw���r]��rX��c����������������C���sL���|t�u�r|�j}|t�u�r|�j}|t�u�r*|�j}|t�u�r8|�j}t|��||||d�S�)z+Creates a customized copy of the Parameter.r��)r���rL��rM��rO��rN��r ���)r����rN���rw���r]��rX��r ���r ���r���rj�� ��s����zParameter.replacec�����������������C���s����|�j�}|�j}|�jtur(d�|t|�j��}|�jturb|�jturPd�|t|�j��}nd�|t|�j��}|tkrtd|�}n|t kr�d|�}|S�)Nz{}: {}z{} = {}z{}={}rq��rt��) rw���rL��rO��r��r����rl��rN��ri��rZ��r\��)r����rw���� formattedr ���r ���r���rI�� ��s���� � zParameter.__str__c�����������������C���s���d��|�jj|��S�)Nz <{} "{}">�r����r����r����r��r ���r ���r����__repr__, ��s����zParameter.__repr__c�����������������C���s���t�|�j|�j|�j|�jf�S�rf���)�hashrN���rw���r]��rX��r��r ���r ���r����__hash__/ ��s����zParameter.__hash__c�����������������C���sJ���|�|u�rdS�t�|t�stS�|�j|jkoH|�j|jkoH|�j|jkoH|�j|jkS��NT)r���r!���NotImplementedrL��rM��rN��rO���r�����otherr ���r ���r����__eq__2 ��s���� � � �zParameter.__eq__N)r����r����r����r����r����rW��r+��rY��r,��rZ��r.��r[��r/��r\��r1��r��rT��r����rS��rV��rk���rN���rX��r]��rw���r���rj��rI��rY��r[��r`��r ���r ���r ���r���r!��� ��s4���( �r!��c�������������������@���sh���e�Zd�ZdZdZdd��Zedd���Zedd���Zed d ���Z dd��Z d d��Zdd��Zdd��Z dd��ZdS�)�BoundArgumentsa���Result of `Signature.bind` call. Holds the mapping of arguments to the function's parameters. Has the following public attributes: * arguments : dict An ordered mutable mapping of parameters' names to arguments' values. Does not contain arguments' default values. * signature : Signature The Signature object that created this instance. * args : tuple Tuple of positional arguments values. * kwargs : dict Dict of keyword arguments values. )r���� _signature�__weakref__c�����������������C���s���||�_�||�_d�S�rf���)r���rb��)r����r��r���r ���r ���r���r����P ��s����zBoundArguments.__init__c�����������������C���s���|�j�S�rf���)rb��r��r ���r ���r���r��T ��s����zBoundArguments.signaturec�������������� ���C���s|���g�}|�j�j���D�]b\}}|jttfv�r*�qtz|�j|�}W�n�tyP���Y��qtY�q0�|jtkrh|� |��q|� |��qt|�S�rf���)rb��rU��rK���rw���r\��r[��r���r���rZ���extendrZ���rn���)r����r����r���rc��rz��r ���r ���r���r����X ��s���� zBoundArguments.argsc�������������� ���C���s����i�}d}|�j�j���D�]v\}}|sD|jttfv�r4d}n||�jvrDd}q|sJqz|�j|�}W�n�tyj���Y�q0�|jtkr�|�|��q|||<�q|S�r���) rb��rU��rK���rw���r\��r[��r���r����update)r�����kwargsZkwargs_startedr���rc��rz��r ���r ���r���rf��o ��s&���� zBoundArguments.kwargsc�������������� ���C���s����|�j�}g�}|�jj���D�]v\}}z|�|||�f��W�q�ty����|jturT|j}n$|jt u�rdd}n|jt u�rti�}nY�q|�||f��Y�q0�qt|�|�_�dS�)z�Set default values for missing arguments. For variable-positional arguments (*args) the default is an empty tuple. For variable-keyword arguments (**kwargs) the default is an empty dict. r ���N)r���rb��rU��rK���rZ���r���rX��r��rw���rZ��r\��r����)r����r���Z new_argumentsrN���rc���valr ���r ���r����apply_defaults� ��s���� zBoundArguments.apply_defaultsc�����������������C���s2���|�|u�rdS�t�|t�stS�|�j|jko0|�j|jkS�r\��)r���ra��r]��r��r���r^��r ���r ���r���r`��� ��s���� �zBoundArguments.__eq__c�����������������C���s���|d�|�_�|d�|�_d�S�)Nrb��r����rb��r���rT��r ���r ���r���rV��� ��s���� zBoundArguments.__setstate__c�����������������C���s���|�j�|�jd�S�)Nri��ri��r��r ���r ���r����__getstate__� ��s����zBoundArguments.__getstate__c�����������������C���s@���g�}|�j����D�]\}}|�d�||���qd�|�jjd�|��S�)Nz{}={!r}z <{} ({})>r~��)r���rK���rZ���r����r����r����r����)r����r����rz��rO���r ���r ���r���rY��� ��s����zBoundArguments.__repr__N)r����r����r����r����r����r����rk���r��r����rf��rh��r`��rV��rj��rY��r ���r ���r ���r���ra��= ��s��� ra��c�������������������@���s����e�Zd�ZdZdZeZeZe Z d,e dd�dd�Zedd ���Z ed d���Zedd�d d��Zedd���Zedd���Zeed�dd�Zdd��Zdd��Zdd��Zdd�dd�Zd d!��Zd"d#��Zd$d%��Zd&d'��Zd(d)��Zd*d+��ZdS�)-rR��a��A Signature object represents the overall signature of a function. It stores a Parameter object for each parameter accepted by the function, as well as information specific to the function itself. A Signature object has the following public attributes and methods: * parameters : OrderedDict An ordered mapping of parameters' names to the corresponding Parameter objects (keyword-only arguments are in the same order as listed in `code.co_varnames`). * return_annotation : object The annotation for the return type of the function if specified. If the function has no annotation for its return type, this attribute is set to `Signature.empty`. * bind(*args, **kwargs) -> BoundArguments Creates a mapping from positional and keyword arguments to parameters. * bind_partial(*args, **kwargs) -> BoundArguments Creates a partial mapping from positional and keyword arguments to parameters (simulating 'functools.partial' behavior.) )�_return_annotation�_parametersNTr5��c����������������C���s����|du�rt���}n�|r�t���}t}d}|D�]�}|j}|j} ||k�r\d} | �|j|j�} t| ��n||krld}|}|ttfv�r�|jt u�r�|r�d} t| ��nd}| |v�r�d�| �} t| ��||| <�q&nt�dd��|D���}t �|�|�_||�_ dS�) z�Constructs Signature from the given list of Parameter objects and 'return_annotation'. All arguments are optional. NFz7wrong parameter order: {} parameter before {} parameterz-non-default argument follows default argumentTzduplicate parameter name: {!r}c�����������������s���s���|�]}|j�|fV��qd�S�rf���rr���rg���rc��r ���r ���r���ri�����rS���z%Signature.__init__.<locals>.<genexpr>)r���rW��rw���rN���r����rK��r����rY��rX��r��r����MappingProxyTyperl��rk��)r����rU��rS��r6��r���Ztop_kindZ kind_defaultsrc��rw���rN���r���r ���r ���r���r����� ��s@������ zSignature.__init__c�����������������C���s���t�jdtdd��t|�|�S�)z�Constructs Signature for the given python function. Deprecated since Python 3.5, use `Signature.from_callable()`. z_inspect.Signature.from_function() is deprecated since Python 3.5, use Signature.from_callable()r��rA��)rC��rD��rE��r;���rh���r����r ���r ���r���� from_function��s�����zSignature.from_functionc�����������������C���s���t�jdtdd��t|�|�S�)z�Constructs Signature for the given builtin function. Deprecated since Python 3.5, use `Signature.from_callable()`. z^inspect.Signature.from_builtin() is deprecated since Python 3.5, use Signature.from_callable()r��rA��)rC��rD��rE��r4��ro��r ���r ���r����from_builtin��s�����zSignature.from_builtin��follow_wrappedc����������������C���s���t�||�|d�S�)z3Constructs Signature for the given callable object.)rO��rM��)rQ��)rh���r,���rs��r ���r ���r���rA��+��s�����zSignature.from_callablec�����������������C���s���|�j�S�rf���)rl��r��r ���r ���r���rU��1��s����zSignature.parametersc�����������������C���s���|�j�S�rf����rk��r��r ���r ���r���rS��5��s����zSignature.return_annotation)rU��rS��c����������������C���s0���|t�u�r|�j���}|t�u�r |�j}t|��||d�S�)z�Creates a customized copy of the Signature. Pass 'parameters' and/or 'return_annotation' arguments to override them in the new copy. r%��)r���rU��rV��rk��r ���)r����rU��rS��r ���r ���r���rj��9��s���� �zSignature.replacec�����������������C���s8���t�dd��|�j���D���}dd��|�j���D��}|||�jfS�)Nc�����������������s���s���|�]}|j�tkr|V��qd�S�rf���)rw���r[��rm��r ���r ���r���ri���I��s��� �z(Signature._hash_basis.<locals>.<genexpr>c�����������������S���s���i�|�]}|j�tkr|j|�qS�r ���)rw���r[��rN���rm��r ���r ���r���r���L��s��� �z)Signature._hash_basis.<locals>.<dictcomp>)rn���rU��rV��rS��)r����r���� kwo_paramsr ���r ���r����_hash_basisH��s����zSignature._hash_basisc�����������������C���s(���|�����\}}}t|����}t|||f�S�rf���)rv��� frozensetrV��rZ��)r����r���ru��rS��r ���r ���r���r[��Q��s����zSignature.__hash__c�����������������C���s*���|�|u�rdS�t�|t�stS�|����|���kS�r\��)r���rR��r]��rv��r^��r ���r ���r���r`��V��s ���� zSignature.__eq__F�r���c����������������C���s���i�}t�|�j����}d}t�|�}zt|�}W�n��t�y���zt|�} W�n�ty`���Y�Y��q�Y�n�0�| jtkrtY��q�n�| j|v�r�| jtkr�d} | j | jd�} t | �d�| f}Y��q�nP| jtks�| jt ur�| f}Y��q�n.|r�| f}Y��q�nd} | j | jd�} t | �d�Y�q0�zt|�} W�n�t�y2���t d�d�Y�q0�| jttfv��rNt d�d�| jtk�r||g}|�|��t|�|| j<��q�| j|v��r�| jtk�r�t dj | jd��d�||| j<�qd}t�||�D�]�} | jtk�r�| }�q�| jtk�r�q�| j} z|�| �}W�nD�t�yD���|�s@| jtk�r@| jt u��r@t dj | d��d�Y�n(0�| jtk�rdt dj | jd���||| <��q�|�r�|du�r�|||j<�nt dj tt�|��d���|��|�|�S�) z#Private method. Don't use directly.r ���zA{arg!r} parameter is positional only, but was passed as a keyword)rz��Nz$missing a required argument: {arg!r}ztoo many positional argumentsz$multiple values for argument {arg!r}z*got an unexpected keyword argument {arg!r})r!��rU��rV��r��� StopIterationrw���rZ��rN���rW��r����r����r\��rX��r��r[��rd��rn���r)���chainr����r����_bound_arguments_cls)r����r����rf��r���r���rU��Z parameters_exZarg_valsZarg_valrc��r���rV��Zkwargs_paramr���r ���r ���r����_bind]��s����� ��� ������� ��zSignature._bindc����������������O���s���|���||�S�)z�Get a BoundArguments object, that maps the passed `args` and `kwargs` to the function's signature. Raises `TypeError` if the passed arguments can not be bound. �r|���r����r����rf��r ���r ���r����bind���s����zSignature.bindc����������������O���s���|�j�||dd�S�)z�Get a BoundArguments object, that partially maps the passed `args` and `kwargs` to the function's signature. Raises `TypeError` if the passed arguments can not be bound. Trx��r}��r~��r ���r ���r���r������s����zSignature.bind_partialc�����������������C���s ���t�|��t|�j����fd|�jifS��Nrk��)r ���rn���rl��rV��rk��r��r ���r ���r���rS�����s�����zSignature.__reduce__c�����������������C���s���|d�|�_�d�S�r���rt��rT��r ���r ���r���rV�����s����zSignature.__setstate__c�����������������C���s���d��|�jj|��S�)Nz<{} {}>rX��r��r ���r ���r���rY�����s����zSignature.__repr__c����������� ������C���s����g�}d}d}|�j����D�]d}t|�}|j}|tkr6d}n|rH|�d��d}|tkrVd}n|tkrp|rp|�d��d}|�|��q|r�|�d��d�d� |��}|�j tur�t|�j �}|d�|�7�}|S�)NFTr���rq��z({})r~��z -> {}) rU��rV��r����rw���rW��rZ���rZ��r[��r����r����rS��r��rl��) r����ru���Zrender_pos_only_separatorZrender_kw_only_separatorrc��rW��rw���ZrenderedZannor ���r ���r���rI�����s0���� zSignature.__str__)N)r����r����r����r����r����r!��r&��ra��r{��r��rT��r����rs���rp��rq��rA��rk���rU��rS��r���rj��rv��r[��r`��r|��r��r���rS��rV��rY��rI��r ���r ���r ���r���rR��� ��s<����6 �rR��rr��c����������������C���s���t�j|�|d�S�)z/Get a signature object for the passed callable.rr��)rR��rA��)r,���rs��r ���r ���r���r��'��s����r��c��������������� ���C���s���ddl�}�ddl}|����}|jddd��|jdddd d ��|���}|j}|�d�\}}}z|�|��}} W�nP�ty��} �z8d� |t | �j| �}t|t jd ��t �d��W�Y�d} ~ n d} ~ 0�0�|r�|�d�}| }|D�]} t|| �}q�| jt jv��rtdt jd ��t �d��|j�r�td� |���td� t| ����td� | j���|| u��rztd� t| j����t| d��r�td� | j���n4zt|�\}}W�n�t�y����Y�n0�td� |���td��ntt|���dS�)z6 Logic for inspecting an object given at command line r���Nr ���zCThe object to be analysed. It supports the 'module:qualname' syntax)�helpz-dz --details� store_truez9Display info about the module rather than its source code)�actionr���r���zFailed to import {} ({}: {}))r����r��r����z#Can't get info for builtin modules.r����z Target: {}z Origin: {}z Cached: {}z Loader: {}�__path__zSubmodule search path: {}zLine: {}r����)�argparser�����ArgumentParser�add_argument� parse_argsr ���� partition� import_modulero���r����r ���r�����printr�����stderr�exitr����rL����builtin_module_namesZdetailsr����� __cached__ri��r����r���r���r��r)��)r���r�����parserr�����targetZmod_nameZ has_attrs�attrsr,���r����rv���r����parts�part�__r����r ���r ���r����_main,��s\������� r���r����)N)N)N)F)N)r����)r����)r����)r����)r����)r ���)T)T)T)�r����� __author__r8���r�����dis�collections.abcr7����enum�importlib.machineryr����r)��r����r����r����r����r��r��r���rC��r#���r�����operatorr���r���r����globalsZmod_dictZCOMPILER_FLAG_NAMESrK���rb���rc���rG���r���r���r���r���r���r���r���r ���r���r*���r-���r.���r/���r1���r3���r5���r:���r<���r>���r@���rB���rC���rQ���rd���re���rx���rV���r����r����r����r����r����r����r����r����r����r����r����r����r����ro���r����ZNodeVisitorr����r��r��r��r ��r%��r(��r)��r*��r1��r2��r?��r@��rJ��rK��rF��rd��rg��rl��ro��r����r���r���r���r���r���r���r���r���r���r����_fieldsr���r���r���r���r����r���r ���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r ���r=��Z_WrapperDescriptor�allZ_MethodWrapperr��rJ���Z_ClassMethodWrapperrA���r���r���r���r���r���r���r���r��r2��r4��r;��rQ��r���r���IntEnumrE��r+��rW��r,��rY��r.��rZ��r/��r[��r1��r\��rJ��r!��ra��rR��r��r���r����r ���r ���r ���r����<module>���sr�� , t$ > /D-> �\ � ;� < 5 0 �LH�_��8� ����j: