Your IP : 3.142.212.225


Current Path : /opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/__pycache__/inspect.cpython-311.pyc

�

c��f�����dZdZgd�ZddlZddlZddlZddlZddlZddl	Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlmZddlmZddlmZmZe��Zej���D]
\ZZ eede z<�[[ [d	Z!ddd
d�d�Z"d
�Z#d�Z$d�Z%d�Z&d�Z'e(ed��rd�Z)nd�Z)e(ed��rd�Z*nd�Z*d�Z+d�Z,d�Z-d�Z.d�Z/d�Z0d�Z1d�Z2d �Z3d!�Z4d"�Z5d#�Z6d$�Z7d%�Z8d&�Z9d'�Z:d(�Z;d�d)�Z<d�d*�Z=ed+d,��Z>d-�Z?d.�Z@dd/�d0�ZAd1�ZBd2�ZCd3�ZDd4�ZEd5�ZFd6�ZGd7�ZHd8�ZId�d9�ZJiZKiZLd�d:�ZMGd;�d<eN��ZOGd=�d>ejP��ZQd?�ZRd@�ZSGdA�dBeN��ZTGdC�dD��ZUdE�ZVdF�ZWdG�ZXdH�ZYd�dI�ZZedJdK��Z[dL�Z\edMdN��Z]dO�Z^edPdQ��Z_dR�Z`d�dS�ZadT�ZbecdU�dV�dW�fdX�ZddY�ZedZ�Zfd[�Zged\d]��Zhd^�Zied_d`��ZjGda�dbej��Zkdc�Zldd�Zmd�df�Zndg�Zoedhdiekjpz��ZqGdj�dkeq��Zrd�dl�Zsd�dm�Ztdn�Zud�do�Zvd�dp�Zwex��Zydq�Zzdr�Z{ds�Z|dt�Z}du�Z~eyfdv�ZdwZ�dxZ�dyZ�dzZ�d{�Z�d|�Z�d}Z�d~Z�dZ�d�Z�d��Z�d��Z�ej�ej�ej�ej�fZ�d��Z�d�d��Z�d��Z�d��Z�d��Z�d��Z�d�d��Z�d�d��Z�		d�d��Z�d��Z�d�d�ddd
d��d��Z�Gd��d���Z�Gd��d���Z�Gd��d�ej���Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�Gd��d���Z�Gd��d���Z�Gd��d���Z�d�ddd
d��d��Z�d��Z�e�d�kre���dSdS)�aFGet 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

    get_annotations() - safely compute an object's annotations
)zKa-Ping Yee <ping@lfw.org>z'Yury Selivanov <yselivanov@sprymix.com>)`�ArgInfo�	Arguments�	Attribute�BlockFinder�BoundArguments�CORO_CLOSED�CORO_CREATED�CORO_RUNNING�CORO_SUSPENDED�CO_ASYNC_GENERATOR�CO_COROUTINE�CO_GENERATOR�CO_ITERABLE_COROUTINE�	CO_NESTED�CO_NEWLOCALS�	CO_NOFREE�CO_OPTIMIZED�
CO_VARARGS�CO_VARKEYWORDS�ClassFoundException�ClosureVars�
EndOfBlock�	FrameInfo�FullArgSpec�
GEN_CLOSED�GEN_CREATED�GEN_RUNNING�
GEN_SUSPENDED�	Parameter�	Signature�TPFLAGS_IS_ABSTRACT�	Traceback�classify_class_attrs�cleandoc�currentframe�
findsource�formatannotation�formatannotationrelativeto�formatargvalues�get_annotations�
getabsfile�getargs�getargvalues�getattr_static�getblock�getcallargs�getclasstree�getclosurevars�getcomments�getcoroutinelocals�getcoroutinestate�getdoc�getfile�getframeinfo�getfullargspec�getgeneratorlocals�getgeneratorstate�getinnerframes�	getlineno�
getmembers�getmembers_static�	getmodule�
getmodulename�getmro�getouterframes�	getsource�
getsourcefile�getsourcelines�
indentsize�
isabstract�
isasyncgen�isasyncgenfunction�isawaitable�	isbuiltin�isclass�iscode�iscoroutine�iscoroutinefunction�isdatadescriptor�isframe�
isfunction�isgenerator�isgeneratorfunction�isgetsetdescriptor�ismemberdescriptor�ismethod�ismethoddescriptor�ismethodwrapper�ismodule�	isroutine�istraceback�	signature�stack�trace�unwrap�walktree�N)�	iskeyword)�
attrgetter)�
namedtuple�OrderedDict�CO_iF��globals�locals�eval_strc�>���t|t��r�t|dd��}|rCt|d��r3|�dd��}t|t
j��rd}nd}d}t|dd��}|r3tj�|d��}|rt|dd��}tt|����}	|}
n�t|t
j��r&t|dd��}t|d��}d}	d}
nHt|��r't|dd��}t|dd��}d}	|}
nt|�d����|�iSt|t��st|�d����|siS|st|��S|
�S	t|
d
��r|
j}
�t|
t j��r|
j}
�;	t|
d��r|
j}��|���|	���fd�|���D��}|S)a�Compute the annotations dict for an object.

    obj may be a callable, class, or module.
    Passing in an object of any other type raises TypeError.

    Returns a dict.  get_annotations() returns a new dict every time
    it's called; calling it twice on the same object will return two
    different but equivalent dicts.

    This function handles several details for you:

      * If eval_str is true, values of type str will
        be un-stringized using eval().  This is intended
        for use with stringized annotations
        ("from __future__ import annotations").
      * If obj doesn't have an annotations dict, returns an
        empty dict.  (Functions and methods always have an
        annotations dict; classes, modules, and other types of
        callables may not.)
      * Ignores inherited annotations on classes.  If a class
        doesn't have its own annotations dict, returns an empty dict.
      * All accesses to object members and dict values are done
        using getattr() and dict.get() for safety.
      * Always, always, always returns a freshly-created dict.

    eval_str controls whether or not values of type str are replaced
    with the result of calling eval() on those values:

      * If eval_str is true, eval() is called on values of type str.
      * If eval_str is false (the default), values of type str are unchanged.

    globals and locals are passed in to eval(); see the documentation
    for eval() for more information.  If either globals or locals is
    None, this function may replace that value with a context-specific
    default, contingent on type(obj):

      * If obj is a module, globals defaults to obj.__dict__.
      * If obj is a class, globals defaults to
        sys.modules[obj.__module__].__dict__ and locals
        defaults to the obj class namespace.
      * If obj is a callable, globals defaults to obj.__globals__,
        although if obj is a wrapped function (using
        functools.update_wrapper()) it is first unwrapped.
    �__dict__N�get�__annotations__�
__module__�__globals__z% is not a module, class, or callable.z+.__annotations__ is neither a dict nor NoneT�__wrapped__c�h��i|].\}}|t|t��s|nt|������/S�)�
isinstance�str�eval)�.0�key�valuerirjs   ���./opt/alt/python311/lib64/python3.11/inspect.py�
<dictcomp>z#get_annotations.<locals>.<dictcomp>sO���(�(�(��C�����s�+�+�M����e�W�f�1M�1M�(�(�(�)ru�type�getattr�hasattrrn�types�GetSetDescriptorType�sys�modules�dict�vars�
ModuleType�callable�	TypeError�
ValueErrorrr�	functools�partial�funcrq�items)�objrirjrk�obj_dict�ann�obj_globals�module_name�module�
obj_localsr`�return_values ``         r{r)r)�s�����Z�#�t���!I��3�
�D�1�1���	���%�0�0�	��,�,�0�$�7�7�C��#�u�9�:�:�
�����C����c�<��6�6���	@��[�_�_�[�$�7�7�F��
@�%�f�j�$�?�?���$�s�)�)�_�_�
����	�C��)�	*�	*�I��c�,�d�3�3���c�:�.�.���
����	�#���	I��c�,�d�3�3���c�=�$�7�7���
�����3�G�G�G�H�H�H�
�{��	��c�4� � �P��C�N�N�N�O�O�O����	����C�y�y��
��	��v�}�-�-�
��+����&�)�"3�4�4�
�������6�=�)�)�	-� �,�K�����
�~���(�(�(�(�(��)�)�+�+�(�(�(�L��r}c�6�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))rur�r���objects r{rZrZs���f�e�.�/�/�/r}c�,�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)rur~r�s r{rLrL$s���f�d�#�#�#r}c�6�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)rur��
MethodTyper�s r{rWrW,s���f�e�.�/�/�/r}c��t|��st|��st|��rdSt|��}t	|d��ot	|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__�rLrWrRr~r��r��tps  r{rXrX6sb���v����(�6�*�*��j��.@�.@���u�	
�f���B��2�y�!�!�@�'�"�i�*@�*@�&@�@r}c��t|��st|��st|��rdSt|��}t	|d��pt	|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�s  r{rPrPJs_���v����(�6�*�*��j��.@�.@���u�	
�f���B��2�y�!�!�>�W�R��%>�%>�>r}�MemberDescriptorTypec�6�t|tj��S)��Return true if the object is a member descriptor.

        Member descriptors are specialized descriptors defined in extension
        modules.)rur�r�r�s r{rVrVZ���
�&�%�"<�=�=�=r}c��dS)r�Frtr�s r{rVrVb�	��
�ur}r�c�6�t|tj��S)��Return true if the object is a getset descriptor.

        getset descriptors are specialized descriptors defined in extension
        modules.)rur�r�r�s r{rUrUkr�r}c��dS)r�Frtr�s r{rUrUsr�r}c�6�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)rur��FunctionTyper�s r{rRrRzs���f�e�0�1�1�1r}c���t|��r|j}t|���tj|��}t	|��st|��sdSt
|jj|z��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)	rW�__func__r��_unwrap_partialrR�_signature_is_functionlike�bool�__code__�co_flags)�f�flags  r{�_has_code_flagr��st���1�+�+��
�J���1�+�+���!�!�$�$�A��q�M�M��7��:�:���u���
�#�d�*�+�+�+r}c�,�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�r
�r�s r{rTrT����
�#�|�,�,�,r}c�,�t|t��S)zuReturn true if the object is a coroutine function.

    Coroutine functions are defined with "async def" syntax.
    )r�rr�s r{rOrO�r�r}c�,�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�rr�s r{rIrI�s���#�1�2�2�2r}c�6�t|tj��S)z7Return true if the object is an asynchronous generator.)rur��AsyncGeneratorTyper�s r{rHrH�s���f�e�6�7�7�7r}c�6�t|tj��S)aReturn 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)rur��
GeneratorTyper�s r{rSrS�s���f�e�1�2�2�2r}c�6�t|tj��S)z)Return true if the object is a coroutine.)rur��
CoroutineTyper�s r{rNrN�s���f�e�1�2�2�2r}c���t|tj��pYt|tj��o t	|jjtz��pt|tj	j
��S)z?Return true if object can be passed to an ``await`` expression.)rur�r�r�r��gi_coder�r�collections�abc�	Awaitabler�s r{rJrJ�sa���v�u�2�3�3�
:��v�u�2�3�3�
F��V�^�,�/D�D�E�E�
:�
�v�{��8�9�9�;r}c�6�t|tj��S)abReturn 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))rur��
TracebackTyper�s r{r\r\�s���f�e�1�2�2�2r}c�6�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)rur��	FrameTyper�s r{rQrQ�s���f�e�o�.�.�.r}c�6�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)rur��CodeTyper�s r{rMrM�s��.�f�e�n�-�-�-r}c�6�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)rur��BuiltinFunctionTyper�s r{rKrK�s���f�e�7�8�8�8r}c�6�t|tj��S)z.Return true if the object is a method wrapper.)rur��MethodWrapperTyper�s r{rYrYs���f�e�5�6�6�6r}c��t|��p;t|��p,t|��pt|��pt	|��S)z<Return true if the object is any kind of function or method.)rKrRrWrXrYr�s r{r[r[sV���f���
'��&�!�!�
'�����
'�"�&�)�)�
'��v�&�&�	(r}c��t|t��sdS|jtzrdSt	t|��t
j��sdSt|d��rdS|j�	��D]\}}t|dd��rdS�|jD]<}t|dd��D](}t||d��}t|dd��rdS�)�=dS)z:Return true if the object is an abstract base class (ABC).FT�__abstractmethods__�__isabstractmethod__rtN)rur~�	__flags__r �
issubclassr��ABCMetar�rmr�r�	__bases__)r��namerz�bases    r{rGrGs���f�d�#�#���u�
��-�-���t��d�6�l�l�C�K�0�0���u��v�,�-�-���u���,�,�.�.�����e��5�0�%�8�8�	��4�4�	�� �����D�"7��<�<�	�	�D��F�D�$�/�/�E��u�4�e�<�<�
��t�t�t�
�	��5r}c��g}t��}t|��}t|��r}|ft|��z}	|jD]P}|j���D]4\}}	t|	tj	��r|�
|���5�Qn#t$rYnwxYwd}|D]�}
	|||
��}|
|vrt�n/#t$r"|D]}|
|jvr|j|
}n�Y�DYnwxYw|r||��r|�
|
|f��|�|
����|�
d����|S)Nrtc��|dS)Nrbrt)�pairs r{�<lambda>z_getmembers.<locals>.<lambda>Ms
��$�q�'�r}�ry)�set�dirrLrAr�rmr�rur��DynamicClassAttribute�append�AttributeError�add�sort)r��	predicate�getter�results�	processed�names�mror��k�vryrzs            r{�_getmembersr�&s����G����I���K�K�E��v���
��i�&��.�.�(��	��(�
(�
(�� �M�/�/�1�1�(�(�D�A�q�!�!�U�%@�A�A�(����Q�����(�
(���	�	�	��D�	����������
	��F�6�3�'�'�E��i���$�$� ���	�	�	��
�
���$�-�'�'� �M�#�.�E��E�(���	�E�		�����	)�I�I�e�,�,�	)��N�N�C��<�(�(�(��
�
�c������L�L�)�)�L�*�*�*��Ns%�AB�
B)�(B)�3C�'C7�6C7c�.�t||t��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�r�r�r�s  r{r=r=Ps���v�y�'�2�2�2r}c�.�t||t��S)a=Return all members of an object as (name, value) pairs sorted by name
    without triggering dynamic lookup via the descriptor protocol,
    __getattr__ or __getattribute__. Optionally, only return members that
    satisfy a given predicate.

    Note: this function may not be able to retrieve all members
       that getmembers can fetch (like dynamically created attributes)
       and may find members that getmembers can't (like descriptors
       that raise AttributeError). It can also return descriptor objects
       instead of instance members in some cases.
    )r�r-r�s  r{r>r>Us���v�y�.�9�9�9r}rzname kind defining_class objectc	���t|��}tt|����}td�|D����}|f|z}||z}t|��}|D]W}|j���D];\}}t
|tj��r|j	�|�
|���<�Xg}	t��}
|D�]�}d}d}
d}||
vr�	|dkrtd���t||��}
t|
d|��}||vrWd}d}|D]}t||d��}||
ur|}�|D]0}	|�||��}n#t$rY�&wxYw||
ur|}�1|�|}n#t$r
}Yd}~nd}~wwxYw|D] }||jvr|j|}||vr|}n�!|���|
�|
n|}t
|t tjf��rd}|}nTt
|t$tjf��rd}|}n.t
|t(��rd}|}nt+|��rd	}nd
}|	�
t-||||����|
�|�����|	S)aNReturn 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.
    c3�:K�|]}|ttfv�|V��dS�N)r~r�)rx�clss  r{�	<genexpr>z'classify_class_attrs.<locals>.<genexpr>�s0����H�H�C�c�$���.G�.G�C�.G�.G�.G�.G�H�Hr}Nrmz)__dict__ is special, don't want the proxy�__objclass__z
static methodzclass method�property�method�data)rAr~�tupler�rmr�rur�r��fgetr�r��	Exceptionr�__getattr__r��staticmethod�BuiltinMethodType�classmethod�ClassMethodDescriptorTyper�r[rr�)r�r��metamro�class_bases�	all_basesr�r�r�r��resultr�r��homecls�get_obj�dict_obj�last_cls�srch_cls�srch_obj�excr��kinds                     r{r"r"es7��6��+�+�C��T�#�Y�Y���G��H�H�7�H�H�H�H�H�G��&�3�,�K��g�%�I���H�H�E�� � ���M�'�'�)�)�	 �	 �D�A�q��!�U�8�9�9�
 �a�f�>P����Q�����	 ��F����I��D�D���������y� � �
+��:�%�%�#�$O�P�P�P�!�#�t�,�,��"�'�>�7�C�C���+�-�-�#�G�#�H�$/�0�0��#*�8�T�4�#@�#@��#�w�.�.�'/�H��$+�0�0��%�'/�';�';�C��'F�'F�H�H��-�%�%�%�$�H�%����#�w�.�.�'/�H���+�"*����/�
�
�
����������
����0�	�	�D��t�}�$�$��=��.���'�)�)�"�G���	%�
�?�
� �,�g�g�(���h��u�/F� G�H�H�	�"�D��C�C�
��;��0O�"P�
Q�
Q�		�!�D��C�C�
��(�
+�
+�	��D��C�C�
�s�^�^�	��D�D��D��
�
�i��d�G�S�9�9�:�:�:��
�
�d������Ms$�%E+�8E�
E�E�+
E?�:E?c��|jS)zHReturn tuple of base classes (including cls) in method resolution order.)�__mro__)r�s r{rArA�s
���;�r}��stopc��|}t|��|i}tj��}t|t��s�t|d��r�|�||��rny|j}t|��}||vst|��|kr"td�	|�����|||<t|t��st|d����|S)anGet 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.

    rrNz!wrapper loop when unwrapping {!r})
�idr��getrecursionlimitrur~r�rr�lenr��format)r�rr��memo�recursion_limit�id_funcs      r{r`r`�s��� 	
�A�
�q�E�E�1�:�D��+�-�-�O���t�$�$����}�)E�)E������T�
�
�������T�(�(���t�O�O��T���o�!=�!=��@�G�G��J�J�K�K�K���W�
���t�$�$����}�)E�)E���Kr}c��|���}t|��t|�����z
S)zBReturn the indent size, in spaces, at the start of a line of text.)�
expandtabsr�lstrip)�line�explines  r{rFrF�s4���o�o���G��w�<�<�#�g�n�n�.�.�/�/�/�/r}c���tj�|j��}|�dS|j�d��dd�D]}t
||��}�t|��sdS|S)N�.���)r�r�rnrp�__qualname__�splitrrL)r�r�r�s   r{�
_findclassr)ss��

�+�/�/�$�/�
*�
*�C�
�{��t��!�'�'��,�,�S�b�S�1�!�!���c�4� � ����3�<�<���t��Jr}c�p�t|��r4|jD]*}|tur	|j}n#t$rY� wxYw|�|cS�+dSt|��rU|jj}|j}t|��r*tt||d��d��|jur|}�n`|j
}�nWt|��r.|j}t|��}|�t||��|urdS�nt|��r>|j}|j}t|��r|jdz|z|jkr|}n�|j
}n�t|t ��r4|j}|j}t|��}|�t||��|urdSn�t%|��st'|��rd|j}|j}t||��|urdSt+|��r2t|dd��}t|t,��r||vr||SndS|jD]/}	t||��j}n#t$rY�%wxYw|�|cS�0dS)Nr�r%�	__slots__)rLrr��__doc__r�rWr��__name__�__self__r�	__class__rRr)rKr'rur�rrXrPr�rVr�)r�r��docr��selfr�r��slotss        r{�_finddocr3s����s�|�|�	��K�	�	�D��6�!�!���,�C�C��%�����H������?��J�J�J���t���}�}�(��|�$���|���D�M�M�	!��G�D�$��-�-�z�:�:�c�l�J�J��C�C��.�C�C�	�C�����|����o�o���;�'�#�t�,�,�C�7�7��4�8�	�3�����|���|���D�M�M�	!����#�d�*�c�.>�>�>��C�C��.�C�C�	�C��	"�	"���x���}��������;�'�#�t�,�,�C�7�7��4�8�	�C�	 �	 �
�$4�S�$9�$9�
��|������3����S�(�(��4��c�"�"�	#��C��d�3�3�E��%��&�&�
#�4�5�=�=��T�{�"���t������	��$��%�%�-�C�C���	�	�	��H�	�����?��J�J�J���4s�+�
8�8�	H�
H,�+H,c���	|j}n#t$rYdSwxYw|�)	t|��}n#ttf$rYdSwxYwt	|t
��sdSt
|��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�r3r�rurvr#)r�r0s  r{r5r5Ls�����n���������t�t�����
�{�	��6�"�"�C�C���	�*�	�	�	��4�4�	�����c�3�����t��C�=�=�s�
�
��.�A�Ac��	|����d��}tj}|dd�D]G}t	|�����}|r"t	|��|z
}t
||��}�H|r|d���|d<|tjkr3tdt	|����D]}|||d�||<�|r&|ds|���|r|d�|r'|ds|�d��|r|d�d�	|��S#t$rYdSwxYw)z�Clean up indentation from docstrings.

    Any whitespace that can be uniformly removed from the second line
    onwards is removed.�
�Nrbr&)r r(r��maxsizerr!�min�range�pop�join�UnicodeError)r0�lines�marginr"�content�indent�is       r{r#r#_s���
 ���� � �&�&�t�,�,��
����!�"�"�I�	-�	-�D��$�+�+�-�-�(�(�G��
-��T���W�,���V�V�,�,����	)��Q�x���(�(�E�!�H��C�K����1�c�%�j�j�)�)�G�G��e�A�h�v�w�w�6G�5��8�8��	�E�"�I�	��I�I�K�K�K��	�E�"�I�	��	�E�!�H�	��I�I�a�L�L�L��	�E�!�H�	��y�y������)�����t�t����s�'E�
E�Ec��t|��r:t|dd��r|jStd�|�����t|��r�t
|d��rVtj�	|j
��}t|dd��r|jS|j
dkrtd���td�|�����t|��r|j
}t|��r|j}t!|��r|j}t%|��r|j}t)|��r|jStd�t-|��j�����)	z@Work out which source or compiled file an object was defined in.�__file__Nz{!r} is a built-in modulerp�__main__�source code not availablez{!r} is a built-in classzVmodule, class, method, function, traceback, frame, or code object was expected, got {})rZrrDr�rrLr�r�r�rnrp�OSErrorrWr�rRr�r\�tb_framerQ�f_coderM�co_filenamer~r-)r�r�s  r{r6r6|s|������D��6�:�t�,�,�	#��?�"��3�:�:�6�B�B�C�C�C��v���C��6�<�(�(�	;��[�_�_�V�%6�7�7�F��v�z�4�0�0�
'���&�� �J�.�.��9�:�:�:��2�9�9�&�A�A�B�B�B�����!�����&���!�����6���!�����v�������
�f�~�~�"��!�!�
�7�7=�v���L�L�)�8+�8+�,�,�,r}c��tj�|��}d�tj���D��}|���|D]&\}}|�|��r|d|�cS�'dS)z1Return the module name for a given file, or None.c�2�g|]}t|��|f��Srt)r)rx�suffixs  r{�
<listcomp>z!getmodulename.<locals>.<listcomp>�s;��F�F�F���f�+�+��v�&�F�F�Fr}N)�os�path�basename�	importlib�	machinery�all_suffixesr��endswith)rP�fname�suffixes�neglenrMs     r{r@r@�s����G���T�"�"�E�F�F�"+�"5�"B�"B�"D�"D�F�F�F�H��M�M�O�O�O�"�"�"�����>�>�&�!�!�	"���&��>�!�!�!�	"��4r}c���t|���tjjdd�}|tjjdd�z
}t�fd�|D����r>tj����dtjj	dz�n,t�fd�tjj
D����rdStj����r�St|���}t|dd����Stt|dd��dd����S�tjvr�SdS)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.
    Nc3�B�K�|]}��|��V��dSr��rU�rx�s�filenames  �r{r�z getsourcefile.<locals>.<genexpr>�s1�����
?�
?�A�8���Q���
?�
?�
?�
?�
?�
?r}rbc3�B�K�|]}��|��V��dSr�r[r\s  �r{r�z getsourcefile.<locals>.<genexpr>�sA�����
9�
9�a�X�
�
�q�
!�
!�
9�
9�
9�
9�
9�
9r}�
__loader__�__spec__�loader)r6rRrS�DEBUG_BYTECODE_SUFFIXES�OPTIMIZED_BYTECODE_SUFFIXES�anyrOrP�splitext�SOURCE_SUFFIXES�EXTENSION_SUFFIXES�existsr?r�	linecache�cache)r��all_bytecode_suffixesr�r^s   @r{rDrD�sU����v���H�%�/�G����J���Y�0�L�Q�Q�Q�O�O��
�
?�
?�
?�
?�)>�
?�
?�
?�?�?���G�$�$�X�.�.�q�1��'�7��:�;���	�
9�
9�
9�
9��$�7�
9�
9�
9�
9�
9���t�	�w�~�~�h������
�v�x�
(�
(�F��v�|�T�*�*�6���	����T�2�2�H�d�	C�	C�	O���	�Y�_�	$�	$���
%�	$r}c��|�t|��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.)rDr6rOrP�normcase�abspath)r��	_filenames  r{r*r*�sF��
��!�&�)�)�<�W�V�_�_�	�
�7���B�G�O�O�I�6�6�7�7�7r}c���t|��r|St|d��r$tj�|j��S|�3|tvr*tj�t|��S	t||��}n#ttf$rYdSwxYw|tvr*tj�t|��Stj�
�����D]�\}}t|��r�t|d��rv|j}|t�|d��kr�K|t|<t|��}|jxt|<ttj�|��<��|tvr*tj�t|��Stjd}t|d��sdSt||j��rt%||j��}||ur|Stjd}t||j��rt%||j��}	|	|ur|SdSdS)zAReturn the module an object was defined in, or None if not found.rpNrDrEr-�builtins)rZr�r�r�rnrp�
modulesbyfiler*r��FileNotFoundError�copyr�rD�_filesbymodnamer-rOrP�realpathr)
r�rp�file�modnamer�r��main�
mainobject�builtin�
builtinobjects
          r{r?r?�sR��������
��v�|�$�$�2��{���v�0�1�1�1����m�!;�!;��{���}�Y�7�8�8�8���&�)�,�,�����(�)�����t�t������}����{���}�T�2�3�3�3��;�+�+�-�-�3�3�5�5�
7�
7�����F���		7���
� ;� ;�		7���A��O�'�'���6�6�6�6��'(�O�G�$��6�"�"�A�(.��
7�M�!��}��� � ��#�#� %���}����{���}�T�2�3�3�3��;�z�"�D��6�:�&�&���t��t�V�_�%�%���T�6�?�3�3�
������K��k�*�%�G��w���(�(������9�9�
��F�"�"��N���"�"s�<B
�
B"�!B"c��eZdZdS)rN�r-rpr'rtr}r{rr�s�������Dr}rc�$�eZdZd�Zd�ZeZd�ZdS)�_ClassFinderc�"�g|_||_dSr�)r^�qualname)r1r�s  r{�__init__z_ClassFinder.__init__�s����
� ��
�
�
r}c��|j�|j��|j�d��|�|��|j���|j���dS)Nz<locals>)r^r�r��
generic_visitr;)r1�nodes  r{�visit_FunctionDefz_ClassFinder.visit_FunctionDefsn���
���$�)�$�$�$��
���*�%�%�%����4� � � ��
�������
�������r}c�P�|j�|j��|jd�|j��kr5|jr|jdj}n|j}|dz}t|���|�|��|j�	��dS)Nr%rbr7)
r^r�r�r�r<�decorator_list�linenorr�r;)r1r��line_numbers   r{�visit_ClassDefz_ClassFinder.visit_ClassDefs����
���$�)�$�$�$��=�C�H�H�T�Z�0�0�0�0��"�
*�"�1�!�4�;���"�k��
�1��K�%�k�2�2�2����4� � � ��
�������r}N)r-rpr'r�r��visit_AsyncFunctionDefr�rtr}r{r�r��sI������!�!�!����/��
�
�
�
�
r}r�c���t|��}|rtj|��nHt|��}|�d��r|�d��st
d���t||��}|rtj||j	��}ntj|��}|st
d���t|��r|dfSt|��r�|j}d�
|��}tj|��}t!|��}	|�|��t
d���#t$$r}|jd}	||	fcYd}~Sd}~wwxYwt)|��r|j}t-|��r|j}t1|��r|j}t5|��r|j}t9|��r�t;|d	��st
d
���|jdz
}
t?j d��}|
dkrH	||
}n#tB$rt
d
���wxYw|�"|��rn|
dz
}
|
dk�H||
fSt
d���)abReturn 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.�<�>rFzcould not get source coderb�zcould not find class definitionN�co_firstlinenoz"could not find function definitionr7z>^(\s*def\s)|(\s*async\s+def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)zlineno is out of boundszcould not find code object)#rDrj�
checkcacher6�
startswithrUrGr?�getlinesrmrZrLr'r<�ast�parser��visitr�argsrWr�rRr�r\rHrQrIrMr�r��re�compile�
IndexError�match)
r�rxr�r>r��source�tree�class_finder�er��lnum�patr"s
             r{r%r%s����� � �D��	7���T�"�"�"�"��v��������$�$�	7����s�);�);�	7��5�6�6�6�
�v�t�
$�
$�F�
�)��"�4���9�9����"�4�(�(���3��1�2�2�2�������a�x���v���=��&����������y�� � ��#�H�-�-��	=����t�$�$�$�
�;�<�<�<��	#�	&�	&�	&��&��)�K��+�%�%�%�%�%�%�%�����	&��������!�����&���!�����6���!�����v�������
�f�~�~�
��v�/�0�0�	@��>�?�?�?��$�q�(���j�Z�[�[���Q�h�h�
9��T�{�����
9�
9�
9��7�8�8�8�
9�����y�y����
���!�8�D��Q�h�h��d�{��
�.�
/�
/�/s*�#E�
E,�E'�!E,�'E,�H#�#H=c��	t|��\}}n#ttf$rYdSwxYwt|���rAd}|r|ddd�dkrd}|t	|��krP||���dvr4|dz}|t	|��kr||���dv�4|t	|��kr�||dd�dkr�g}|}|t	|��krm||dd�dkrY|�||�����|dz}|t	|��kr||dd�dk�Yd�|��SdSdS|dk�r�t||��}|dz
}|dk�r�||�
��dd�dk�r�t||��|k�r�||����
��g}|dkr�|dz
}||����
��}|dd�dkr�t||��|krg|g|dd�<|dz
}|dkrnS||����
��}|dd�dkrt||��|k�g|rE|d���dkr'g|dd�<|r|d���dk�'|rE|d	���dkr'g|d	d�<|r|d	���dk�'d�|��SdSdSdSdS)
zwGet lines of comments immediately preceding an object's source code.

    Returns None when source can't be found.
    Nrb�z#!r7)r��#r�r�r&)r%rGr�rZr�stripr�r r<rFr!)r�r>r��start�comments�endrA�comments        r{r2r2_s���
� ��(�(���t�t���Y������t�t���������!%����4�U�1�X�b�q�b�\�T�)�)�1�5��c�%�j�j� � �U�5�\�%7�%7�%9�%9�Y�%F�%F��A�I�E��c�%�j�j� � �U�5�\�%7�%7�%9�%9�Y�%F�%F��3�u�:�:���%��,�r��r�"2�c�"9�"9��H��C���E�
�
�"�"�u�S�z�"�1�"�~��'<�'<�����c�
� 5� 5� 7� 7�8�8�8��A�g����E�
�
�"�"�u�S�z�"�1�"�~��'<�'<��7�7�8�$�$�$�
��"9�"9�
�����E�$�K�(�(���Q�h���!�8�8��c�
�)�)�+�+�B�Q�B�/�3�6�6��u�S�z�"�"�f�,�,��c�
�-�-�/�/�6�6�8�8�9�H��Q�w�w��A�g����*�/�/�1�1�8�8�:�:���b�q�b�k�S�(�(�Z��c�
�-C�-C�v�-M�-M�$+�9�H�R�a�R�L���'�C��Q�w�w��#�C�j�3�3�5�5�<�<�>�>�G�	�b�q�b�k�S�(�(�Z��c�
�-C�-C�v�-M�-M�
�
"�x��{�0�0�2�2�c�9�9�!���!����
"�x��{�0�0�2�2�c�9�9��
#�x��|�1�1�3�3�s�:�:� "�����
��
#�x��|�1�1�3�3�s�:�:��7�7�8�$�$�$�%
���8�6�6�,�,s��*�*c��eZdZdS)rNrrtr}r{rr�s�������r}rc��eZdZdZd�Zd�ZdS)rz@Provide a tokeneater() method to detect the end of a code block.c�h�d|_d|_d|_d|_d|_d|_d|_dS)NrbFr7)rA�islambda�started�passline�indecorator�last�	body_col0�r1s r{r�zBlockFinder.__init__�s8�������
������
� �����	�����r}c���|js6|js/|dkrd|_n|dvr|dkrd|_d|_d|_dS|tjkr4d|_|d|_|jrt�|jr	d|_dSdS|jrdS|tjkr3|j	�|jr
|d|_	|j
dz|_
d|_dS|tjkr#|j
dz
|_
|j
dkrt�dS|tjkr+|j	� |d|j	kr|d|_dSdSdS|j
dkr!|tjtj
fvr	t�dSdS)N�@T)�def�class�lambdar�Frbr7)r�r�r�r��tokenize�NEWLINEr�r�INDENTr�rA�DEDENT�COMMENT�NL)r1r~�token�srowcol�erowcolr"s      r{�
tokeneaterzBlockFinder.tokeneater�s����|�(	�D�$4�(	���|�|�#'�� � ��4�4�4��H�$�$�$(�D�M�#��� �D�M�M�M�
�X�%�
%�
%�!�D�M���
�D�I��}�
!� � ���
)�#(�� � � �
)�
)�
�]�	��D�
�X�_�
$�
$��~�%�$�,�%�!(������+��/�D�K� �D�M�M�M�
�X�_�
$�
$��+��/�D�K��{�a��� � � ��
�X�%�
%�
%��~�)�g�a�j�D�N�.J�.J�#�A�J��	�	�	�*�)�.J�.J��[�A�
�
�$�x�/?���.M�"M�"M����
�"M�"Mr}N)r-rpr'r,r�r�rtr}r{rr�s8������J�J����)�)�)�)�)r}rc���t��}	tjt|��j��}|D]}|j|��
n#ttf$rYnwxYw|d|j�S)z@Extract the block of code at the top of the given list of lines.N)	rr��generate_tokens�iter�__next__r�r�IndentationErrorr�)r>�blockfinder�tokens�_tokens    r{r.r.�s����-�-�K�
��)�$�u�+�+�*>�?�?���	,�	,�F�"�K�"�F�+�+�+�	,���(�)�
�
�
���
�����"�+�"�"�#�#s�5A�A�Ac��t|��}t|��\}}t|��r|j}t	|��st|��r|jjdkr|dfSt||d���|dzfS)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>rbNr7)	r`r%r\rHrZrQrI�co_namer.�r�r>r�s   r{rErE�s����F�^�^�F��V�$�$�K�E�4��6���!����	����0�	����0�#�]�2�j�@�@��a�x����d�e�e��%�%�t�a�x�/�/r}c�P�t|��\}}d�|��S)aReturn 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�)rEr<r�s   r{rCrC�s%��!��(�(�K�E�4�
�7�7�5�>�>�r}c���g}|�tdd�����|D]L}|�||jf��||vr*|�t	||||�����M|S)z-Recursive helper function for getclasstree().rpr-r�)r�rdr�r�ra)�classes�children�parentr��cs     r{rara�s~���G��L�L�Z��j�9�9�L�:�:�:�
�?�?������1�;�'�(�(�(���=�=��N�N�8�H�Q�K��1�=�=�>�>�>���Nr}c�4�i}g}|D]c}|jrA|jD]8}||vrg||<|||vr||�|��|r||vrn�9�J||vr|�|���d|D]}||vr|�|���t||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)r�r�ra)r��uniquer��rootsr�r�s      r{r0r0�s����H��E�
�	�	���;�	��+�
7�
7����)�)�')�H�V�$��H�V�,�,�,��V�$�+�+�A�.�.�.��6�f��/�/�����
�e�^�^��L�L��O�O�O���!�!���� � ��L�L�� � � ���E�8�T�*�*�*r}rzargs, varargs, varkwc��t|��s"td�|�����|j}|j}|j}t
|d|���}t
||||z���}d}||z
}d}|jtzr|j|}|dz}d}|jtzr
|j|}t||z||��S)aGet 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 objectNrbr7)rMr�r�co_varnames�co_argcount�co_kwonlyargcount�listr�rrr)	�cor��nargs�nkwargsr��
kwonlyargs�step�varargs�varkws	         r{r+r+s����"�:�:�@��3�:�:�2�>�>�?�?�?��N�E��N�E��"�G���f�u�f�
���D��e�E�%��-�/�0�1�1�J��D�	�W��E��G�	�{�Z����.��'����	���E�	�{�^�#�&���u�%���T�J�&���7�7�7r}rzGargs, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotationsc	��	t|ddtd���}n"#t$r}td��|�d}~wwxYwg}d}d}g}g}i}d}	i}
|j|jur
|j|d<|j���D]�}|j}|j	}
|tur/|�|
��|j|jur|	|jfz
}	n�|tur/|�|
��|j|jur|	|jfz
}	nN|tur|
}nB|tur.|�|
��|j|jur
|j|
|
<n|t ur|
}|j|jur
|j||
<��|
sd}
|	sd}	t%||z|||	||
|��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�sigclsrkzunsupported callableNrt�return)�_signature_from_callablerrr��return_annotation�empty�
parameters�valuesrr��_POSITIONAL_ONLYr��default�_POSITIONAL_OR_KEYWORD�_VAR_POSITIONAL�
_KEYWORD_ONLY�_VAR_KEYWORD�
annotationr)r��sig�exr�r�r��posonlyargsr��annotations�defaults�
kwdefaults�paramrr�s              r{r8r84s
�� 8�"'�t�=B�6;�.7�05�	7�7�7����
�8�8�8�
�.�/�/�R�7�����8�����D��G��E��K��J��K��H��J�
��C�I�-�-� #� 5��H����&�&�(�(�1�1���z���z���#�#�#����t�$�$�$��}�E�K�/�/��U�]�,�,���
�+�
+�
+��K�K������}�E�K�/�/��U�]�,�,���
�_�
$�
$��G�G�
�]�
"�
"����d�#�#�#��}�E�K�/�/�#(�=�
�4� ��
�\�
!�
!��E���5�;�.�.� %� 0�K�������
������{�T�)�7�E�8�!�:�{�<�<�<s��
;�6�;rzargs varargs keywords localsc�`�t|j��\}}}t||||j��S)a9Get 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+rIr�f_locals)�framer�r�r�s    r{r,r,�s0��#�5�<�0�0��D�'�5��4��%���8�8�8r}c�Z�t|dd��dkr&d�}tjd|t|����St	|t
j��rt|��St	|t��r$|j	d|fvr|j
S|j	dz|j
zSt|��S)Nrp�typingc�T�|���}|�d��S)Nztyping.)�group�removeprefix)r��texts  r{�replzformatannotation.<locals>.repl�s#���;�;�=�=�D��$�$�Y�/�/�/r}z[\w\.]+rrr%)rr��sub�reprrur��GenericAliasrvr~rpr')r��base_modulers   r{r&r&�s����z�<��.�.�(�:�:�	0�	0�	0��v�j�$��Z�(8�(8�9�9�9��*�e�0�1�1���:�����*�d�#�#�A�� �Z��$=�=�=��*�*��$�S�(��)@�@�@��
���r}c�4��t|dd����fd�}|S)Nrpc�$��t|���Sr�)r&)r�r�s �r{�_formatannotationz5formatannotationrelativeto.<locals>._formatannotation�s����
�F�3�3�3r})r)r�rr�s  @r{r'r'�s3���
�V�\�4�
0�
0�F�4�4�4�4�4��r}c��d|zS)N�*rt�r�s r{r�r��s
��s�T�z�r}c��d|zS)N�**rtrs r{r�r��s
��T�D�[�r}c�&�dt|��zS)N�=�r	)rzs r{r�r��s��c�D��K�K�.?�r}c��|||fd�}g}	tt|����D]&}
|	�|||
�����'|r0|	�||��|||��z��|r0|	�||��|||��z��dd�|	��zdzS)afFormat 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�<�||��|||��zSr�rt)r�rj�	formatarg�formatvalues    r{�convertz formatargvalues.<locals>.convert�s#���y������V�D�\�!:�!:�:�:r}�(�, �))r:rr�r<)r�r�r�rjr�
formatvarargs�formatvarkwrr�specsrBs           r{r(r(�s���$�#��;�;�;�;�
�E�
�3�t�9�9�
�
�'�'��
���W�W�T�!�W�%�%�&�&�&�&��L�
���]�]�7�+�+�k�k�&��/�.J�.J�J�K�K�K��F�
���[�[��'�'�+�+�f�U�m�*D�*D�D�E�E�E�����5�!�!�!�C�'�'r}c�"���fd�|D��}t|��}|dkr	|d}n@|dkrdj|�}n/dj|dd��}|dd�=d�|��|z}td	|||rd
nd|dkrdnd
|fz���)Nc�6��g|]}|�v�t|����Srtr)rxr�r�s  �r{rNz&_missing_arguments.<locals>.<listcomp>�s)���C�C�C�D��F�0B�0B�T�$�Z�Z�0B�0B�0Br}r7rbr�z	{} and {}z, {} and {}���rz*%s() missing %i required %s argument%s: %s�
positional�keyword-onlyr�r])rrr<r�)�f_name�argnames�posr�r��missingr]�tails   `    r{�_missing_argumentsr,�s����C�C�C�C�H�C�C�C�E��%�j�j�G��!�|�|��!�H���	�A����K���&���#�}�#�U�2�3�3�Z�0���"�#�#�J��I�I�e���t�#��
�@��W�&)�=�l�l�~�#�q�L�L�b�b�c�1�6�6�7�7�7r}c
���t|��|z
}t�fd�|D����}|r
|dk}	d|fz}
nH|rd}	d|t|��fz}
n/t|��dk}	tt|����}
d}|rd}||dkrdnd||dkrdndfz}td	||
|	rdnd|||dkr|sd
ndfz���)Nc���g|]}|�v�|��	Srtrt)rx�argr�s  �r{rNz_too_many.<locals>.<listcomp>�s���?�?�?���������r}r7zat 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 given�was�were)rrvr�)
r'r��kwonlyr��defcount�givenr��atleast�kwonly_given�pluralr��
kwonly_sig�msgs
      `      r{�	_too_manyr:�s&����$�i�i�(�"�G��?�?�?�?�v�?�?�?�@�@�L����A����w�j�(���	������#�d�)�)� 4�4����T���a����#�d�)�)�n�n���J��@�G���E�Q�J�J�S�S�B��$0�A�$5�$5�S�S�2�?�?�
�
�K�
�S��/�#�#�R��
��q�j�j��j�U�U�6�
C�C�D�D�Dr}c	���t|��}|\}}}}}}	}
|j}i}t|��r|j�|jf|z}t	|��}
t	|��}|rt	|��nd}t|
|��}t
|��D]}|||||<�|rt||d���||<t||z��}|ri||<|�	��D]H\}}||vr"|st|�d|�����||||<�+||vrt|�d|�����|||<�I|
|kr|st||||||
|��|
|krW|d||z
�}|D]}||vrt||d|���t|||z
d���D]\}}||vr||||<�d}|D]}||vr|	r||	vr|	|||<�|dz
}�|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'.Nrbz&() got an unexpected keyword argument z$() got multiple values for argument Tr7F)r8r-rWr.rr9r:r�r�r�r�r:r,�	enumerate)r�r%�named�specr�r�r�r�r��kwonlydefaultsr�r'�	arg2value�num_pos�num_args�num_defaults�nrB�possible_kwargs�kwrz�reqr/r*�kwargs                         r{r/r/�s����$���D�FJ�C�D�'�5�(�J���
�]�F��I���~�~�3�$�-�3��m�%�
�2�
��*�o�o�G��4�y�y�H�$,�3�3�x�=�=�=�!�L��G�X���A�
�1�X�X�+�+��'��]�	�$�q�'����3�"�:�a�b�b�>�2�2�	�'���$��+�,�,�O����	�%���[�[�]�]�
�
�	��E�
�_�$�$��
.��!'�����!-�.�.�.�#(�I�e��R� ��
��?�?��#�V�V�R�R�)�*�*�
*��	�"�
�
�����'���&�$�
�G�\��I�	'�	'�	'������+�H�|�+�+�,���	A�	A�C��)�#�#�"�6�3��i�@�@�@����X��%<�%=�%=� >�?�?�	-�	-�F�A�s��)�#�#�!)�!��	�#����G������	�!�!��
�%�>�"9�"9�#1�%�#8�	�%� � ��1�����A��6�:�u�i�@�@�@��r}rz"nonlocals globals builtins unboundc�v�t|��r|j}t|��s"td�|�����|j}|j�i}n$d�t|j|j��D��}|j	}|�
dtj��}t|��r|j}i}i}t��}|jD]U}|dvr�	||||<�#t $r5	||||<n%#t $r|�|��YnwxYwY�RwxYwt%||||��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�$�i|]
\}}||j��Srt)�
cell_contents)rx�var�cells   r{r|z"getclosurevars.<locals>.<dictcomp>As1��	�	�	���T�
�$�$�	�	�	r}�__builtins__)�None�True�False)rWr�rRr�rr��__closure__�zip�co_freevarsrqrnrrrmrZr��co_names�KeyErrorr�r)	r��code�
nonlocal_vars�	global_ns�
builtin_ns�global_vars�builtin_vars�
unbound_namesr�s	         r{r1r1,s�����~�~���}���d���F��7�>�>�t�D�D�E�E�E��=�D�����
�
�	�	� ��!1�4�3C�D�D�	�	�	�
�� �I����~�x�/@�A�A�J��
���)��(�
��K��L��E�E�M��
�(�(���,�,�,�
�	(� )�$��K������	(�	(�	(�
(�%/��%5��T�"�"���
(�
(�
(��!�!�$�'�'�'�'�'�
(������	(�����}�k�#�]�4�4�4s6�C'�'
D&�2C>�=D&�>D �D&�D � D&�%D&�
_Tracebackz+filename lineno function code_context indexc�*��eZdZdd��fd�
Zd�Z�xZS)r!N��	positionsc�b��t���||||||��}||_|Sr���super�__new__rb)	r�r^r��function�code_context�indexrb�instancer/s	        �r{rfzTraceback.__new__ds0����7�7�?�?�3��&�(�L�RW�X�X��&����r}c�r�d�|j|j|j|j|j|j��S)NzcTraceback(filename={!r}, lineno={!r}, function={!r}, code_context={!r}, index={!r}, positions={!r}))rr^r�rgrhrirbr�s r{�__repr__zTraceback.__repr__is9��@�@F���
�t�{�D�M�4�;L��
�D�N�A,�A,�	-r}�r-rpr'rfrl�
__classcell__�r/s@r{r!r!csT�������SW��������
-�-�-�-�-�-�-r}r!c�H�|jj|j}}t||��Sr�)rHrI�tb_lasti�_get_code_position)�tbrX�instruction_indexs   r{�_get_code_position_from_tbruos$�� �k�0�"�+�
�D��d�$5�6�6�6r}c��|dkrdS|���}ttj||dzd����S)Nrb)NNNNr�)�co_positions�next�	itertools�islice)rXrt�
positions_gens   r{rrrrssG���1���'�'��%�%�'�'�M��	� ��0A�Q�0F��M�M�N�N�Nr}r7c
���t|��rt|��}|j}|j}n!|j}t|j|j��}|d�||g|dd��R^}}n|g|�R^}}|d}t|��s"td�
|�����t|��pt|��}|dkrv|dz
|dzz
}	t|��\}}tdt|t!|��|z
����}||||z�}|dz
|z
}n#t"$rdx}}YnwxYwdx}}t%|||jj||t)j|����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.rbNr7z'{!r} is not a frame or traceback objectr�ra)r\ru�	tb_linenorH�f_linenorrrI�f_lastirQr�rrDr6r%�maxr9rrGr!r��dis�	Positions)	r�contextrbr�r^r�r>r�ris	         r{r7r7zs����5���D�.�u�5�5�	�����������&�u�|�U�]�C�C�	���|��"�F�;�Y�q�r�r�]�;�;���	�	�"�/�Y�/�/���	�
�q�\�F��5�>�>�Q��A�H�H��O�O�P�P�P��U�#�#�5�w�u�~�~�H���{�{���
�W�a�Z�'��	'�$�U�+�+�K�E�4���3�u�c�%�j�j�7�&:�;�;�<�<�E��%��g�
�-�.�E��Q�J��&�E�E���	!�	!�	!� � �E�E�E�E�	!���������X�v�u�|�';�U��c�m�Y�&?�A�A�A�As�D0�0E�Ec��|jS)zCGet the line number from a frame object, allowing for optimization.)r~�rs r{r<r<�s���>�r}�
_FrameInfor�c�*��eZdZdd��fd�
Zd�Z�xZS)rNrac	�d��t���|||||||��}||_|Sr�rd)
r�rr^r�rgrhrirbrjr/s
         �r{rfzFrameInfo.__new__�s2����7�7�?�?�3��x���<�Y^�_�_��&����r}c	�~�d�|j|j|j|j|j|j|j��S)NzoFrameInfo(frame={!r}, filename={!r}, lineno={!r}, function={!r}, code_context={!r}, index={!r}, positions={!r}))rrr^r�rgrhrirbr�s r{rlzFrameInfo.__repr__�s>��@�@F���
�D�M�4�;��
��!�4�:�t�~�A?�A?�	@r}rmros@r{rr�s[�������Z^��������
@�@�@�@�@�@�@r}rc��g}|rCt||��}|f|z}|�t|d|ji���|j}|�C|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.rb)r7r�rrb�f_back)rr��	framelist�traceback_info�	frameinfos     r{rBrB�si��
�I�
��%�e�W�5�5���H�~�-�	�����I�R��9Q�R�R�S�S�S����	��
�r}c��g}|rHt||��}|jf|z}|�t|d|ji���|j}|�H|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.rb)r7rHr�rrb�tb_next)rsr�r�r�r�s     r{r;r;�sk��
�I�
��%�b�'�2�2���[�N�^�3�	�����I�R��9Q�R�R�S�S�S�
�Z��	
��
�r}c�X�ttd��rtjd��ndS)z?Return the frame of the caller or None if this is not possible.�	_getframer7N)r�r�r�rtr}r{r$r$�s&��&�s�K�8�8�B�3�=�����d�Br}c�F�ttjd��|��S)z@Return a list of records for the stack above the caller's frame.r7)rBr�r��r�s r{r^r^�s���#�-��*�*�G�4�4�4r}c�P�ttj��d|��S)zCReturn a list of records for the stack below the current exception.r�)r;r��exc_infor�s r{r_r_�s���#�,�.�.��+�W�5�5�5r}c�L�tjd�|��S)Nr)r~rmr�)�klasss r{�_static_getmror��s���=��#�+�+�E�2�2�2r}c��i}	t�|d��}n#t$rYnwxYwt�||t
��S�Nrm)r��__getattribute__r�r�rn�	_sentinel)r��attr�
instance_dicts   r{�_check_instancer��sY���M�
��/�/��Z�@�@�
�
���
�
�
���
�����8�8�M�4��3�3�3s� �
-�-c��t|��D]E}tt|����tur 	|j|cS#t
$rY�AwxYw�FtSr�)r��_shadowed_dictr~r�rmrW)r�r��entrys   r{�_check_classr��sw����&�&�����$�u�+�+�&�&�)�3�3�
��~�d�+�+�+�+���
�
�
���
����4�
�s�A�
A�Ac�J�	t|��n#t$rYdSwxYwdS�NFT)r�r�r�s r{�_is_typer��s?����s�����������u�u������4s��
 � c��tjd}t|��D]a}	|�|��d}t|��tjur|jdkr	|j|us|cS�R#t$rY�^wxYwtSr�)
r~rmr�r�r�r�r-r�rWr�)r��	dict_attrr��
class_dicts    r{r�r��s����
�j�)�I���&�&�	"�	"��	"�"�*�*�5�1�1�*�=�J���$�$��(B�B�B��'�:�5�5��+�u�4�4�!�!�!�!�5���	�	�	��D�	�����s�A4�4
B�Bc�$�t}t|��sSt|��}t|��}|tust|��tjurt
||��}n|}t||��}|turw|turntt|��d��turJtt|��d��tus$tt|��d��tur|S|tur|S|tur|S||urbtt|����D]E}tt|����tur 	|j	|cS#t$rY�AwxYw�F|tur|St|���)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�r�)r�r�r~r�r�r�r�r�r�rmrWr�)r�r�r��instance_resultr�r��klass_resultr�s        r{r-r-s��� �O��C�=�=���S�	�	��"�5�)�)�	���"�"���O�O�u�9�9�9�-�c�4�8�8�O������t�,�,�L��i�'�'�L�	�,I�,I���\�*�*�I�6�6�i�G�G���l�+�+�Y�7�7�y�H�H��D��.�.��=�=�Y�N�N����i�'�'����9�$�$���
�e�|�|�#�D��K�K�0�0�	�	�E��d�5�k�k�*�*�i�7�7�� �>�$�/�/�/�/�������D�����8�
�i�����
��
�
�s�E'�'
E4�3E4rrrrc�d�|jrtS|jrtS|j�t
StS)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.
    )�
gi_runningr�gi_suspendedr�gi_framerr)�	generators r{r:r:Cs;��������������!����r}c��t|��s"td�|�����t|dd��}|�|jjSiS)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)rSr�rrr�r�)r�rs  r{r9r9UsZ���y�!�!�L��8�?�?�	�J�J�K�K�K��I�z�4�0�0�E����!�*�*��	r}rr	r
rc�d�|jrtS|jrtS|j�t
StS)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.
    )�
cr_runningr	�cr_suspendedr
�cr_framerr)�	coroutines r{r4r4ms;��������������!����r}c�:�t|dd��}|�|jSiS)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)rr�)r�rs  r{r3r3s(��
�I�z�4�0�0�E����~���	r}c��|dkrt||d��}nt||d��}|�t|t��rdS|dkrt	||��}|S)z�Private helper. Checks if ``cls`` has an attribute
    named ``method_name`` and returns it only if it is a
    pure python function.
    rfN)rr-ru�_NonUserDefinedCallables�_descriptor_get)r��method_name�meths   r{�"_signature_get_user_defined_methodr��sm��
�i����s�K��.�.����c�;��5�5���|�z�$�(@�A�A�|��t��i����t�S�)�)���Kr}rtc�d�|j}t|�����}|jpd}|jpi}|r||z}	|j|i|��}n7#t$r*}d�|��}	t|	��|�d}~wwxYwd}
|���D�]j\}}	|j	|}
|j
tur|�|���8|j
tur;||vrd}
|�|
���||<n|�|j����|j
t ur|�|
���||<n#t"$rYnwxYw|
r�|j
tusJ�|j
tur=||�t ���}|||<|�|����|j
t t&fvr|�|����B|j
t(ur|�|j����l|�|������S)	z�Private helper to calculate how 'wrapped_sig' signature will
    look like after applying a 'functools.partial' object (or alike)
    on it.
    rtz+partial object {!r} has incorrect argumentsNFT)r��r�r�)r�rfr�r��keywords�bind_partialr�rr��	argumentsrr�r;r��replacer�r�rW�move_to_endr�r�r�)�wrapped_sigr��
extra_args�
old_params�
new_params�partial_args�partial_keywords�bar�r9�transform_to_kwonly�
param_namer��	arg_value�	new_params               r{�_signature_get_partialr��s����'�J��Z�-�-�/�/�0�0�J��<�%�2�L��'�-�2���1�!�L�0��&�
%�[�
%�|�
H�7G�
H�
H�����&�&�&�;�B�B�7�K�K����o�o�2�%�����&����
 ��'�-�-�/�/�0+�0+��
�E�#	J���Z�0�I��z�-�-�-����z�*�*�*���z�3�3�3��!1�1�1�+/�'�-2�]�]�9�]�-M�-M�J�z�*�*��N�N�5�:�.�.�.���z�]�*�*�).���y��)I�)I�
�:�&���C�	�	�	��D�	����F�
	+��:�%5�5�5�5�5��z�3�3�3�&�z�2�:�:�
�:�N�N�	�)2�
�:�&��&�&�z�2�2�2�2���
�|�<�<�<��&�&�z�2�2�2�2����.�.����u�z�*�*�*�����*�*;�*;�*=�*=��>�>�>s*�
A�
B�%B�B�%
E�
E�Ec�R�t|j�����}|r|djtt
fvrt
d���|dj}|ttfvr|dd�}n|turt
d���|�
|���S)zWPrivate helper to transform signatures for unbound
    functions to bound methods.
    rbzinvalid method signaturer7Nzinvalid argument typer�)r�r�r�rr�r�r�r�r�r�r�)r��paramsrs   r{�_signature_bound_methodr��s���
�3�>�(�(�*�*�
+�
+�F��5�V�A�Y�^��m�'D�D�D��3�4�4�4��!�9�>�D��&�(8�9�9�9����������&�&��4�5�5�5��;�;�&�;�)�)�)r}c��t|��p3t|��p$t|t��p|tt
fvS)zxPrivate helper to test if `obj` is a callable that might
    support Argument Clinic's __text_signature__ protocol.
    )rKrXrur�r~r�r�s r{�_signature_is_builtinr�sH��
�c�N�N�
"��s�#�#�
"��s�4�5�5�
"�

�D�&�>�!�#r}c���t|��rt|��rdSt|dd��}t|dd��}t|dt��}t|dt��}t|dd��}t	|t
j��o_t	|t��oJ|dupt	|t��o1|dupt	|t��ot	|t��p|duS)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__ro)
r�rLr�_voidrur�r�rvr�r�)r�r�rXr�r�r�s      r{r�r�s���C�=�=��G�C�L�L���u��3�
�D�)�)�D��3�
�D�)�)�D��s�N�E�2�2�H���.��6�6�J��#�0�$�7�7�K��t�U�^�,�,�
E��t�S�!�!�
E�
��
�
<��H�e�!<�!<�
E��4�
�
?�:�j�$�#?�#?�
E���d�
,�
,�
C��t�0C�	Gr}c��|s|ddfSd}d}d�|�d��D��}t|��j}tj|��}d}d}g}|j}	d}
t
j}t
j}t|��}
|
j	tj
ksJ�|D]�}
|
j	|
j}}||kr-|dkr|rd}n|rJ�d}|
dz
}
�-|d	kr|rJ�|�J�d}|
dz
}�C||kr
|d
kr|�J�|
}�V|rd}||kr|dks|	d��|	|��|dkr|	d
����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�<�g|]}|�|�d����S)�ascii)�encode)rx�ls  r{rNz6_signature_strip_non_python_syntax.<locals>.<listcomp>Gs)��C�C�C�1��C�Q�X�X�g�
�
�C�C�Cr}r6Frb�,Tr7�/�$rr� r�)
r(r�r�r�r�r��OP�
ERRORTOKENrxr~�ENCODING�stringr<)r]�self_parameter�last_positional_onlyr>r��token_stream�
delayed_comma�skip_next_commarr��current_parameterr�r��tr~r��clean_signatures                 r{�"_signature_strip_non_python_syntaxr�4s����%��$��$�$��N���C�C�	����(=�(=�C�C�C�E��U���$�I��$�Y�/�/�L��M��O�
�D�
�+�C���	��B��!�J�	
�\���A��6�X�&�&�&�&�&�
�����v�q�x�f���2�:�:���}�}�"�+�&+�O�O�,�,�,�,�$(�M�%��*�%����}�}�*�*�*�*�+�3�3�3�"&��'8�1�'<�$���J���V�s�]�]�!�)�)�)�.�N���	�!�M��R�Z�Z�f��m�m���D�	�	�	���F�����c�M�M��C��H�H�H���g�g�d�m�m�O��N�,@�@�@r}Tc�������������|j�t|��\}}}d|zdz}	tj|��}n#t$rd}YnwxYwt|tj��s"td�������|j	d}	g��j
�d}i�t�dd��}
|
r)tj
�|
d��}|r|j�tj
����d����fd��G�fd	�d
tj����f�������fd�	}t%|	jj��}t%|	jj��}
t+j||
d���}|��j�n�j�t3t%t5|������D]!\}\}}|||��||kr�j��"|	jjr�j�||	jj����j�t=|	jj|	jj ��D]\}}|||���|	jj!r�j"�||	jj!���|�j�sJ�t�d
d��}|du}tG|��}|r|s|r��$d��n&�d�%�j���}|�d<|�|j
���S)zdPrivate helper to parse content of '__text_signature__'
    and return a Signature based on it.
    zdef fooz: passN�"{!r} builtin has invalid signaturerbrpc�t�t|tj��sJ�|j�t	d���|jS)Nz'Annotations are not currently supported)rur�r/r�r�)r�s r{�
parse_namez&_signature_fromstr.<locals>.parse_name�s8���$���(�(�(�(�(��?�&��F�G�G�G��x�r}c�D��	t|���}n7#t$r*	t|���}n#t$rt�wxYwYnwxYwt|tt
ttttd��f��rtj|��St�r�)rw�	NameErrorr�rurv�int�float�bytesr�r~r��Constant)r]rz�module_dict�sys_module_dicts  ��r{�
wrap_valuez&_signature_fromstr.<locals>.wrap_value�s����	!���K�(�(�E�E���	!�	!�	!�
!��Q��0�0�����
!�
!�
!� � �
!������	!�����e�c�3��u�d�D��J�J�G�H�H�	'��<��&�&�&��s#��
A�0�A�A�A�Ac�*��eZdZ�fd�Z�fd�Zd�ZdS)�,_signature_fromstr.<locals>.RewriteSymbolicsc���g}|}t|tj��r;|�|j��|j}t|tj���;t|tj��st�|�|j��d�	t|����}�|��S)Nr%)rur�rr�r�rz�Namer�rr<�reversed)r1r��arDrzr�s     �r{�visit_Attributez<_signature_fromstr.<locals>.RewriteSymbolics.visit_Attribute�s�����A��A��Q��
�.�.�
������ � � ��G���Q��
�.�.�
��a���*�*�
!� � �
�H�H�Q�T�N�N�N��H�H�X�a�[�[�)�)�E��:�e�$�$�$r}c�~��t|jtj��st	����|j��Sr�)ru�ctxr��Loadr�r)r1r�r�s  �r{�
visit_Namez7_signature_fromstr.<locals>.RewriteSymbolics.visit_Name�s5����d�h���1�1�
#� �l�l�"��:�d�g�&�&�&r}c�n�|�|j��}|�|j��}t|tj��rt|tj��st�t|jtj��r!t	j|j	|j	z��St|jtj
��r!t	j|j	|j	z
��St|jtj��r!t	j|j	|j	z��St�r�)r��left�rightrur�r�r��op�Addrz�Sub�BitOr)r1r�rr
s    r{�visit_BinOpz8_signature_fromstr.<locals>.RewriteSymbolics.visit_BinOp�s����:�:�d�i�(�(�D��J�J�t�z�*�*�E��d�C�L�1�1�
!��E�3�<�9X�9X�
!� � ��$�'�3�7�+�+�
>��|�D�J���$<�=�=�=��D�G�S�W�-�-�
>��|�D�J���$<�=�=�=��D�G�S�Y�/�/�
>��|�D�J���$<�=�=�=��r}N)r-rpr'rr
r)r�s�r{�RewriteSymbolicsr�sV�������
	%�
	%�
	%�
	%�
	%�	'�	'�	'�	'�	'�

	�
	�
	�
	�
	r}rc�@���
|��}|rm|turd	����|��}tj|��}n1#t$r$t	d������d�wxYw�	��|�|������dS)Nr��r�r�)�_emptyr�r��literal_evalr�rr�)�	name_node�default_noder�r�rrr�rr�r�r�s    �������r{�pz_signature_fromstr.<locals>.p�s�����z�)�$�$���	]�L��6�6�
]�/�/�1�1�7�7��E�E���*�<�8�8�����
]�
]�
]� �!E�!L�!L�S�!Q�!Q�R�R�X\�\�
]�������)�)�D�$��E�R�R�R�S�S�S�S�Ss�1A�.A9)�	fillvaluer.r��r�)&�_parameter_clsr�r�r��SyntaxErrorru�Moduler�r�bodyr�rr�r�rnrmru�NodeTransformerrr�r�ry�zip_longest�POSITIONAL_ONLY�POSITIONAL_OR_KEYWORDr<r��vararg�VAR_POSITIONAL�KEYWORD_ONLYrTr��kw_defaultsrH�VAR_KEYWORDrZr;r�)r�r�r]r�r�r�r��programr�r�r�rr�r�r�rBr�r��_self�self_isbound�
self_ismodulerrr�rr�r�r�r�r�s `                   @@@@@@@@@r{�_signature_fromstrr.|s��������������"�I�	+�1�-�-�:�O�^�%9��/�)�H�4�G����7�#�#�����������������f�c�j�)�)�K��=�D�D�S�I�I�J�J�J���A��A��J��O�E�
�F��K��#�|�T�2�2�K��*������d�3�3���	*� �/�K��k�&�&�(�(�O�����������������3�.����B,1�T�T�T�T�T�T�T�T�T�T�T�T��A�F�K� � �D�����(�(�H�� ��x�4�@�@�@�D��'��(����.��'���d���(<�(<�=�=�3�3���?�D�'�	��$������$�$�$��2�D��	�v�}� ��'��	��!�&�-������!�D��Q�V�.���0B�C�C���
��g�	��$������	�v�|���$��	��!�&�,������!����z���Z��.�.���D�(�� ����
��	�]�	�n�	��N�N�1������1�
�%�%�9�+D�%�E�E�A��J�q�M��3�z�S�Y�7�7�7�7s�A�A�Ac���t|��s"td�|�����t|dd��}|s"t	d�|�����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�rrr�r.)r�r�r�r]s    r{�_signature_from_builtinr1	s���
!��&�&�1��#�#)�6�$�<�<�1�1�	1�	��*�D�1�1�A��M��>�E�E�d�K�K�L�L�L��c�4��N�;�;�;r}c
�>�d}t|��s4t|��rd}n"td�|�����t	|dd��}|rt||||��S|j}|j}	|	j}
|	j	}|	j
}|d|
�}
|	j}||
|
|z�}t||||���}|j
}|j}|rt|��}nd}g}|
|z
}|}|
d|�D]U}|rt nt"}|�|t&��}|�||||�����|r|d	z}�Vt+|
|d���D]_\}}|rt nt"}|�|t&��}|�||||||�
����|r|d	z}�`|	jt.zrL||
|z}|�|t&��}|�|||t0�����|D]h}t&}|�|�|t&��}|�|t&��}|�|||t2|�
�����i|	jt4zrb|
|z}|	jt.zr|d	z
}||}|�|t&��}|�|||t6�����|||�dt&��|���S)
zCPrivate helper: constructs Signature for the given python function.FTrJr0Nrhrb)r�rr7)r�rr�r��r��__validate_parameters__)rRr�r�rrr.rr�r�r��co_posonlyargcountr�r)r�r�rr�r�rnrr�r<r�rr�r�rr�)r�r�r�rirjrk�is_duck_functionr]r�	func_code�	pos_count�	arg_names�
posonly_countr%�keyword_only_count�keyword_onlyr�r�r��pos_default_countr��non_default_count�posonly_leftr�rr��offsetr�ris                             r{�_signature_from_functionrA	s������d���J�%�d�+�+�	J�#����;�B�B�4�H�H�I�I�I���*�D�1�1�A��@�!�#�t�Q��?�?�?��"�I��
�I��%�I��%�I��0�M��:�I�:�&�J�"�4���Y�y�3E�'E�E�F�L�!�$���QY�Z�Z�Z�K�� �H��$�J�����M�M������J�!�$5�5�� �L��-�-�-�.����#/�K���5K�� �_�_�T�6�2�2�
����)�)�D�Z�)-�/�/�/�	0�	0�	0��	��A��L��"�*�->�-?�-?�"@�A�A������#/�K���5K�� �_�_�T�6�2�2�
����)�)�D�Z�)-�,4�V�,<�>�>�>�	?�	?�	?��	��A��L����J�&�;���%7�7�8�� �_�_�T�6�2�2�
����)�)�D�Z�)8�:�:�:�	;�	;�	;��6�6�����!� �n�n�T�6�2�2�G� �_�_�T�6�2�2�
����)�)�D�Z�)6�,3�5�5�5�	6�	6�	6�	6���N�*�8��.�.����
�*�	��Q�J�E����� �_�_�T�6�2�2�
����)�)�D�Z�)5�7�7�7�	8�	8�	8�
�3�z�!,����6�!B�!B�'7�9�9�9�9r}c��t|��r|Stt|��dt��}|tur|S|||t|����S)Nr�)rLrr~r�)�
descriptorr�rns   r{r�r�z	s\���z������
�$�z�"�"�I�y�
9�
9�C�
�i������3�z�3��S�	�	�*�*�*r})r�r�rirjrkc	��tjt||||||���}t|��s"t	d�|�����t
|tj��r#||j	��}|rt|��S|S|r7t|d����}t
|tj��r||��S	|j}|�9t
|t��s"t	d�|�����|Sn#t$rYnwxYw	|j}	t
|	tj��r�||	j��}
t%|
|	d��}t'|
j�����d}|jt.jur|St'|j�����}|r||dusJ�|f|z}
|�|
�	��Sn#t$rYnwxYwt5|��st7|��rt9||||||�
��St;|��rt=|||���St
|tj��r ||j��}
t%|
|��St
|t>���rGtAt?|��d��}|�||��StA|d
��}tA|d��}|j!D]E}|�)d
|j"vr ||��}|rt|��}|cS|�d|j"vr
||��cS�F|j!dd�D]/}	|j#}|rtI|||��cS� #t$rY�,wxYwt>|j!vrb|j%tLj%ur-|j'tLj'ur|�(tL��StSd�|�����n;tUt?|��dd��}|�tW||��}||��StSd�|�����)zQPrivate helper function to get signature for arbitrary
    callable objects.
    )r�r�rirjr�rkz{!r} is not a callable objectc�V�t|d��pt|tj��S)N�
__signature__)r�rur�r�)r�s r{r�z*_signature_from_callable.<locals>.<lambda>�	s)��'�!�_�*E�*E�+C�#-�a��1A�#B�#B�r}rNz1unexpected object {!r} in __signature__ attributer�rbr�)r�rirjrk)r��__call__rfr�r&z(no signature found for builtin type {!r}z+callable {!r} is not supported by signature),r�r�r�r�r�rrur�r�r�r�r`rFrr��_partialmethod�
partialmethodr�r�r�r�r�rrr&r�rRr�rAr�r1r~r�rrmr0r.r�r�rf�
from_callabler�r-r�)r�r�r�rirjrkr��_get_signature_ofr�rIr��first_wrapped_param�
sig_paramsr��call�new�initr��text_sigs                   r{r�r��	sT��"�)�*B�6K�/=�(/�'-�'-�)1�
3�3�3���C�=�=�E��7�>�>�s�C�C�D�D�D��#�u�'�(�(�� ����-�-���	�*�3�/�/�/��J��	*��S�!C�!C�E�E�E���c�5�+�,�,�	*�%�$�S�)�)�)�
�����?��c�9�-�-�
-�� � &��s���-�-�-��J����
�
�
���
����:��*�
��m�Y�%<�=�=�	:�,�+�M�,>�?�?�K�(��m�W�M�M�C�"'��(>�(E�(E�(G�(G�"H�"H��"K��"�'�9�+C�C�C��
�"�3�>�#8�#8�#:�#:�;�;�
�&�B�+�:�a�=�@�@�@�A�1�3�j�@�
��{�{�j�{�9�9�9�+	:���
�
�
���
����4�#���[�4�S�9�9�[�(���7E�07��QY�[�[�[�	[��S�!�!�F�&�v�s�6D�F�F�F�	F��#�y�(�)�)�8�'�'���1�1��%�k�3�7�7�7��#�t���A+�
2�$�s�)�)�Z�H�H����$�$�T�*�*�*�0��i�@�@��1�#�z�B�B���K�		/�		/�D���9��
�#=�#=�'�'��,�,��!�7�1�#�6�6�C��
�
�
��!�j�D�M�&A�&A�(�(��.�.�.�.�.��
�K����$�	F�	F�D�
F��2���F�.�f�d�H�E�E�E�E�E�F��"�
�
�
���
�����s�{�"�"�����/�/���v�~�-�-��+�+�F�3�3�3� �>�E�E�c�J�J�L�L�L�#��d�3�i�i��T�:�:����"�4��-�-�D�$�$�T�*�*�*�
�B�I�I�#�N�N�
O�
O�Os6�	D�
D�D�G1�1
G>�=G>�M+�+
M8�7M8c��eZdZdZdS)r�z1A private marker - used in Parameter & Signature.N�r-rpr'r,rtr}r{r�r�-
s������;�;�;�;r}r�c��eZdZdZdS)rz6Marker object for Signature.empty and Parameter.empty.NrSrtr}r{rr1
s������@�@�@�@r}rc�.�eZdZdZdZdZdZdZd�Zd�Z	dS)	�_ParameterKindzpositional-onlyzpositional or keywordzvariadic positionalr&zvariadic keywordc��t|j��}t�||��}||_||_|Sr�)r�__members__r�rf�_value_�description)r�rZrz�members    r{rfz_ParameterKind.__new__<
s8���C�O�$�$�����S�%�(�(�����(����
r}c��|jSr�rr�s r{�__str__z_ParameterKind.__str__C
s
���y�r}N)
r-rpr'r#r$r&r'r)rfr]rtr}r{rVrV5
sL������'�O�3��*�N�!�L�$�K��������r}rVc���eZdZdZdZeZeZe	Z
eZe
ZeZeed�d�Zd�Zd�Zed���Zed���Zed	���Zed
���Zeeeed�d�Zd
�Zd�Zd�Zd�ZdS)raRepresents 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�_annotationrc���	t|��|_n!#t$rtd|�d����wxYw|turE|jtt
fvr0d}|�|jj��}t|���||_||_	|turtd���t|t��s6d�t|��j
��}t|���|ddkr�|dd����ri|jt kr0d	}|�|jj��}t|���t"|_d
�|dd���}t%|��o
|jt"u}|s|���s"td�|�����||_dS)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 {}rbr%r7zLimplicit arguments must be passed as positional or keyword arguments, not {}z
implicit{}z"{!r} is not a valid parameter name)rVr`r�rr�r�rrZrarbrurvr~r-r��isdigitr�r�rc�isidentifierr_)r1r�rr�r�r9�
is_keywords       r{r�zParameter.__init__m
s���	N�'��-�-�D�J�J���	N�	N�	N��L�d�L�L�L�M�M�M�	N�����&� � ��z�o�|�<�<�<�@���j�j���!7�8�8�� ��o�o�%���
�%����6�>�>��I�J�J�J��$��$�$�	!�0�7�7��T�
�
�8K�L�L�C��C�.�.� ���7�c�>�>�d�1�2�2�h�.�.�0�0�>�
�z�3�3�3�>���j�j���!7�8�8�� ��o�o�%�)�D�J��&�&�t�A�B�B�x�0�0�D��t�_�_�K���;K�)K�
��	P�T�.�.�0�0�	P��A�H�H��N�N�O�O�O���
�
�
s��5c�X�t|��|j|jf|j|jd�fS)N�rarb)r~r_r`rarbr�s r{�
__reduce__zParameter.__reduce__�
s6���T�
�
���T�Z�(�!�]� $� 0�2�2�3�	3r}c�:�|d|_|d|_dS)Nrarbrh�r1�states  r{�__setstate__zParameter.__setstate__�
s!���j�)��
� ��/����r}c��|jSr�)r_r�s r{r�zParameter.name�
�
���z�r}c��|jSr�)rar�s r{r�zParameter.default�
s
���}�r}c��|jSr�)rbr�s r{r�zParameter.annotation�
�����r}c��|jSr�)r`r�s r{rzParameter.kind�
ror})r�rr�r�c��|tur|j}|tur|j}|tur|j}|tur|j}t|��||||���S)z+Creates a customized copy of the Parameter.r)r�r_r`rbrar~)r1r�rr�r�s     r{r�zParameter.replace�
sh���5�=�=��:�D��5�=�=��:�D������)�J��e����m�G��t�D�z�z�$��g�*�M�M�M�Mr}c��|j}|j}|jtur(d�|t|j����}|jtur_|jtur)d�|t|j����}n(d�|t|j����}|tkrd|z}n|tkrd|z}|S)Nz{}: {}z{} = {}z{}={}rr)
rr_rbrrr&rar	r�r�)r1r�	formatteds   r{r]zParameter.__str__�
s����y���J�	���6�)�)� ���	�'7��8H�'I�'I�K�K�I��=��&�&���v�-�-�%�,�,�Y��T�]�8K�8K�L�L�	�	�#�N�N�9�d�4�=�6I�6I�J�J�	��?�"�"��i��I�I�
�\�
!�
!��y�(�I��r}c�B�d�|jj|��S)Nz	<{} "{}">�rr/r-r�s r{rlzParameter.__repr__�
s���!�!�$�.�"9�4�@�@�@r}c�P�t|j|j|j|jf��Sr�)�hashr�rr�r�r�s r{�__hash__zParameter.__hash__�
s!���T�Y��	�4�?�D�L�I�J�J�Jr}c���||urdSt|t��stS|j|jko/|j|jko|j|jko|j|jkS�NT)rur�NotImplementedr_r`rarb�r1�others  r{�__eq__zParameter.__eq__�
sp���5�=�=��4��%��+�+�	"�!�!��
�e�k�)�6��
�e�k�)�6��
���/�6�� �E�$5�5�	7r}N)r-rpr'r,r+r�r#r�r$r�r&r�r'r�r)rr�r�rirmr�r�r�r�rr�r�r]rlr{r�rtr}r{rrM
sY��������*>�I�.�O�4��-�N�+�L�*�K��E�.4��)�)�)�)�)�V3�3�3�0�0�0�����X������X��� � ��X� �����X��$�%� �%�N�N�N�N�N�$���,A�A�A�K�K�K�7�7�7�7�7r}rc�|�eZdZdZdZd�Zed���Zed���Zed���Z	d�Z
d�Zd	�Zd
�Z
d�ZdS)
ra�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�"�||_||_dSr�)r�r�)r1r]r�s   r{r�zBoundArguments.__init__�
s��"���#����r}c��|jSr�)r�r�s r{r]zBoundArguments.signatures
����r}c�N�g}|jj���D]v\}}|jtt
fvrn[	|j|}|jtkr|�|���P|�	|���f#t$rYnwxYwt|��Sr�)r�r�r�rr�r�r�r��extendr�rWr�)r1r�r�r�r/s     r{r�zBoundArguments.argss�����!%��!;�!A�!A�!C�!C�	%�	%��J���z�l�M�:�:�:���
%��n�Z�0���:��0�0��K�K��$�$�$�$��K�K��$�$�$�$���
�
�
����
�����T�{�{�s�
B�
B�Bc�:�i}d}|jj���D]w\}}|s$|jtt
fvrd}n||jvrd}�+|s�.	|j|}|jtkr|�|���b|||<�h#t$rY�twxYw|Sr�)	r�r�r�rr�r�r��updaterW)r1�kwargs�kwargs_startedr�r�r/s      r{r�zBoundArguments.kwargss�������!%��!;�!A�!A�!C�!C�	-�	-��J��!�
!��:�,�
�!>�>�>�%)�N�N�!���7�7�)-�� �!�
��

-��n�Z�0���:��-�-��M�M�#�&�&�&�&�*-�F�:�&�&���
�
�
���
�����
s�
B�
B�Bc��|j}g}|jj���D]�\}}	|�|||f���$#t
$rT|jtur|j}n$|jturd}n|jturi}nY�h|�||f��Y��wxYwt|��|_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.
        rtN)r�r�r�r�r�rWr�rrr�r�r�)r1r��
new_argumentsr�r��vals      r{�apply_defaultszBoundArguments.apply_defaults;s����N�	��
��?�5�;�;�=�=�	2�	2�K�D�%�

2��$�$�d�I�d�O�%<�=�=�=�=���
2�
2�
2��=��.�.��-�C�C��Z�?�2�2��C�C��Z�<�/�/��C�C��H��$�$�d�C�[�1�1�1�1�1�
2�����m�,�,����s�A�AB*�B*�)B*c��||urdSt|t��stS|j|jko|j|jkSr})rurr~r]r�rs  r{r�zBoundArguments.__eq__WsJ���5�=�=��4��%��0�0�	"�!�!���%�/�1�2���%�/�1�	3r}c�:�|d|_|d|_dS)Nr�r��r�r�rks  r{rmzBoundArguments.__setstate___s����-����{�+����r}c� �|j|jd�S)Nr�r�r�s r{�__getstate__zBoundArguments.__getstate__cs��"�o�D�N�K�K�Kr}c��g}|j���D].\}}|�d�||�����/d�|jjd�|����S)Nz{}={!r}z	<{} ({})>r)r�r�r�rr/r-r<)r1r�r/rzs    r{rlzBoundArguments.__repr__fsr�����.�.�.�0�0�	6�	6�J�C���K�K�	�(�(��e�4�4�5�5�5�5��!�!�$�.�"9�4�9�9�T�?�?�K�K�Kr}N)r-rpr'r,r+r�r�r]r�r�r�r�rmr�rlrtr}r{rr�
s��������� ;�I�$�$�$�����X������X��,����X��:-�-�-�83�3�3�,�,�,�L�L�L�L�L�L�L�Lr}rc���eZdZdZdZeZeZe	Z
de	dd�d�Zeddddd�d	���Z
ed
���Zed���Zeed�d
�Zd�Zd�Zd�Zdd�d�Zd�Zd�Zd�Zd�Zd�Zd�ZdS)raA 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�_parametersNTr3c�4�|�t��}n�|r�t��}t}d}|D]�}|j}|j}	||kr1d}
|
�|j|j��}
t
|
���||kr|}|ttfvr$|jtur|rd}
t
|
���nd}|	|vr$d�|	��}
t
|
���|||	<��ntd�|D����}tj|��|_||_
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}c3�(K�|]
}|j|fV��dSr�r�rxr�s  r{r�z%Signature.__init__.<locals>.<genexpr>�s)����$Q�$Q�U�e�j�%�%8�$Q�$Q�$Q�$Q�$Q�$Qr})rfr�rr�rrZr�r�r�rr��MappingProxyTyper�r�)r1r�r�r4r��top_kind�seen_defaultr�rr�r9s           r{r�zSignature.__init__�sY���� �]�]�F�F�&�&
R�$����+��$��'�)�)�E� �:�D� �:�D��h���(��"�j�j��)=�)-�)9�;�;��(��o�o�-�����#'��� 0�2H�I�I�I� �=�F�2�2�+�6�'1��&0��o�o� 5�6�,0�L��v�~�~�>�E�E�d�K�K��(��o�o�-�#(�F�4�L�L�?)�B%�$Q�$Q�j�$Q�$Q�$Q�Q�Q�� �1�&�9�9���"3����r}F��follow_wrappedrirjrkc�,�t||||||���S)z3Constructs Signature for the given callable object.)r�r�rirjrk)r�)r�r�r�rirjrks      r{rJzSignature.from_callable�s.��(��C�>L�07��QY�[�[�[�	[r}c��|jSr�)r�r�s r{r�zSignature.parameters�rrr}c��|jSr��r�r�s r{r�zSignature.return_annotation�s���&�&r})r�r�c��|tur|j���}|tur|j}t	|��||���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�r�r�r�r~)r1r�r�s   r{r�zSignature.replace�sZ��������/�/�1�1�J���%�%� $� 7���t�D�z�z�*�,=�?�?�?�	?r}c��td�|j���D����}d�|j���D��}|||jfS)Nc3�:K�|]}|jtk�|V��dSr�)rr�r�s  r{r�z(Signature._hash_basis.<locals>.<genexpr>�s:����=�=�� %�
�m� ;� ;�� ;� ;� ;� ;�=�=r}c�>�i|]}|jtk�|j|��Srt)rr�r�r�s  r{r|z)Signature._hash_basis.<locals>.<dictcomp>�s5��H�H�H�E�+0�:��+F�+F��j�%�+F�+F�+Fr})r�r�r�r�)r1r��
kwo_paramss   r{�_hash_basiszSignature._hash_basis�s|���=�=�$�/�*@�*@�*B�*B�=�=�=�=�=��H�H�T�_�5K�5K�5M�5M�H�H�H�
��z�4�#9�9�9r}c��|���\}}}t|�����}t|||f��Sr�)r��	frozensetr�rz)r1r�r�r�s    r{r{zSignature.__hash__�sJ��04�0@�0@�0B�0B�-��
�-��z�0�0�2�2�3�3�
��V�Z�):�;�<�<�<r}c��||urdSt|t��stS|���|���kSr})rurr~r�rs  r{r�zSignature.__eq__�sK���5�=�=��4��%��+�+�	"�!�!����!�!�U�%6�%6�%8�%8�8�8r}�r�c	��i}t|j�����}d}t|��}		t|��}	t|��}	|	jt
tfvrtd��d�|	jtkr1|g}
|
�	|��t|
��||	j<�nQ|	j|vr9|	jtkr)td�
|	j�����d�|||	j<�n#t$rtd��d�wxYw#t$r�	t|��}	|	jtkrYn�|	j|vrB|	jtkr-d}|�
|	j���}t|��d�|	f}Ynn|	jt
ks|	jt ur|	f}YnK|r|	f}YnDd}|�
|	j���}t|��d�#t$rYYn
wxYwwxYw���d}t#j||��D]�}	|	jt
kr|	}�|	jtkr�&|	j}
	|�|
��}|	jtkr(td�
|	j������|||
<��#t($rG|sB|	jtkr2|	jt ur$td�
|
�����d�Y��wxYw|rJ|�|||j<n=td	�
tt|����������|�||��S)
z#Private method. Don't use directly.rtTztoo many positional argumentsNz$multiple values for argument {arg!r})r/zA{arg!r} parameter is positional only, but was passed as a keywordz$missing a required argument: {arg!r}z*got an unexpected keyword argument {arg!r})r�r�r�rxrr�r�r�r�r�r�r�r�r�
StopIterationr�rry�chainr;rW�_bound_arguments_cls)r1r�r�r�r�r��
parameters_ex�arg_vals�arg_valr�r�r9�kwargs_paramr�s              r{�_bindzSignature._bind�s���	��$�/�0�0�2�2�3�3�
��
���:�:��F	4�C
4��x�.�.��R4� ��,�,�E��z�l�M�%B�B�B�(�;�=�=�BF�G��z�_�4�4�#*����
�
�h�/�/�/�05�f�
�
�	�%�*�-���z�V�+�+��
�>N�0N�0N�'�B�I�I�$)�J�J�0�0�1�1�6:�;�-4�I�e�j�)�)��/%�O�O�O�#�$C�D�D�$�N�O�����U!�%
;�%
;�%
;�#;� ��,�,�E��z�_�4�4�����v�-�-� �:�)9�9�9�#@�C�"%�*�*���*�"<�"<�C�"+�C�.�.�d�:�).��
����*��4�4�05�
�V�0K�0K�*/��
���#�;�-2�H�M�!�E�"H�C�"%�*�*���*�"<�"<�C�"+�C�.�.�d�:��C%�����E�E�����	%
;����F	4�T���_�]�J�?�?�"	0�"	0�E��z�\�)�)�$����z�_�,�,����J�
0� �*�*�Z�0�0���:�!1�1�1�$�%B�$*�F�u�z�F�$:�$:�<�<�<�)0�	�*�%�%��'�
F�
F�
F�
 �F�E�J�/�$A�$A�49�M�V�4K�4K�#�$J�$*�F�z�F�$:�$:�<�<�AE�F���
F����*�	1��'�/5�	�,�+�,�,��@�G�G� ��f���.�.�H�0�0�1�1�1��(�(��y�9�9�9sg�D-�D�D*�-
H
�8G;�H
�A	H
�$!H
�H
�-H
�;
H	�H
�H	�	H
�J*�*AK;�:K;c�.�|�||��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��r1r�r�s   r{�bindzSignature.bindvs��
�z�z�$��'�'�'r}c�2�|�||d���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.
        Tr�r�r�s   r{r�zSignature.bind_partial}s��
�z�z�$���z�5�5�5r}c�~�t|��t|j�����fd|jifS�Nr�)r~r�r�r�r�r�s r{rizSignature.__reduce__�s?���T�
�
��t�'�.�.�0�0�1�1�3�%�t�'>�?�A�	Ar}c� �|d|_dSr�r�rks  r{rmzSignature.__setstate__�s��"'�(<�"=����r}c�B�d�|jj|��S)Nz<{} {}>rxr�s r{rlzSignature.__repr__�s������� 7��>�>�>r}c�D�g}d}d}|j���D]�}t|��}|j}|tkrd}n|r|�d��d}|tkrd}n$|tkr|r|�d��d}|�|����|r|�d��d�d�	|����}|j
tur,t|j
��}|d�|��z
}|S)NFTr�rz({})rz -> {})
r�r�rvrr�r�r�r�rr<r�rr&)	r1r
�render_pos_only_separator�render_kw_only_separatorr�rvr�rendered�annos	         r{r]zSignature.__str__�sC����$)�!�#'� ��_�+�+�-�-�	%�	%�E��E�
�
�I��:�D��'�'�'�,0�)�)�*�
2��
�
�c�"�"�"�,1�)���&�&�,1�(�(���&�&�+C�&��
�
�c�"�"�"�,1�(��M�M�)�$�$�$�$�$�	�
�M�M�#�����=�=����6�!2�!2�3�3���!��/�/�#�D�$:�;�;�D������-�-�-�H��r}r�)r-rpr'r,r+rrrr�rr�r�rrJr�r�r�r�r�r�r{r�r�r�r�rirmrlr]rtr}r{rrms���������,6�I��N�)���E�24�V�)-�24�24�24�24�24�h�%)�4��u�[�[�[�[��[�[�� � ��X� ��'�'��X�'�%*�U�
?�
?�
?�
?�
?�:�:�:�=�=�=�
9�9�9�.3�A:�A:�A:�A:�A:�F(�(�(�6�6�6�A�A�A�
>�>�>�?�?�?�+�+�+�+�+r}rr�c�@�t�|||||���S)z/Get a signature object for the passed callable.r�)rrJ)r�r�rirjrks     r{r]r]�s-���"�"�3�~�+2�6�H�#�V�V�Vr}c��ddl}ddl}|���}|�dd���|�dddd	�
��|���}|j}|�d��\}}}	|j|��x}}	no#t$rb}
d�	|t|
��j|
��}t|tj�
��tjd��Yd}
~
nd}
~
wwxYw|r,|�d��}|	}|D]}
t#||
��}�|	jtjvr/tdtj�
��tjd��|j�r?td�	|����td�	t)|	������td�	|	j����||	urltd�	t-|	j������t1|	d��r'td�	|	j����nF	t5|��\}}td�	|����n#t$rYnwxYwtd��dStt7|����dS)z6 Logic for inspecting an object given at command line rbNr�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��:zFailed to import {} ({}: {}))rxr�r%z#Can't get info for builtin modules.r7z
Target: {}z
Origin: {}z
Cached: {}z
Loader: {}�__path__zSubmodule search path: {}zLine: {}r6)�argparserR�ArgumentParser�add_argument�
parse_argsr��	partition�
import_modulerrr~r-�printr��stderr�exitr(r�builtin_module_names�detailsrD�
__cached__r	r`r�r�r%rC)r�rR�parserr��target�mod_name�	has_attrs�attrsr�r�rr9�parts�part�__r�s                r{�_mainr��s����O�O�O�����
�
$�
$�
&�
&�F�
����9��:�:�:�����k�,�
H��J�J�J������D�
�[�F�!'�!1�!1�#�!6�!6��H�i���.�y�.�x�8�8�8��f�f������,�3�3�H�48��I�I�4F�47�9�9��	�c��
�#�#�#�#���������������������%����C� � �����	%�	%�D��#�t�$�$�C�C�
��#�2�2�2�
�3�#�*�E�E�E�E��������|��
�l�!�!�&�)�)�*�*�*�
�l�!�!�-��"7�"7�8�8�9�9�9�
�l�!�!�&�"3�4�4�5�5�5��&�=�=��,�%�%�d�6�+<�&=�&=�>�>�?�?�?��v�z�*�*�
K��1�8�8���I�I�J�J�J��
1�'��_�_�
��F��j�'�'��/�/�0�0�0�0���
�
�
���
����
	�d������
�i��n�n�����s+�B�
D�AC<�<D�%J�
J'�&J'rEr�)F)r7)rt)T)TNNF)�r,�
__author__�__all__r�r�r��collections.abcr��enum�importlib.machineryrRryrjrOr�r�r�r�r�r�rr�keywordrc�operatorrdrerfri�mod_dict�COMPILER_FLAG_NAMESr�r�r�r r)rZrLrWrXrPr�rVrUrRr�rTrOrIrHrSrNrJr\rQrMrKrYr[rGr�r=r>rr"rAr`rFr)r3r5r#r6r@rDr*rsrvr?rr�NodeVisitorr�r%r2rrr.rErCrar0rr+rr8rr,r&r'rvr(r,r:r/rr1r_r!rurrr7r<�_fieldsr�rrBr;r$r^r_r�r�r�r�r�r�r�r-rrrrr:r9rr	r
rr4r3�WrapperDescriptorTyper�rr�r�r�r�r�r�r�r�r.r1rAr�r�r�r�IntEnumrVr#r�r$r�r&r�r'r�r)r�rrrr]r�r-rtr}r{�<module>r�sk����@9�
�a�a�a��H�
�
�
�
�
�
�
�
�
�
�
���������������������	�	�	�	�	�	�	�	�
�
�
�
���������������������������������/�/�/�/�/�/�/�/��7�9�9���#�)�)�+�+���D�A�q��H�U�Q�Y����q�(���%)���p�p�p�p�p�h0�0�0�$�$�$�0�0�0�A�A�A�(?�?�?��7�5�(�)�)��>�>�>�>�����7�5�(�)�)��>�>�>�>����2�2�2�	,�	,�	,�-�-�-�-�-�-�3�3�3�8�8�8�3�3�3�"3�3�3�;�;�;�3�3�3�/�/�/�.�.�.�29�9�9�7�7�7�(�(�(����0(�(�(�T3�3�3�3�
:�:�:�:�
�J�{�$E�F�F�	�p�p�p�h���������@0�0�0�
���<�<�<�|���& � � �:,�,�,�8
�
�
����28�8�8�8��
���,�,�,�,�^	�	�	�	�	�)�	�	�	������3�?����>B0�B0�B0�H+%�+%�+%�Z"�!�!�!�!��!�!�!�4�4�4�4�4�4�4�4�l	$�	$�	$�0�0�0�*������+�+�+�+�6
�J�{�$:�;�;�	�8�8�8�8�j��M�O�O��Z<�Z<�Z<�z�*�Y� >�
?�
?��9�9�9��������"�"9�"9� 8� 8� ?� ?�	(�(�(�(�.7�7�7� D�D�D�*:�:�:�x�j��(L�M�M��14�14�14�j�Z��&S�
T�
T�
�
-�
-�
-�
-�
-�
�
-�
-�
-�7�7�7�O�O�O�)A�)A�)A�)A�V���
�Z��j�9�3D�&D�
E�
E�
�
@�
@�
@�
@�
@�
�
@�
@�
@���������C�C�C�5�5�5�5�6�6�6�6�
�F�H�H�	�3�3�3�4�4�4����������'0�-�-�-�-�d�����
�
�
����$���&����!�������$
�
�
�$"�7�!�3�!�;�!�5�7�����$I?�I?�I?�I?�X*�*�*�4	#�	#�	#�G�G�G�2EA�EA�EA�PL8�L8�L8�L8�^
<�
<�
<�
<� 8<�AF�\9�\9�\9�\9�~+�+�+�48�,0�%)�$(�&+�gP�gP�gP�gP�gP�T<�<�<�<�<�<�<�<�A�A�A�A�A�A�A�A������T�\����"*�9��)�?��)�8��)�6�
�)�5��[7�[7�[7�[7�[7�[7�[7�[7�|L�L�L�L�L�L�L�L�DM�M�M�M�M�M�M�M�`
&*�4��u�V�V�V�V�V�7�7�7�t�z���	�E�G�G�G�G�G��r}

?>