Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/pylint/checkers/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/pylint/checkers/__pycache__/utils.cpython-311.pyc

�

�܋f5��	�dZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZddlmZmZddlmZddlmZmZmZmZddlZddlZdd	lmZmZmZdd
lmZddl m!Z!ddl"m#Z#dd
l$m%Z%m&Z&erddlm'Z'ddl(m)Z)edej*���Z+edd���Z,ee,e+gdfZ-ej.ej/ej0ej1fZ2dZ3ddhZ4hd�Z5e6hd���Z7e6hd���Z8dZ9dZ:dZ;dZ<dZ=dZ>d Z?d!Z@d"ZAd#d$d%d&d'd(d)d*�ZBd+�eB�C��D��ZDeEeD��ZFe6d,��ZGhd-�ZHe6hd.���ZIGd/�d0eJ��ZKGd1�d2eJ��ZL�d&d7�ZM�d'd9�ZN�d&d:�ZO�d(d<�ZPejQ�R��Zd=ZS�d&d>�ZT�d)dA�ZU�d*dE�ZV�d+dG�ZW�d,dI�ZX�d-�d.dJ�ZY�d&dK�ZZ�d/dN�Z[�d&dO�Z\�d0dP�Z]�d1dR�Z^�d2dU�Z_�d2dV�Z`GdW�dXeJ��ZaGdY�dZeJ��Zb�d3d]�Zc�d4d_�Zd�d5da�Ze�d6dc�Zf�d7de�Zg�d8dg�Zh�d9dj�Zi�d:dl�Zj	�d;�d<ds�Zk�d=du�Zl�d>dz�Zm�d(d{�Zn�d?d}�Zo�d&d~�Zp�d&d�Zq�d&d��Zr�d@d��Zs�dAd��Zt�dBd��Zued�����	�d-�dCd����Zv�dDd��Zw�dDd��Zx�d&d��Zy�dEd��ZzeJf�dFd��Z{�dGd��Z|eJf�dHd��Z}eJf�dId��Z~�dJd��ZeJf�dKd��Z��dLd��Z��dMd��Z��d&d��Z��dNd��Z��dNd��Z��dNd��Z��dNd��Z��dNd��Z��dNd��Z��dNd��Z��d)d��Z��d&d��Z��dOd��Z��dP�dQd��Z��dNd��Z��dNd��Z��dRd��Z��dSd��Z��dSd��Z��dTd��Z�ed�����	�d-d�d���dUdĄ��Z�edŬ���	�d-�dVdDŽ��Z�	�d-�dWdɄZ��d&dʄZ��dXd̄Z��d(d̈́Z��dYdτZ��d(dЄZ��dZd҄Z��d&dӄZ��d[dԄZ��d&dՄZ��d\d؄Z�ed������d&dل��Z��d]dۄZ��d^d܄Z�	�d-�d_d݄Z��dLdބZ��d`d�Z��dLd�Z��dad�Z��dbd�Z��dcd�Z��ddd�Z��ded�Z��ded�Z��d&d�Z��d&d�Z��dfd�Z��dfd��Z��d(d��Z��dgd��Z��dgd��Z��dgd��Z��d&d��Z��d&d��Z��dhd��Z��di�d�Z��d&�d�Z��dj�d�Z�e���dk�d���Z��dl�d�Z��dm�d�Z��d&�d�Z��dn�d�Z��do�d�Zdp�d�ZÐd&�d�ZĐdq�d�ZŐdr�d�ZƐds�d�Zǐdt�d �ZȐdu�d#�Zɐdv�d%�Z�dS(wz7Some functions that may be useful for various checkers.�)�annotationsN)�deque)�Iterable�Iterator)�	lru_cache�partial)�Match)�
TYPE_CHECKING�Any�Callable�TypeVar)�TooManyLevelsError�nodes�util)�InferenceContext)�AstroidError)�
ImportNode)�InferenceResult�SuccessfulInferenceResult)�_lru_cache_wrapper)�BaseChecker�_NodeT)�bound�	_CheckerTr�builtins�abc�_py_abc>�abc.abstractmethod�abc.abstractproperty�abc.abstractclassmethod�abc.abstractstaticmethod>�	.Protocol�typing.Protocol�typing_extensions.Protocol>�*�&�+�^�|�__iter__�	__aiter__�__next__�__getitem__�__class_getitem__�__setitem__�__delitem__�__contains__�keys)�__new__�__init__�__call__�__init_subclass__)$�__del__�__repr__�__str__�	__bytes__�__hash__�__bool__�__dir__�__len__�__length_hint__r*�__reversed__�__neg__�__pos__�__abs__�
__invert__�__complex__�__int__�	__float__�	__index__�	__trunc__�	__floor__�__ceil__�	__enter__�
__aenter__�__getnewargs_ex__�__getnewargs__�__getstate__�
__reduce__�__copy__�__unicode__�__nonzero__�	__await__r+�	__anext__�
__fspath__�__subclasses__)>�
__format__�__lt__�__le__�__eq__�__ne__�__gt__�__ge__�__getattr__�__getattribute__�__delattr__�
__delete__�__instancecheck__�__subclasscheck__r-�__missing__r0r1�__add__�__sub__�__mul__�__truediv__�__floordiv__�
__rfloordiv__�__mod__�
__divmod__�
__lshift__�
__rshift__�__and__�__xor__�__or__�__radd__�__rsub__�__rmul__�__rtruediv__�__rmod__�__rdivmod__�__rpow__�__rlshift__�__rrshift__�__rand__�__rxor__�__ror__�__iadd__�__isub__�__imul__�__itruediv__�
__ifloordiv__�__imod__�__ilshift__�__irshift__�__iand__�__ixor__�__ior__�__ipow__�__setstate__�
__reduce_ex__�__deepcopy__�__cmp__�
__matmul__�__rmatmul__�__imatmul__�__div__)�__setattr__�__get__�__set__r/�__set_name__)�__exit__�	__aexit__)�	__round__)�__pow__)Nr���)rr�)r�r�c�$�i|]
\}}|D]}||���S�r�)�.0�params�methods�names    �f/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/checkers/utils.py�
<dictcomp>r��sE�����������	
�	�&�����)&zbuiltins.tuplez
builtins.listz
builtins.dictzbuiltins.setzbuiltins.frozensetz
builtins.typezcollections.dequezcollections.defaultdictzcollections.OrderedDictzcollections.Counterzcollections.ChainMapz_collections_abc.Awaitablez_collections_abc.Coroutinez_collections_abc.AsyncIterablez_collections_abc.AsyncIteratorz_collections_abc.AsyncGeneratorz_collections_abc.Iterablez_collections_abc.Iteratorz_collections_abc.Generatorz_collections_abc.Reversiblez_collections_abc.Containerz_collections_abc.Collectionz_collections_abc.Callablez_collections_abc.Setz_collections_abc.MutableSetz_collections_abc.Mappingz_collections_abc.MutableMappingz_collections_abc.Sequencez _collections_abc.MutableSequencez_collections_abc.ByteStringz_collections_abc.MappingViewz_collections_abc.KeysViewz_collections_abc.ItemsViewz_collections_abc.ValuesViewz!contextlib.AbstractContextManagerz&contextlib.AbstractAsyncContextManagerz
re.Patternzre.Match>FNT>�nt._exit�sys.exit�posix._exit�_sitebuiltins.Quitterc��eZdZdS)�NoSuchArgumentErrorN��__name__�
__module__�__qualname__r�r�r�r�r����������Dr�r�c��eZdZdS)�InferredTypeErrorNr�r�r�r�r�r��r�r�r��node�nodes.NodeNG�return�boolc��tjdtd���td�|���D����S)z1Return whether the given node is inside a lambda.z�utils.is_inside_lambda will be removed in favour of calling utils.get_node_first_ancestor_of_type(x, nodes.Lambda) in pylint 3.0r���
stacklevelc3�JK�|]}t|tj��V��dS�N)�
isinstancer�Lambda)r��parents  r��	<genexpr>z#is_inside_lambda.<locals>.<genexpr>s.����T�T�F�z�&�%�,�/�/�T�T�T�T�T�Tr�)�warnings�warn�DeprecationWarning�any�node_ancestors�r�s r��is_inside_lambdar��sR���M�	O���	�����T�T�d�>Q�>Q�>S�>S�T�T�T�T�T�Tr��Iterable[nodes.NodeNG]c#�K�t|tjtjf��r!|jD]}t|��Ed{V���dS|V�dS)z9Recursively returns all atoms in nested lists and tuples.N)r�r�Tuple�List�elts�get_all_elements)r��childs  r�r�r�sp�����$���e�j�1�2�2���Y�	/�	/�E�'��.�.�.�.�.�.�.�.�.�.�	/�	/��
�
�
�
�
r�c�n�t|dd��dkr|���jdkrdSdS)zDReturn True if the node is referencing the "super" builtin function.r�N�superrTF)�getattr�rootr�r�s r��is_superr�s8���t�V�T�"�"�g�-�-�$�)�)�+�+�2B�j�2P�2P��t��5r��nodes.FunctionDefc�|�t|j��dko$t|jdtj��S)z@Return true if the given function node only raises an exception.r�r)�len�bodyr�r�Raiser�s r��is_errorr�s,���t�y�>�>�Q��H�:�d�i��l�E�K�#H�#H�Hr�)�__builtins__c�@�|o|���jdkS)zHReturns True if the given node is an object from the __builtin__ module.r)r�r�r�s r��is_builtin_objectr�"s���2�D�I�I�K�K�$�
�2�2r�r��strc�&�|tvp|tvS)zIReturn true if <name> could be considered as a builtin defined by python.)r�SPECIAL_BUILTINS)r�s r��
is_builtinr�'s���8��7�t�'7�7�7r��var_node�varname�scopec�(�t|||��duSr�)�defnode_in_scope)r�r�r�s   r��is_defined_in_scoper�,s��
�H�g�u�5�5�T�A�Ar��nodes.NodeNG | Nonec���t|tj��r�|jD]x}t|tj��r
||jvr|cSt|tj��r5|jD]-}t|tj��r|j	|kr|ccS�.�y�n�t|ttjf��r3|�tj��D]}|j	|kr|cS��nvt|tj
��rQ|jD]G\}}|�|��rn,|r)t|tj��r|j	|kr|cS�H�nt|tjtjf��r�|j�|��rf|j�|��rJ	|j�|��|j}t-|||��}|S#t.j$rYnwxYw|St3|dd��|kr|SnMt|tj��r3t|j	tj��r|j	}|j	|kr|SdS)Nr�)r�r�Ifr��Nonlocal�names�Assign�targets�
AssignNamer��COMP_NODE_TYPES�For�nodes_of_class�With�items�	parent_ofr��FunctionDef�args�is_argument�
default_valuer�r��astroid�	NoDefaultr��
ExceptHandler)	r�r�r�r��target�ass_node�expr�ids�defnodes	         r�r�r�5s���
�%���"�"�' ��J�	&�	&�D��$���/�/�
�G�t�z�4I�4I������$���-�-�
&�"�l�&�&�F�!�&�%�*:�;�;�&���w�@V�@V�%�
�
�
�
�
���
	&�
�E�O�U�Y�7�	8�	8� ��,�,�U�-=�>�>�	 �	 �H��}��'�'�����(�	 �
�E�5�:�	&�	&� ���	�	�I�D�#��~�~�h�'�'�
����
�z�#�u�'7�8�8�
�S�X��=P�=P��
�
�
���	�E�E�L�%�*;�<�	=�	=� ��:�!�!�'�*�*�
	��z�#�#�H�-�-�
#�#��J�,�,�W�5�5�5�!�L�E�.�x��%�H�H�G�#�N���(�����D������L��5�&�$�'�'�7�2�2��L�3�	�E�5�.�	/�	/� ��e�j�%�"2�3�3�	 ��z�H��}��'�'����4s�72G+�+G=�<G=�
nodes.Namec�H�|j}|���D�]1}t|||��}|��|���}t	|t
tjfz��rRt	|tj��r5|���}||urt	|tj��rdSdS|j	|j	krdS|���D]i}|j	|j	kr�t	|tj
tjtjtj
tjtjf��rdS�j��3|�d���}|���}|j}	|r�|j|	kr�|�tj��D]}
|
j|krdS�|�tjtjf��D]}|d�|jD��vrdS�|���}|r|j|	k��dS)aRCheck if the given variable node is defined before.

    Verify that the variable node is defined by a parent node
    (e.g. if or with) earlier than `var_node`, or is defined by a
    (list, set, dict, or generator comprehension, lambda)
    or in a previous sibling node on the same line
    (statement_defining ; statement_using).
    NFT��futurec�.�g|]}|dp|d��S)r�rr�)r�r�s  r��
<listcomp>z%is_defined_before.<locals>.<listcomp>�s%��I�I�I�$�4��7�-�d�1�g�I�I�Ir�)r�r�r�r�r�r�rr�r��linenor��Whiler��	TryExcept�
TryFinallyr��	statement�previous_sibling�
fromlinenor�r��
ImportFrom�Importr�)r�r�r�r�
defnode_scope�var_node_scope�defnode_anc�stmt�_noder�assign_node�imp_nodes            r��is_defined_beforeresP���m�G��)�)�+�+� � ��"�8�W�f�=�=���?���
�
���
��m�_����%F�G�G�		��-��):�;�;�
!�!)���!1�!1��!��6�6�:�"�E�$5�<�<�6�!�5�5��4�4��>�H�O�+�+��4�4�"�1�1�3�3�	�	�K��!�X�_�4�4�����I��K��J��O��$��'�
�
�
�
��t�t�t�
�	� ���T��*�*�D��!�!�#�#�E�
�_�F�
�)�E�$��.�.� �/�/��0@�A�A�	�	�K���7�*�*��t�t�+��,�,�e�.>���-M�N�N�	�	�H��I�I�(�.�I�I�I�I�I��t�t�J��&�&�(�(���)�E�$��.�.��5r�c���|s����}t|tjtjf��rNtj|jjd�|jj	D����}t�fd�|D����SdS)zcReturn true if the given Name node is used in function or lambda
    default argument's value.
    c3�K�|]}|�|V��	dSr�r�)r��ds  r�r�z&is_default_argument.<locals>.<genexpr>�s"����!U�!U��q�}�!�}�}�}�}�!U�!Ur�c3�d�K�|]*}|�tj��D]}|�uV��	�+dSr��r�r�Name)r��default_node�default_name_noder�s   �r�r�z&is_default_argument.<locals>.<genexpr>�sc�����
�
��%1�%@�%@���%L�%L�
�
�"�
��%�
�
�
�
�
�
�
r�F)r�r�rr�r��	itertools�chainr��defaults�kw_defaultsr�)r�r��all_defaultss`  r��is_default_argumentr&�s�������
�
�����%�%�+�U�\�:�;�;�
� ���J��!U�!U�U�Z�-C�!U�!U�!U�
�
���
�
�
�
� ,�
�
�
�
�
�	
��5r�c���|���D]Y}t|tj��rdS|js1t|tjtjtjf��rn�ZdS)z6Return true if the name is used in function decorator.TF)r�r�r�
Decorators�is_statementr��ComprehensionScope�ListComp�r�r�s  r��is_func_decoratorr-�s����%�%�'�'�����f�e�.�/�/�	��4�4���	�*�����(���
�#
�#
�	�
�E�	��5r��frame�nodes.ClassDefc�|��t|tj��sdSt�fd�|jD����S)zkReturn whether `frame` is an astroid.Class node with `node` in the
    subtree of its bases attribute.
    Fc3�Z�K�|]%}�|�tj��vV��&dSr�r)r��baser�s  �r�r�z#is_ancestor_name.<locals>.<genexpr>�s8�����O�O�4�t�t�*�*�5�:�6�6�6�O�O�O�O�O�Or�)r�r�ClassDefr��bases)r.r�s `r��is_ancestor_namer5�sC����e�U�^�,�,���u��O�O�O�O�5�;�O�O�O�O�O�Or�c�\�t|jtj��o
|jj|uS)z@Return True if node is the function being called in a Call node.)r�r�r�Call�funcr�s r��is_being_calledr9�s%���d�k�5�:�.�.�K�4�;�3C�t�3K�Kr�c���|rkt|tjtjtjf��r:|j}|r1t|tjtjtjf���:|S)zHReturn the higher parent which is not an AssignName, Tuple or List node.)r�rr�r�r�r�r�s r��
assign_parentr;�s^��
��:�d�U�%5�u�{�E�J�$O�P�P���{����:�d�U�%5�u�{�E�J�$O�P�P���Kr��
class_nodec��|���D]5}|jdkr�||vr#t||tj��rdS�6dS)zjReturn True if <name> is a method overridden from an ancestor
    which is not the base object class.
    �objectTF)�	ancestorsr�r�rr�)r<r��ancestors   r��overrides_a_methodrA�s]���(�(�*�*�����=�H�$�$���8���
�8�D�>�5�;L� M� M���4�4���5r��messages�VCallable[[AstCallbackMethod[_CheckerT, _NodeT]], AstCallbackMethod[_CheckerT, _NodeT]]c���d�fd�}|S)a�Decorator to store messages that are handled by a checker method as an
    attribute of the function object.

    This information is used by ``ASTWalker`` to decide whether to call the decorated
    method or not. If none of the messages is enabled, the method will be skipped.
    Therefore, the list of messages must be well maintained at all times!
    This decorator only has an effect on ``visit_*`` and ``leave_*`` methods
    of a class inheriting from ``BaseChecker``.
    r8�$AstCallbackMethod[_CheckerT, _NodeT]r�c����|_|Sr�)�checks_msgs)r8rBs �r��store_messagesz2only_required_for_messages.<locals>.store_messages�s���$����r�)r8rEr�rEr�)rBrHs` r��only_required_for_messagesrI�s)����������r�c�L�tjdtd���t|�S)z�Kept for backwards compatibility, deprecated.

    Use only_required_for_messages instead, which conveys the intent of the decorator much clearer.
    zhutils.check_messages will be removed in favour of calling utils.only_required_for_messages in pylint 3.0r�r�)r�r�r�rI)rBs r��check_messagesrK�s5��
�M�	9���	����&�x�0�0r�c��eZdZdZdS)�IncompleteFormatStringz:A format string ended in the middle of a format specifier.N)r�r�r��__doc__r�r�r�rMrMs������D�D�D�Dr�rMc�$��eZdZdZd�fd�Z�xZS)�UnsupportedFormatCharacterz]A format character in a format string is not one of the supported
    format characters.
    �index�intr��Nonec�X��t���|��||_dSr�)r�r4rQ)�selfrQ�	__class__s  �r�r4z#UnsupportedFormatCharacter.__init__s&���
�����������
�
�
r�)rQrRr�rS)r�r�r�rNr4�
__classcell__)rVs@r�rPrPsG������������������r�rP�
format_string�/tuple[set[str], int, dict[str, str], list[str]]c���t��}i}g}d}d�fd�}d}|t���k�r��|}|dk�r~||��\}}d}|d	krRd
}	||��\}}|}
|	dkr+|d	kr|	d
z
}	n|dkr|	d
z}	||��\}}|	dk�+|d
z
}�|
|�}|dvr||��\}}|dv�|d
kr|d
z
}||��\}}n*|tjvr||��\}}|tjv�|dkrR||��\}}|d
kr|d
z
}||��\}}n*|tjvr||��\}}|tjv�|dvr||��\}}d}||vrt	|���|r|�|��|||<n |dkr|d
z
}|�|��|d
z
}|t���k���||||fS)a)Parses a format string, returning a tuple (keys, num_args).

    Where 'keys' is the set of mapping keys in the format string, and 'num_args' is the number
    of arguments required by the format string. Raises IncompleteFormatString or
    UnsupportedFormatCharacter if a parse error occurs.
    r�irRr��tuple[int, str]c�V��|dz
}|t���krt�|�|fS)Nr�)r�rM)r[rXs �r��	next_charz&parse_format_string.<locals>.next_char+s5���	�Q�����M�"�"�"�"�(�(��=��#�$�$r��%N�(r��)z#0- +r%�.�hlLzdiouxXeEfFgGcrs%a)r[rRr�r\)�setr��string�digitsrP�add�append)
rXr2�	key_types�	pos_types�num_argsr^r[�char�key�depth�	key_start�key_end�flagss
`            r��parse_format_stringrrs�����5�5�D��I��I��H�%�%�%�%�%�%�	
�A�
�c�-� � �
 �
 ��Q����3�;�;��i��l�l�G�A�t��C��s�{�{���#�)�A�,�,���4��	��q�j�j��s�{�{���
���������
��'�i��l�l�G�A�t��q�j�j��a�%��#�I�g�$5�6���'�/�/�#�)�A�,�,���4��'�/�/��s�{�{��A�
��#�)�A�,�,���4�4��f�m�+�+�'�i��l�l�G�A�t��f�m�+�+��s�{�{�#�)�A�,�,���4��3�;�;���M�H�'�i��l�l�G�A�t�t��&�-�/�/�"+�)�A�,�,���4��&�-�/�/��u�}�}�#�)�A�,�,���4�'�E��5� � �0��3�3�3��
'�����
�
�
�!%�	�#��������A�
��� � ��&�&�&�	�Q���g�c�-� � �
 �
 �h��9�i�/�/r��&tuple[str, Iterable[tuple[bool, str]]]c�n�	tj|��S#t$r}t��|�d}~wwxYwr�)�_string�formatter_field_name_split�
ValueErrorrM)rX�es  r��split_format_field_namesryisE��.��1�-�@�@�@���.�.�.�$�&�&�A�-�����.���s��
4�/�4�Iterable[str | None]c#�K�tj��}	|�|��}|D]O}td�|dd�D����r�$|d}|d}|V�|rt	|��Ed{V���PdS#t
$rC}|jd�d��rdV�dV�Yd}~dSt|��|�d}~wwxYw)	zyGiven a format string, return an iterator
    of all the valid format fields.

    It handles nested fields as well.
    c3�K�|]}|duV��	dSr�r�)r��items  r�r�z(collect_string_fields.<locals>.<genexpr>}s&����7�7�D�4�4�<�7�7�7�7�7�7r�r�Nr�rzcannot switch from manual��1)	re�	Formatter�parse�all�collect_string_fieldsrwr��
startswithrM)rX�	formatter�
parseiterator�resultr��nested�excs       r�r�r�rs"����� �"�"�I�=�!���
�6�6�
�#�	9�	9�F��7�7�F�1�2�2�J�7�7�7�7�7�
���!�9�D��A�Y�F��J�J�J��
9�0��8�8�8�8�8�8�8�8�8��	9�	9���=�=�=��8�A�;�!�!�"=�>�>�		��H�H�H��I�I�I��F�F�F�F�F�$�]�3�3��<�����=���s�A'B�
C
�
(C�8C�C
�9tuple[list[tuple[str, list[tuple[bool, str]]]], int, int]c�2�g}d}t��}t|��D]�}|rDt|�����r#|�t|�����H|r�t|��\}}t
|tj��r"|�t|����	|�	|t|��f����#t$r}t��|�d}~wwxYw|dz
}��||t|��fS)agParses a PEP 3101 format string, returning a tuple of
    (keyword_arguments, implicit_pos_args_cnt, explicit_pos_args).

    keyword_arguments is the set of mapping keys in the format string, implicit_pos_args_cnt
    is the number of arguments required by the format string and
    explicit_pos_args is the number of arguments passed with the position.
    rNr�)rdr�r��isdigitrgryr��numbers�Numberrh�listrwrMr�)rX�keyword_arguments�implicit_pos_args_cnt�explicit_pos_argsr��keyname�
fielditeratorrxs        r��parse_format_method_stringr��s4����������%�m�4�4�'�'���	'�C��I�I�%�%�'�'�	'��!�!�#�d�)�)�,�,�,�,�
�		'�%=�d�%C�%C�"�G�]��'�7�>�2�2�
4�!�%�%�c�'�l�l�3�3�3�
6�!�(�(�'�4�
�3F�3F�)G�H�H�H�H���
6�
6�
6�,�.�.�A�5�����
6����
"�Q�&�!�!��3�S�9J�5K�5K�K�Ks�;$C � 
C>�*C9�9C>�attrnamec�|�|ddko0|dko*|�d��o|�d��S)zkReturn True if attribute name is protected (start with _ and some other
    details), False otherwise.
    r�_�__)r��endswith)r�s r��is_attr_protectedr��sO��
	���s��	H���O�	H��$�$�T�*�*�F�x�/@�/@��/F�/F�G�r��nodes.ClassDef | Nonec�p�|�d���}tjtjtjf}|rzt
||��rjt
|tj��sP|j�dS|j�d���}|r*t
||��rt
|tj���P|S)z�Return the class that is wrapping the given node.

    The function returns a class for a method node (or a staticmethod or a
    classmethod), otherwise it returns `None`.
    TrN)	r.r�NodeNGr��
UnboundMethod�BaseInstancer�r3r�)r��klass�nodes_to_checks   r��node_frame_classr��s���
�J�J�d�J�#�#�E�
�������N�	�0��u�n�-�-�0��5�%�.�1�1�0�
�<���4���"�"�$�"�/�/��	�0��u�n�-�-�0��5�%�.�1�1�0��Lr��astroid.ClassDef�astroid.ClassDef | Nonec�t�|j�d���}t|tj��r|ndS)zFReturn the class that is the outer class of given (nested) class_node.TrN)r�r.r�r�r3)r<�parent_klasss  r��get_outer_classr��s7���$�*�*�$�*�7�7�L�%�l�G�4D�E�E�O�<�<�4�Or��Match[str] | Nonec�T�tjd��}|�|��S)zrCheck that attribute name is private (at least two leading underscores,
    at most one trailing underscore).
    z^_{2,10}.*[^_]+_?$)�re�compile�match)r��regexs  r��is_attr_privater��s&��
�J�+�,�,�E��;�;�x� � � r��	call_node�
nodes.Call�position�
int | None�keyword�
str | Nonec���|�|�td���|�	|j|S#t$rYnwxYw|r%|jr|jD]}|j|kr	|jcS�t�)aReturns the specified argument from a function call.

    :param nodes.Call call_node: Node representing a function call to check.
    :param int position: position of the argument.
    :param str keyword: the keyword of the argument.

    :returns: The node representing the argument, None if the argument is not found.
    :rtype: nodes.Name
    :raises ValueError: if both position and keyword are None.
    :raises NoSuchArgumentError: if no argument at the provided position or with
    the provided keyword.
    Nz2Must specify at least one of: position or keyword.)rwr��
IndexError�keywords�arg�valuer�)r�r�r�r�s    r��get_argument_from_callr��s�����G�O��M�N�N�N���	��>�(�+�+���	�	�	��D�	�����!�9�%�!��%�	!�	!�C��w�'�!�!��y� � � �"��s�$�
1�1�nodes.NodeNG | astroid.Instancec��t|d��r|���ng}td�tj|g|��D����S)zQReturn whether the given class node is subclass of
    exceptions.Exception.
    r?c3�lK�|]/}|jdvo!|���jtkV��0dS)>�	Exception�
BaseExceptionN)r�r��EXCEPTIONS_MODULE)r�r@s  r�r�z&inherit_from_std_ex.<locals>.<genexpr>sY������
�	�
�7�7�	6��M�M�O�O� �$5�5������r�)�hasattrr?r�r!r")r�r?s  r��inherit_from_std_exr�se��%,�D�+�$>�$>�F���� � � �B�I����"����	�:�:������r��handler�nodes.ExceptHandler�
error_type�9str | type[Exception] | tuple[str | type[Exception], ...]c���dd��t|t��s|f}�fd�|D��}|jsdS|�|��S)	amCheck if the given exception handler catches
    the given error_type.

    The *handler* parameter is a node, representing an ExceptHandler node.
    The *error_type* can be an exception, such as AttributeError,
    the name of an exception, or it can be a tuple of errors.
    The function will return True if the handler catches any of the
    given errors.
    �error�str | type[Exception]r�r�c�>�t|t��s|jS|Sr�)r�r�r�)r�s r��stringify_errorz&error_of_type.<locals>.stringify_errors!���%��%�%�	"��>�!��r�c�&��h|]
}�|����Sr�r�)r�r�r�s  �r��	<setcomp>z error_of_type.<locals>.<setcomp>#s#���F�F�F�%���u�-�-�F�F�Fr�F)r�r�r�r�)r��tuple�type�catch)r�r��expected_errorsr�s   @r��
error_of_typer�sl�������
�j�%�(�(�#� �]�
�F�F�F�F�:�F�F�F�O��<���u��=�=��)�)�)r�c��|jsdS|jjD]*}	t|��rdS�#tj$rY�'wxYwdS)z?Detect if the given function node is decorated with a property.FT)�
decoratorsr�_is_property_decoratorr��InferenceError)r��	decorators  r��decorated_with_propertyr�)sn���?���u��_�*���	�	�%�i�0�0�
��t�t�
���%�	�	�	��D�	�����5s�,�>�>�kindsc���t|tjtjf��sdS|jr5|jjD](}t|tj��r|j|vrdS�)dS)NFT)r�r�r�rr�r��	Attributer�)r�r�r�s   r��_is_property_kindr�6sq���d�W�2�E�4E�F�G�G���u������.�	�	�I��)�U�_�5�5�
�)�:L�PU�:U�:U��t�t���5r�c�"�t|d��S)z-Check if the given node is a property setter.�setter�r�r�s r��is_property_setterr�@s���T�8�,�,�,r�c�"�t|d��S)z.Check if the given node is a property deleter.�deleterr�r�s r��is_property_deleterr�Es���T�9�-�-�-r�c�$�t|dd��S)zACheck if the given node is either a property setter or a deleter.r�r�r�r�s r��is_property_setter_or_deleterr�Js���T�8�Y�7�7�7r�r�c��|���D�]i}t|tj��r]|���dvrdS|���D].}|jdkr!|���jdkrdS�/�zt|tj��r�t|�
����}t|��dkr�t|djtj
tjf��rpt|dj��}|rTt|t jj��r5t|jtj��rt)|j��cS��kdS)N>�builtins.property�functools.cached_propertyT�propertyrr�rF)�inferr�rr3�qnamer?r�r�r�r�� _get_return_nodes_skip_functionsr�r�rr��
safe_inferr��objects�Property�functionr�)r��inferredr@�returnss    r�r�r�Os{���O�O�%�%�F�F���h���/�/�	F��~�~���#U�U�U��t�t�$�.�.�0�0�
 �
 ���=�J�.�.�8�=�=�?�?�3G�:�3U�3U��4�4�4��
 ���%�"3�
4�
4�	F�+/��9�9�;�;�+�+�G��7�|�|�q� � �Z���
� �5�:�u��"?�&�&� �&�g�a�j�&6�7�7���F�"�8�W�_�-E�F�F�F�#�8�#4�e�6G�H�H�F�
3�8�3D�E�E�E�E�E���5r�r8�Pnodes.ClassDef | nodes.FunctionDef | astroid.BoundMethod | astroid.UnboundMethod�qnames�
Iterable[str]c�
��|jr|jjng}|D]i}t|tj��r|j}	t�fd�|���D����rdS�U#tj$rY�fwxYwdS)zMDetermine if the `func` node has a decorator with the qualified name `qname`.c3��K�|]?}|�t|tj���|j�vp|����vV��@dSr�)r�r�UninferableBaser�r�)r�r[r�s  �r�r�z!decorated_with.<locals>.<genexpr>ws[���������=��A�t�7K�)L�)L�=���&� �7�A�G�G�I�I��$7� �=�=�=��r�TF)	r�rr�r7r8r�r�r�r�)r8r�r��decorator_nodes `  r��decorated_withr�js����+/�/�A���&�&�r�J�$�����n�e�j�1�1�	1�+�0�N�	������'�-�-�/�/������
�
�t�t�
���%�	�	�	��H�	�����5s�-A.�.B�?B�nodes.Decorators�)list[nodes.Attribute | nodes.Name | None]c��g}t|dg��D�]v}d}t|tj��rnt	|j��}t|tj��r?|���dkr'|j�|jj	��\}}n7t|tj
��r|�|j	��\}}|s��|d}t|tjtj
f��s��t|j��}d|vo
|jdk}d|vot|dd��dk}	|s|	r@t	|��}|�t|t"j��r|�|����x|S)aReturn a list of uninferable `typing.final` decorators in `node`.

    This function is used to determine if the `typing.final` decorator is used
    with an unsupported Python version; the decorator cannot be inferred when
    using a Python version lower than 3.8.
    rN�typingr�finalr�)r�r�rr�r�r��Moduler��lookupr�rr�rr�dictr��modnamerr�rh)
r�r�r��import_nodesr�r��import_node�import_names�is_from_import�	is_imports
          r��uninferable_final_decoratorsr
�s����J��T�7�B�/�/�$-�$-�	�FJ���i���1�1�	?�!�)�.�1�1�H��(�E�L�1�1�
M�h�n�n�6F�6F�(�6R�6R�"+�.�"7�"7�	��8K�"L�"L���<���	�5�:�
.�
.�	?�'�.�.�y�~�>�>�O�A�|�
�	��"�1�o���+����8J�'K�L�L�	���K�-�.�.��"�\�1�V�{�7J�h�7V����-��7��z�4�4
�4
�
�4�	��	-�Y�	-�!�)�,�,�H���:�h��8L�#M�#M���!�!�)�,�,�,���r�i)�maxsize�is_abstract_cb�dict[str, nodes.FunctionDef]c�N�|�ttt���}i}	t|�����}n#t
j$ricYSwxYw|D]�}|���D]�}|}t|tj
��rNt|��}|s|j|vr||j=�At|tj
��s|j|vr||j=t|tj
��r+||��}|r|||j<��|s|j|vr||j=����|S)aXGet the unimplemented abstract methods for the given *node*.

    A method can be considered abstract if the callback *is_abstract_cb*
    returns a ``True`` value. The check defaults to verifying that
    a method is decorated with abstract methods.
    It will return a dictionary of abstract method
    names and their inferred objects.
    N)r�)rr��ABC_METHODS�reversed�mror��ResolveError�valuesr�rr�r�r�r�)r�r�visitedrr@�objr��abstracts        r��unimplemented_abstract_methodsr�sk���� ���D�D�D��,.�G���t�x�x�z�z�"�"����������	�	�	������*�*���?�?�$�$�	*�	*�C��H��#�u�/�0�0�
.�%�c�?�?����
�x�7�*�*�#�C�H�-��!�(�E�,=�>�>�.��x�7�*�*�#�C�H�-��(�E�$5�6�6�

*�*�>�(�3�3���*�(0�G�C�H�%�%�!�*�c�h�'�&9�&9����)��9	*�:�Ns�!A�A�A�,nodes.ExceptHandler | nodes.TryExcept | Nonec���|}tjtjf}|r3t|j|��s|j}|rt|j|���|rt|j|��r|jSdS)zDReturn the ExceptHandler or the TryExcept node in which the node is.N)rr�r
r�r�)r��current�ignoress   r��find_try_except_wrapper_noder�s����G��"�E�O�4�G�
�!�*�W�^�W�=�=�!��.���!�*�W�^�W�=�=�!���:�g�n�g�6�6���~���4r�c��|���D]B}t|tjj��rdSt|t
j��r|cS�CdS)zJReturn the ExceptHandler in which the node is, without going out of scope.N)r�r�r��scoped_nodes�LocalsDictNodeNGrr�)r�rs  r��!find_except_wrapper_node_in_scoper �sh���&�&�(�(�����g�w�3�D�E�E�	�
�4�4��g�u�2�3�3�	��N�N�N�	��4r�c�j�t|��}|sdSt|tj��r|jj}|jj}n5tj�	d�|jD����}|j}td�|D����}t|ttf��}|p|S)z8Check if the given node is from a fallback import block.Fc3�$K�|]}|jV��dSr�)r�)r�r�s  r�r�z)is_from_fallback_block.<locals>.<genexpr>s5����3
�3
�$�G�L�3
�3
�3
�3
�3
�3
r�c3�bK�|]*}t|tjtjf��V��+dSr�)r�rrr)r�rs  r�r�z)is_from_fallback_block.<locals>.<genexpr>sJ�������	�;��!1�5�<� @�A�A������r�)rr�rr�r�r��handlersr!r"�
from_iterabler��#_except_handlers_ignores_exceptions�ImportError�ModuleNotFoundError)r��context�
other_bodyr$�has_fallback_imports�ignores_import_errors      r��is_from_fallback_blockr-s���*�4�0�0�G����u��'�5�.�/�/�$��^�(�
��>�*����_�2�2�3
�3
�(/�(8�3
�3
�3
�
�
�
��#�����%�������?��;� 3�4���� �7�#7�7r�r$�
exceptions�3tuple[type[ImportError], type[ModuleNotFoundError]]c�f��tt|����t�fd�|D����S)N)r�c3�.�K�|]}�|��V��dSr�r�)r�r�r8s  �r�r�z6_except_handlers_ignores_exceptions.<locals>.<genexpr>%s+�����5�5��t�t�G�}�}�5�5�5�5�5�5r�)rr�r�)r$r.r8s  @r�r&r& s:����=�Z�8�8�8�D��5�5�5�5�H�5�5�5�5�5�5r��	exception�type[Exception] | str� list[nodes.ExceptHandler] | Nonec���t|��}t|tj��r�fd�|jD��SgS)aZReturn the collections of handlers handling the exception in arguments.

    Args:
        node (nodes.NodeNG): A node that is potentially wrapped in a try except.
        exception (builtin.Exception or str): exception or name of the exception.

    Returns:
        list: the collection of handlers that are handling the exception or None.
    c�4��g|]}t|����|��Sr�)r�)r�r�r2s  �r�rz*get_exception_handlers.<locals>.<listcomp>6s8���
�
�
��}�W�i�7X�7X�
��
�
�
r�)rr�rr
r$)r�r2r)s ` r��get_exception_handlersr7(s[���+�4�0�0�G��'�5�?�+�+�
�
�
�
�
�#*�#3�
�
�
�	
��Ir��Iterator[nodes.With]c#�tK�|���D] }t|tj��r|V��!dS)zFGet all contextlib.with statements in the ancestors of the given node.N)r�r�rr�)r��	with_nodes  r��get_contextlib_with_statementsr;<sI�����(�(�*�*���	��i���,�,�	��O�O�O���r��callc�z�t|t��s|j}|jD]�}t	|��}t|t
j��r|j|krdS�:t|t
j��rB|j	D]:}t	|��}t|t
j��r|j|krdS�;��dS)z7Check if the given node suppresses the given exception.TF)
r�r�r�r�r�rr3r�r�r�)r<r2r�r��elt�inferred_elts      r��_suppresses_exceptionr@Cs����i��%�%�'��&�	��y� � ���c�?�?���h���/�/�
	 ��}�	�)�)��t�t�*�
��%�+�
.�
.�	 ��}�
 �
 ��)�#�����|�U�^�<�<� �$�)�Y�6�6��4�4�4����5r�c#�0K�t|��D]�}|jD]y\}}t|tj��rZt|j��}t|tj��r,|���dkrt||��r|V��z��dS)a>Return the contextlib suppressors handling the exception.

    Args:
        node (nodes.NodeNG): A node that is potentially wrapped in a contextlib.suppress.
        exception (builtin.Exception): exception or name of the exception.

    Yields:
        nodes.With: A with node that is suppressing the exception.
    zcontextlib.suppressN)
r;r�r�rr7r�r8r3r�r@)r�r2r:r}r�r�s      r��get_contextlib_suppressorsrBYs�����4�D�9�9�	(�	(�	� ��	(�	(�G�D�!��$��
�+�+�
(�%�d�i�0�0���x���8�8�(� ���(�(�,A�A�A�,�T�9�=�=�(�'�����	(�	(�	(r��nodes.Raisec�T�t|��}t|tj��S)a
Check if the node is directly under a Try/Except statement
    (but not under an ExceptHandler!).

    Args:
        node (nodes.Raise): the node raising the exception.

    Returns:
        bool: True if the node is inside a try/except statement, False otherwise.
    )rr�rr
)r�r)s  r��is_node_inside_try_exceptrEqs#��+�4�0�0�G��g�u��/�/�/r�c�d�t||��}|rdStt||����S)z�Check if the node is in a TryExcept which handles the given exception.

    If the exception is not given, the function is going to look for bare
    excepts.
    T)r7r�rB)r�r2�managing_handlerss   r��node_ignores_exceptionrHs:��/�t�Y�?�?�����t��)�$�	�:�:�;�;�;r�c���t|��rdS|���}|�-|jdkr"|���jtvrdS|���D]0}|jdkr#|���jtvrdS�1|���D]8}|j�d���|ur|�	d���rdS�9dS)zWReturn true if the given class node should be considered as an abstract
    class.
    TN�ABCMeta�ABCrF)�pass_is_abstract)
�is_protocol_class�declared_metaclassr�r��ABC_MODULESr?r�r�r.�is_abstract)r��metar@�methods    r��class_is_abstractrS�s���
������t��"�"�$�$�D����9�	�!�!�d�i�i�k�k�&6�+�&E�&E��4��N�N�$�$�����=�E�!�!�h�m�m�o�o�&:�k�&I�&I��4�4���,�,�.�.�����=���d��+�+�t�3�3��!�!�5�!�9�9�
��t�t���5r�r��attrc���	|�|��}n#tj$rYdSwxYw|d}t|tj��r�t
|tjtjf��}|�dSt|j	tj
��r%td�|j	jD����rdSt|j	tj
��rdSdS)NFrTc3�JK�|]}t|tj��V��dSr�)r�r�Const)r��ns  r�r�z,_supports_protocol_method.<locals>.<genexpr>�s.����U�U�!�:�a���-�-�U�U�U�U�U�Ur�)r�r��
NotFoundErrorr�rr��get_node_first_ancestor_of_typer��	NamedExprr��
BaseContainerr�r�rW)r�rT�
attributes�first�this_assign_parents     r��_supports_protocol_methodr`�s�����]�]�4�(�(�
�
��� �����u�u�����
�q�M�E��%��)�*�*��<��E�L�%�/�2�
�
���%��4��(�.��0C�D�D�	��U�U�7I�7O�7T�U�U�U�U�U�
��u��(�.���<�<�	��5��4s��+�+c�~�tjtjtjtjf}t||��Sr�)rr+�SetComp�DictComp�GeneratorExpr�)r��comprehensionss  r��is_comprehensionrf�s0��
��
�
�
��
��	�N��d�N�+�+�+r�c�V�t|t��ot|t��Sr�)r`�GETITEM_METHOD�KEYS_METHOD�r�s r��_supports_mapping_protocolrk�s+��$�
�~���8�
#�E�;�
7�
7�8r�c�,�t|t��Sr�)r`�CONTAINS_METHODrjs r��"_supports_membership_test_protocolrn�s��$�U�O�<�<�<r�c�V�t|t��pt|t��Sr�)r`�ITER_METHODrhrjs r��_supports_iteration_protocolrq�s+��$�U�K�8�8��<U�
�~�=�=�r�c�,�t|t��Sr�)r`�AITER_METHODrjs r��"_supports_async_iteration_protocolrt�s��$�U�L�9�9�9r�c�,�t|t��Sr�)r`rhrjs r��_supports_getitem_protocolrv����$�U�N�;�;�;r�c�,�t|t��Sr�)r`�SETITEM_METHODrjs r��_supports_setitem_protocolrz�rwr�c�,�t|t��Sr�)r`�DELITEM_METHODrjs r��_supports_delitem_protocolr}�rwr�c���|���}|�d��}|�d��}|�d��p|�d��}|p|p|S)N�mixinrr2)�lowerr�r�)r��lname�is_mixinrP�is_bases     r��_is_abstract_class_namer��sg���J�J�L�L�E��~�~�g�&�&�H��"�"�:�.�.�K����v�&�&�@�%�.�.��*@�*@�G��-�{�-�g�-r�c��|�Xt|tj��r5t|��rdSt	|dd��}|�t|��rdS|j}|�XdS)NTr�F)r�rr3rSr�r�r��r�r�s  r��is_inside_abstract_classr��sq��
�
��d�E�N�+�+�	� ��&�&�
��t��4���.�.�D���$;�D�$A�$A���t��{���
��5r��protocol_callback�Callable[[nodes.NodeNG], bool]c�>�t|tj��r4t|��sdS|���}|�
||��rdSt|t
j��r4t|��sdS|���rdS||��rdSt|tj��rdSt|t
j	j
��rEt|jt
j��r&t|j��r|j}||��SdS�NTF)r�rr3�has_known_bases�	metaclassr�r��has_dynamic_getattrr*r4�Proxy�_proxied)r�r�rQs   r��_supports_protocolr��s2���%���(�(���u�%�%�	��4���� � ���� � ��&�&�
��t��%��-�.�.���u�%�%�	��4��$�$�&�&�	��4���U�#�#�	��4��%��1�2�2���t�	�5�'�-�-�.�.�(��u�~�w�';�<�<�(�
�E�N�+�+�(�
��� � ��'�'�'��5r�F�check_asyncc�D�|rt}nt}t||��Sr�)rtrqr�)r�r��protocol_checks   r��is_iterabler�s&���6�;���5���e�^�4�4�4r�c�,�t|t��Sr�)r�rkrjs r��
is_mappingr�&����e�%?�@�@�@r�c�N�t|t��}|pt|��Sr�)r�rnr�)r��	supporteds  r��supports_membership_testr�*s%��"�5�*L�M�M�I��*��E�*�*�*r�c���t|tj��r7t|t��rdSt|��rt
|��rdSt|t��S)NT)	r�rr3r`�CLASS_GETITEM_METHOD�is_postponed_evaluation_enabled�"is_node_in_type_annotation_contextr�rv�r�r�s  r��supports_getitemr�/sk���%���(�(��$�U�,@�A�A�	��4�*�4�0�0�	�5W��6
�6
�	��4��e�%?�@�@�@r�r�c�,�t|t��Sr�)r�rz�r�r�s  r��supports_setitemr�:r�r�c�,�t|t��Sr�)r�r}r�s  r��supports_delitemr�>r�r�c�Z�t|dd��}t|��r
|��SdS)N�pytype)r��callable)r�r�s  r��_get_python_type_of_noder�Bs3��'.�t�X�t�'D�'D�F�������v�x�x���4r�)�compare_constantsr)�InferenceContext | Noner��InferenceResult | Nonec��t��}	|�|���}t|��}n+#tj$rYdSt
$r
}t|�d}~wwxYwt|tj	��s"|�
t|����	|D]�}t|��}||vrdS|rGt|tj
��r-t|tj
��r|j|jkrdSt|tj��ri|jj�]t|tj��rC|jj�7t#|jj��t#|jj��krdS��n8#tj$rYdSt$$r|cYSt
$r
}t|�d}~wwxYwt#|��dkr|ndS)aIReturn the inferred value for the given node.

    Return None if inference failed or if there is some ambiguity (more than
    one node has been inferred of different types).

    If compare_constants is True and if multiple constants are inferred,
    unequal inferred values are also considered ambiguous and return None.
    �r)Nr�)rdr��nextr�r�r�rr�rr�rgr�rrWr�r�r�r��
StopIteration)	r�r)r��inferred_types�	infer_genr�rxr��
inferred_types	         r�r�r�Is��'*�e�e�N�"��J�J�w�J�/�/�	��Y�������!�����t�t��"�"�"���!�����"�����e�T�1�2�2�<����3�E�:�:�;�;�;�"�!�	�	�H�4�X�>�>�M��N�2�2��t�t�!�
��x���5�5�
��u�e�k�2�2�
��N�e�k�1�1��t�t��8�U�%6�7�7�
��M�&�2��u�e�&7�8�8�3��J�O�/���
�*�+�+�s�5�:�?�/C�/C�C�C��t�t��%	��&�!�����t�t����������"�"�"���!�����"������'�'�1�,�,�5�5�$�6sS�%6�A�	A�A�A�F�8AF�BF�F�F;�F;�%	F;�.F6�6F;i�list[InferenceResult]c��	t|�|�����S#tj$rgcYSt$r
}t
|�d}~wwxYw)Nr�)r�r�r�r�r�r)r�r)rxs   r��	infer_allr��sh��"��D�J�J�w�J�/�/�0�0�0���!�����	�	�	��"�"�"���!�����"���s�"%�A�	A�A	�	Ar�c���	|jS#t$rYnwxYw|jD]L}t||���}t	|t
j��r||ust||���s
d|_dS�Md|_dS)z=Return true if all base classes of a class could be inferred.r�FT)�_all_bases_known�AttributeErrorr4r�r�rr3r�)r�r)r2r�s    r�r�r��s���
��%�%���
�
�
���
����������D�'�2�2�2���6�5�>�2�2�	�����"�6�7�;�;�;��&+�E�"��5�5�	�
"�E���4s�	�
�c��|dupGt|tj��o|jdup$t|tj��o
|jdkS)NrS)r�rrWr�rr�r�s r��is_noner��sP�����	B��t�U�[�)�)�@�d�j�D�.@�	B��t�U�Z�(�(�@�T�Y�&�-@�r�� SuccessfulInferenceResult | Nonec�V�t��}	|���D]W}t|tj��st|��r�,|�|��t|��dkrdS�Xn#tj	$rYdSwxYw|r|�
��ndS)z�Return the inferred type for `node`.

    If there is more than one possible type, or if inferred type is Uninferable or None,
    return None
    r�N)rdr�r�rr�r�rgr�r�r��pop)r��types�var_types   r��	node_typer��s���-0�E�E�E���
�
���	�	�H��(�D�$8�9�9�
�W�X�=N�=N�
���I�I�h�����5�z�z�A�~�~��t�t��		���!�����t�t������)�5�9�9�;�;�;�T�)s�A)A=�;A=�=B�Bc��d}t|tj��sdS|jr|jjng}|D]�}t|tj��r|j}nt|tj��r|}n�Bt|tj��r|jdkr�h	t|j	�
����}n#tj$rY��wxYwt|tj��rt||��cS��dS)z>Check if the given function node is a singledispatch function.)zfunctools.singledispatchzsingledispatch.singledispatchF�register)r�rr�r�r7r8r�r�r�r�r�r�r�r�)r��singledispatch_qnamesr�r�r8�func_defs      r��(is_registered_in_singledispatch_functionr��s,����
�d�E�-�.�.���u�*.�/�A���&�&�r�J��C�C�	��i���,�,�	��>�D�D�
�	�5�?�
3�
3�	��D�D���$���0�0�	�D�M�Z�4O�4O��	��D�I�O�O�-�-�.�.�H�H���%�	�	�	��H�	�����h�� 1�2�2�	C�!�(�,A�B�B�B�B�B�	C��5s�&C�C�C�nodes.FunctionDef | Nonec�6�t|tj��r|j}nt|tj��r|}ndSt|tj��r|jdkrdSt
|j��}t|tj��sdS|S)Nr�)	r�rr7r8r�r�r�r�r�)r�r8r�s   r��find_inferred_fn_from_registerr��s����$��
�#�#���y���	�D�%�/�	*�	*������t��d�E�O�,�,���
��0K�0K��t��$�)�$�$�H��h�� 1�2�2���t��Or�c��d}|jr|jjng}|D]%}t|��}|rt||��cS�&dS)zDCheck if the given function node is a singledispatchmethod function.)zfunctools.singledispatchmethodz#singledispatch.singledispatchmethodF)r�rr�r�)r��singledispatchmethod_qnamesr�r�r�s     r��.is_registered_in_singledispatchmethod_functionr��sm��#��
+/�/�A���&�&�r�J��I�I�	�1�)�<�<���	I�!�(�,G�H�H�H�H�H�	I��5r�rRc�h�t|dd��rt|jd��St|dd��rt|jd��St|dd��rt|jd��St|dd��rt|jd��S|jS)z�Get the last lineno of the given node.

    For a simple statement this will just be node.lineno,
    but for a node that has child statements (e.g. a method) this will be the lineno of the last
    child statement recursively.
    �	finalbodyF����orelser$r�)r��get_node_last_linenor�r�r$r�rr�s r�r�r�	s����t�[�%�(�(�8�#�D�N�2�$6�7�7�7��t�X�u�%�%�5�#�D�K��O�4�4�4��t�Z��'�'�7�#�D�M�"�$5�6�6�6��t�V�U�#�#�3�#�D�I�b�M�2�2�2��;�r�c�<�|���}d|jvS)z<Check if the postponed evaluation of annotations is enabled.r)r��future_imports)r��modules  r�r�r�!s��
�Y�Y�[�[�F��F�1�1�1r�c��tjdtd���t|��o)|���t
vot
|��S)zWCheck if class is subscriptable with PEP 585 and
    postponed evaluation enabled.
    z�'is_class_subscriptable_pep585_with_postponed_evaluation_enabled' has been deprecated and will be removed in pylint 3.0. Use 'is_postponed_evaluation_enabled(node) and is_node_in_type_annotation_context(node)' instead.r�r�)r�r�r�r�r��SUBSCRIPTABLE_CLASSES_PEP585r�r�s  r��?is_class_subscriptable_pep585_with_postponed_evaluation_enabledr�'sb��
�M�	=�	��
����	(��-�-�	5��K�K�M�M�9�9�	5�.�t�4�4�r�c�~�||j}}	t|tj��r|j|ksgt|tj��r(|g|j�|j�|j�|j	�|j
�Rvs%t|tj��r
|j|krdS||j}}t|tj
��rdS��)z�Check if node is in type annotation context.

    Check for 'AnnAssign', function 'Arguments',
    or part of function return type annotation.
    TF)r�r�r�	AnnAssign�
annotation�	Argumentsr�posonlyargs_annotations�kwonlyargs_annotations�varargannotation�kwargannotationr�r�r)r��current_node�parent_nodes   r�r�r�<s���!%�d�k�+�L���{�E�O�4�4�	��&�,�6�6��+�u��7�7�7����(���4���3���,�	�
�+������+�u�'8�9�9���#�|�3�3��4�$/��1C�k���k�5�<�0�0�	��5�'r�r�r�c���td�||fD����sdS|���D]@}	tj�||��rdS�'#tjj$rY�=wxYwdS)z�Check if first node is a subclass of second node.

    :param child: Node to check for subclass.
    :param parent: Node to check for superclass.
    :returns: True if child is derived from parent. False otherwise.
    c3�JK�|]}t|tj��V��dSr�)r�rr3)r�r�s  r�r�z!is_subclass_of.<locals>.<genexpr>as.����L�L�D�z�$���/�/�L�L�L�L�L�Lr�FT)r�r?r��helpers�
is_subtyper.�_NonDeducibleTypeHierarchy)r�r�r@s   r��is_subclass_ofr�Zs����L�L�U�F�O�L�L�L�L�L���u��O�O�%�%����	���)�)�(�F�;�;�
��t�t�
���!�<�	�	�	��H�	�����5s� A�A0�/A0c�f�t|dd��}t|ot|ddg����S)z�Check if a node is a function stub decorated with typing.overload.

    :param node: Node to check.
    :returns: True if node is an overload function stub. False otherwise.
    r�Nztyping.overload�overload)r�r�r�)r�r�s  r��is_overload_stubr�ms8����|�T�2�2�J��
�T�~�d�5F�
�4S�T�T�U�U�Ur��clsc�$�t|tj��sdS|���tvrdS|jD]N}	|���D]!}|���tvrdS�"�:#tj$rY�KwxYwdS)z�Check if the given node represents a protocol class.

    :param cls: The node to check
    :returns: True if the node is or inherits from typing.Protocol directly, false otherwise.
    FT)	r�rr3r��TYPING_PROTOCOLSr4r�r�r�)r�r2�inf_bases   r�rMrMxs����c�5�>�*�*���u��y�y�{�{�&�&�&��t��	����	� �J�J�L�L�
 �
 ���>�>�#�#�'7�7�7��4�4�4�8�
 ���%�	�	�	��H�	�����5s�2A;�9A;�;B
�B
c��t|tj��o.t|jtj��o|jj|kS)z6Checks if node is a function call with the given name.)r�rr7r8rr�r�s  r��is_call_of_namer��s?��	�4���$�$�	#��t�y�%�*�-�-�	#��I�N�d�"�r�c�b�|p|j}t|tjtjtjtjf��r#||jup|j�|��St|tj	��r	||j
vSt|d��o|�|��S)z>Returns true if the given node is being tested for truthiness.r�)r�r�rr	r��IfExp�Assert�testr��
Comprehension�ifsr�r,s  r��is_test_conditionr��s���
�
"�t�{�F��&�5�;���%�+�u�|�L�M�M�B��v�{�"�A�f�k�&;�&;�D�&A�&A�A��&�%�-�.�.�"��v�z�!�!��6�6�*�*�E�v�/?�/?��/E�/E�Er�c�X�|jdkrdStd�|jD����S)zTest if ClassDef node is Type.r�Tc3�`K�|])}t|tj��o
|jdkV��*dS)r�N)r�rrr�)r��bs  r�r�z#is_classdef_type.<locals>.<genexpr>�s:����R�R�!�z�!�U�Z�(�(�=�Q�V�v�-=�R�R�R�R�R�Rr�)r�r�r4r�s r��is_classdef_typer��s3���y�F����t��R�R�t�z�R�R�R�R�R�Rr��!nodes.ClassDef | astroid.Instance�	attr_namec�T�|j�|dg��d}|r;t|tj��r!t|jtj��rdS|jD]@}t|��}|r-t|tj	��rt||��rdS�AdS)zQTest if attribute is typed annotation in current node
    or any base nodes.
    NrTF)�locals�getr�rr�r�r�r4r�r3�is_attribute_typed_annotation)r�r��	attributer2r�s     r�rr�s�������	�D�6�2�2�1�5�I����y�%�"2�3�3��
�y�'���9�9��
�t��
�����d�#�#���	��8�U�^�4�4�	�.�h�	�B�B�	�
�4�4���5r�c�R�|jdko|���jdkS)N�Enum�enum)r�r�r�s r��is_enumr�s$���9���=�4�9�9�;�;�#3�v�#=�=r��nodes.AssignName�typing_namec�:�t|jtj��sdS|jj}t|tj��r|j}t|tj��r|j|ks%t|tj	��r
|j
|krdSdS)z�Test if AssignName node has `typing_name` annotation.

    Especially useful to check for `typing._SpecialForm` instances
    like: `Union`, `Optional`, `Literal`, `ClassVar`, `Final`.
    FT)r�r�rr�r��	Subscriptr�rr�r�r�)r�r	r�s   r��is_assign_name_annotated_withr�s����d�k�5�?�3�3���u���'�J��*�e�o�.�.�&��%�
��:�u�z�*�*���O�{�*�*��j�%�/�2�2�
+���;�.�.��t��5r��nodes.For | nodes.Comprehensionc�l�t|jtj��r�t|jjtj��r||jjjdkrgt|jj��}t|tj	��sdS|j�
���d��dSt|jtjtjf��rIt|j��}t|tj
��sdS|j�
��SdS)z�Get the name of the dictionary which keys are being iterated over on
    a ``nodes.For`` or ``nodes.Comprehension`` node.

    If the iterating object is not either the keys method of a dictionary
    or a dictionary itself, this returns None.
    r2Nz.keysr)r��iterrr7r8r�r�r�r��BoundMethod�	as_string�
rpartitionr�Dict�r�r�s  r��get_iterating_dictionary_namer�s���	�4�9�e�j�)�)�<��t�y�~�u��7�7�<�
�I�N�#�v�-�-��d�i�n�-�-���(�G�$7�8�8�	��4��y�"�"�$�$�/�/��8�8��;�;��$�)�e�j�%�/�:�;�;�%��d�i�(�(���(�E�J�/�/�	��4��y�"�"�$�$�$��4r��nodes.Subscript�nodes.Constc��t|j��}t|tj��std���|S)z�Returns the value 'subscript.slice' of a Subscript node.

    :param node: Subscript Node to extract value from
    :returns: Const Node containing subscript value
    :raises InferredTypeError: if the subscript node cannot be inferred as a Const
    z3Subscript.slice cannot be inferred as a nodes.Const)r��slicer�rrWr�rs  r��get_subscript_const_valuer�s<���$�*�%�%�H��h���,�,�W�� U�V�V�V��Or��
importnoderrc��t|tj��rd|jr]|���}t|tj��r/	|�||j���S#t$r|cYSwxYw|S)a�Get a prepared module name from the given import node.

    In the case of relative imports, this will return the
    absolute qualified module name, which might be useful
    for debugging. Otherwise, the initial module name
    is returned unchanged.

    :param importnode: node representing import statement.
    :param modname: module name from import statement.
    :returns: absolute qualified module name of the module
        used in import.
    )�level)r�rrrr�r�relative_to_absolute_namer)rrr�s   r��get_import_namers����*�e�.�/�/��J�4D����� � ���d�E�L�)�)�	�
��5�5��:�#3�6�����&�
�
�
�����
�����Ns�A-�-A<�;A<�nodes.Ifc��t|jtj��ra|jj}t|tj��r|j}t|tj��r|���dkrdSdS)z�Return True if IF stmt is a sys.version_info guard.

    >>> import sys
    >>> if sys.version_info > (3, 8):
    >>>     from typing import Literal
    >>> else:
    >>>     from typing_extensions import Literal
    zsys.version_infoTF)	r�r�r�Compare�leftrr�r�r)r�r�s  r��is_sys_guardr$ sr���$�)�U�]�+�+���	����e�U�_�-�-�	 ��K�E��u�e�o�.�.�	����!�!�%7�7�7��4��5r�c���tjdtd���t|jt
jt
jf��o+|j����	d��S)z�Return True if IF stmt is a typing guard.

    >>> from typing import TYPE_CHECKING
    >>> if TYPE_CHECKING:
    >>>     from xyz import a
    �PThis method will be removed in pylint 3.0; use in_type_checking_block() instead.r�r�r
)
r�r�r�r�r�rrr�rr�r�s r��is_typing_guardr'6sn��
�M�Z�������
��	�E�J���0���:�
�)�
�
�
�
�
(�
(��
9�
9�:r�c��tjdtd���t|jt
j��ot|j��S)zHReturn True if node is part for guarded `typing.TYPE_CHECKING` if block.r&r�r�)r�r�r�r�r�rr�r'r�s r��&is_node_in_typing_guarded_import_blockr)GsI���M�Z�������
�d�k�5�8�,�,�M����1M�1M�Mr�c���tjdtd���t|jt
j��o't|j��pt|j��S)zmReturn True if node is part for guarded if block.

    I.e. `sys.version_info` or `typing.TYPE_CHECKING`
    r&r�r�)	r�r�r�r�r�rr�r$r'r�s r��is_node_in_guarded_import_blockr+Qs_��

�M�Z�������
�d�k�5�8�,�,���T�[�!�!�A�_�T�[�%A�%A�r�c�����t��fd������tjtjtjf��D����S)zaCheck if the given variable name is reassigned in the same scope after the
    current node.
    c3�N�K�|]}|j�ko|j�jkV�� dSr�)r�r)r��ar�r�s  ��r�r�z.is_reassigned_after_current.<locals>.<genexpr>dsL�������
�	
��'��4�a�h���4������r�)r�r�r�rr�r3r��r�r�s``r��is_reassigned_after_currentr0`sm���������������,�,�
�
�u�~�u�/@�A�
�
������r�c����t��fd������tj��D����S)z^Check if the given variable name is deleted in the same scope after the current
    node.
    c3�v�K�|]3}|jD])}t|dd���ko|j�jkV��*�4dS)r�N)r�r�r)r��del_noder�r�r�s   ��r�r�z+is_deleted_after_current.<locals>.<genexpr>psp���������&���
�	����%�%��0�P�V�]�T�[�5P�������r�)r�r�r�r�Deleter/s``r��is_deleted_after_currentr5ls[�����������
�
���3�3�E�L�A�A������r�c��t|j��dkont|jdtj��oIt|jdjtj��o|jdjjtkS)zBChecks whether a function body only consists of a single Ellipsis.r�r)r�r�r�r�Exprr�rW�Ellipsisr�s r��is_function_body_ellipsisr9wsk��	�D�I���!��	1��t�y��|�U�Z�0�0�	1��t�y��|�)�5�;�7�7�	1�
�I�a�L��$��0�	r�c�F�t|tj��o|jSr�)r�rr\r�r�s r��is_base_containerr;�s���d�E�/�0�0�B���]�Br�c�F�t|tj��o|jSr�)r�rrr�r�s r��is_empty_dict_literalr=�s���d�E�J�'�'�:��
�N�:r�c�z�t|tj��o!t|jt��o|jSr�)r�rrWr�r�r�s r��is_empty_str_literalr?�s0���4���%�%�X�*�T�Z��*E�*E�X�d�j�.�r�c��t|tj��o=t|jtj��ot|jjt
��S)zIReturns true if a node is a nodes.Return that returns a constant boolean.)r�r�Returnr�rWr�r�s r��returns_boolrB��E��	�4���&�&�	/��t�z�5�;�/�/�	/��t�z�'��.�.�r�c��t|tj��o=t|jtj��ot|jjt
��S)zIReturns true if a node is a nodes.Assign that returns a constant boolean.)r�rr�r�rWr�r�s r��
assigned_boolrE�rCr��
ancestor_type�'type[_NodeT] | tuple[type[_NodeT], ...]�
_NodeT | Nonec�\�|���D]}t||��r|cS�dS)zIReturn the first parent node that is any of the provided types (or None).N�r�r�)r�rFr@s   r�rZrZ�sD���'�'�)�)�����h�
�.�.�	��O�O�O�	��4r��/tuple[None, None] | tuple[_NodeT, nodes.NodeNG]c�h�|}|���D]}t||��r||fcS|}�dS)aModified version of get_node_first_ancestor_of_type to also return the
    descendant visited directly before reaching the sought ancestor.

    Useful for extracting whether a statement is guarded by a try, except, or finally
    when searching for a TryFinally ancestor.
    �NNrJ)r�rFr�r@s    r��-get_node_first_ancestor_of_type_and_its_childrN�sS��
�E��'�'�)�)�����h�
�.�.�	%��e�$�$�$�$�����:r�c���|���D�]Z}t|tj��s�t|jtj��r�|jjdkr�N|j�|jj��d}|sdS|d}t|tj��r|j	dkrdSt|j��}t|tj��r|jdurdS��t|jtj
��rS|jjdkr��t|jj��}t|tj��r|jdkrdS��\dS)z4Check if a node is guarded by a TYPE_CHECKING guard.r
r�Frr�T)r�r�rr�r�rr�rrrr�rWr�r�r�r�r)r�r@�
lookup_result�maybe_import_fromr��inferred_modules      r��in_type_checking_blockrS�sb���'�'�)�)�����(�E�H�-�-�	���h�m�U�Z�0�0�	��}�!�_�4�4��$�M�0�0���1C�D�D�Q�G�M� �
��u�u� -�a� 0���,�e�.>�?�?�
�%�-��9�9��t�t�!�(�-�0�0�H��(�E�K�0�0�
�X�^�u�5L�5L��t�t��
��
�u��
7�
7�	��}�%��8�8��(���);�<�<�O��?�E�L�9�9�
�#�(�H�4�4��t�t���5r��names_to_check�tuple[str, ...]c���t|tj��r{	|�|j��dd}n#t
$rYdSwxYwt|tj��r'|jdko|�|j��|vSn\t|tj	��rBt|j��}t|tj��o|jdko|j
|vSdS)zkCheck if `node` is a member of the `typing` module and has one of the names from
    `names_to_check`.
    r�rFr�)r�rrrr�r�rr�	real_namer�r�r�rr�)r�rT�import_fromrRs    r��is_typing_memberrY�s���$��
�#�#�
�	��+�+�d�i�0�0��3�A�6�K�K���	�	�	��5�5�	�����k�5�#3�4�4�	��#�x�/�G��)�)�$�)�4�4��F�
�	�

�D�%�/�	*�	*�
�$�T�Y�/�/������5�5�
0��$��0�
0��
��/�	
�
�5s�&A�
A�Ar�nodes.Statementc�x��t|tj��ot�fd�|jD����S)zEReturns True if stmt is inside the else branch for a parent For stmt.c3�N�K�|]}|����p|�kV�� dSr�)r�)r��	else_stmtrs  �r�r�z%in_for_else_branch.<locals>.<genexpr>�sL�����1�1�;D�	���D�!�!�6�Y�$�%6�1�1�1�1�1�1r�)r�rr�r�r�)r�rs `r��in_for_else_branchr^�sR����f�e�i�(�(��S�1�1�1�1�HN�
�1�1�1�.�.�r�r��&nodes.AssignName | nodes.BaseContainer�
Iterator[str]c#��K�t|tj��r|j�|jV�dSdSt|tj��r|jD]}t
|��Ed{V���dSdS)zBYield the names of assignment targets, accounting for nested ones.N)r�rr�r�r\r��find_assigned_names_recursive)r�r>s  r�rbrb�s������&�%�*�+�+�:��;�"��+������#�"�	�F�E�/�	0�	0�:��;�	:�	:�C�4�S�9�9�9�9�9�9�9�9�9�9�:�:�	:�	:r��+nodes.For | nodes.Comprehension | nodes.Set�Iterator[bool]c#�XK�t|tj��rdV�dSt|tj��r!|jD]}t|��Ed{V���dSt|tjtjf��r$|jjD]}t|��Ed{V���dSdS)z6Yield ``True`` if a Starred node is found recursively.TN)	r�r�Starred�Setr��has_starred_node_recursiver�r�r)r�r>s  r�rhrh
s������$��
�&�&�7��
�
�
�
�
�	�D�%�)�	$�	$�7��9�	7�	7�C�1�#�6�6�6�6�6�6�6�6�6�6�	7�	7�	�D�5�9�e�&9�:�	;�	;�7��9�>�	7�	7�C�1�#�6�6�6�6�6�6�6�6�6�6�7�7�	7�	7r�c�^�	|���D]�}t|tjtjf��rdSt
|d��sdSt|�d����}|j	|urdSt|dd���dS��dS#tj$rYdSwxYw)zgReturn whether any inferred value of `node` is hashable.

    When finding ambiguity, return True.
    T�igetattrr;r�NF)
r�r�rr3rr�r�r�rjr�r�r�r�)r�r��hash_fns   r��is_hashablerls���
��
�
���		�		�H��(�U�^�T�5I�$J�K�K�
��t�t��8�Z�0�0�
��t�t��8�,�,�Z�8�8�9�9�G��~��)�)��t�t��w���.�.�:��t�t�;��u���!�����t�t����s)�=B�B�,B�B�B�B,�+B,�#nodes.AssignName | nodes.AssignAttr�sidec�N�t|tj��r,t|tj��r|j|jkSdSt|tj��rDt|tj��r*|���|���kSdS)zKDetermine whether the target name-like node is referenced in the side node.F)r�rrr�r�r��
AssignAttrr)r�rns  r��_is_target_name_in_binop_siderq.s����$��
�#�#���f�e�.�/�/�	,��;�$�)�+�+��u��$���(�(�6�Z���@P�-Q�-Q�6����!�!�T�^�^�%5�%5�5�5��5r��nodes.Assign�tuple[bool, str]c��t|jtj��sdS|j}|jd}t|tjtjf��sdSt|jtj��r(t|jjttf��rdSt|jtj��st|jtj��rdSt||j��r	d|jfS|jtvrht||j��rSt!|j��}t|tj��r#t|jt"��r	d|jfSdSdS)zjDetermine if the node is assigning itself (with modifications) to itself.

    For example: x = 1 + x
    )Fr~rT)r�r�r�BinOpr�r�rpr#rWr��bytesr7�rightrq�op�COMMUTATIVE_OPERATORSr�rR)r��binopr��
inferred_lefts    r��is_augmented_assignr|;s]��
�d�j�%�+�.�.���y��J�E�
�\�!�_�F��f�u�/��1A�B�C�C���y��%�*�e�k�*�*��z�
�
��3��,�0�0���y��%�*�e�j�)�)��Z���U�Z�-P�-P���y�$�V�U�Z�8�8���U�X�~��	��)�)�)�)�&�%�+�>�>�	*�#�5�:�.�.�
��m�U�[�1�1�	"�j����7
�7
�	"����>�!��y��9r�r��nodes.Module�ignored_modulesc�J�t|��}|j}|���}|D]u}||vs||vrdStj||��rdSt	|�d����}d}|r*|���}|s|}n|d|��z
}||vrdS|�*�vdS)NTrbr~F)rdr�r��fnmatchr�split�popleft)r�r~�module_name�module_qname�ignore�parts�current_module�parts        r��is_module_ignoredr�cs����/�*�*�O��+�K��<�<�>�>�L�!�����?�*�*�k�_�.L�.L��4�4��?�<��0�0�	��4�4��k�'�'��,�,�-�-�����	��=�=�?�?�D�!�
-�!%����*�d�*�*�,����0�0��t�t��	���5r�c�x��t�tj��ot�fd�tD����S)Nc3�*�K�|]
}�j|uV��dSr�rj)r�r�r�s  �r�r�z%is_singleton_const.<locals>.<genexpr>�s;�����1�1� %��
�e��1�1�1�1�1�1r�)r�rrWr��SINGLETON_VALUESr�s`r��is_singleton_constr��sN����d�E�K�(�(��S�1�1�1�1�)9�1�1�1�.�.�r�c��t|jtj��st|jtj��rt|jtj��rdS	|j���D]0}t|d��r|�	��tvrdS�1n#ttj
f$rYnwxYwdS)z9Detect call to exit(), quit(), os._exit(), or sys.exit().Fr�T)r�r8rr�rr�r�r�r�r��TERMINATING_FUNCS_QNAMESr�r�r�rs  r��is_terminating_funcr��s���
�t�y�%�/�2�2���D�I�u�z�2�2���d�k�5�<�0�0��
�u�
��	���)�)�	�	�H���'�*�*�
��N�N�$�$�(@�@�@��t�t��	��
�7�1�2�
�
�
���
�����5s�!AB,�*B,�,C�Cc�^�	|�|��dS#tj$rYdSwxYwr�)r�r�rY)r�r�s  r��
is_class_attrr��sC���
�
�
�d�����t��� �����u�u����s��,�,c�0��d}t|tj��r|jj�k}t|tjtjf��r t�fd�|jD����}t|tj	��r t�fd�|j
D����}t|tjtjf��r|j�k}t|tj
��r6|jo.t|jtj��o|jj�k}t|tj��r t�fd�|jD����}|p,t�fd�|���D����S)z>Searches for a tree node that defines the given variable name.Fc3�0�K�|]}|d�kV��dS)rNr�)r��	node_namer�s  �r�r�zis_defined.<locals>.<genexpr>�s,�����Q�Q��	�!��� 4�Q�Q�Q�Q�Q�Qr�c3�z�K�|]5}t|dtj��o|dj�kV��6dS)r�N)r�rr�r�)r�r}r�s  �r�r�zis_defined.<locals>.<genexpr>�sX����� 
� 
��
�t�A�w�� 0�1�1�J�d�1�g�l�d�6J� 
� 
� 
� 
� 
� 
r�c3�h�K�|],}t�fd�t|��D����V��-dS)c3���K�|]r}t|tj��o.t|jtj��o|jj�kp$t|tj��o
|j�kV��sdSr�)r�rrfr�r�r�)r�r>r�s  �r�r�z'is_defined.<locals>.<genexpr>.<genexpr>�s������
�
��
#�3��
�6�6�3�&�s�y�%�2B�C�C�3��I�N�d�2�P�
#�3��(8�9�9�N�c�h�$�>N�
�
�
�
�
�
r�N)r�r�)r�r�r�s  �r�r�zis_defined.<locals>.<genexpr>�ss�����
 
�
 
��
�
�
�
�
�,�F�3�3�
�
�
�

�

�
 
�
 
�
 
�
 
�
 
�
 
r�c3�8�K�|]}t�|��V��dSr�)�
is_defined)r�r�r�s  �r�r�zis_defined.<locals>.<genexpr>�s>�����$�$�$)�
�4����$�$�$�$�$�$r�)r�rr[r�r�rrr�r�r�r�r3r�r�r�r�r�r��get_children)r�r��is_defined_so_fars`  r�r�r��s�������$���(�(�5� �K�,��4���$���u�'7�8�9�9�R��Q�Q�Q�Q�d�j�Q�Q�Q�Q�Q���$��
�#�#�
�� 
� 
� 
� 
��
� 
� 
� 
�
�
��
�$����):�;�<�<�.� �I��-���$���(�(�
��J�
)��4�;��(8�9�9�
)��� �D�(�	��$���%�%�
��
 
�
 
�
 
�
 
��,�
 
�
 
�
 
�

�

�����$�$�$�$�-1�->�->�-@�-@�$�$�$�!�!�r�rxc�(�ddddddddd	d
d�
|S)a
Returns the inverse comparator given a comparator.

    E.g. when given "==", returns "!="

    :param str op: the comparator to look up.

    :returns: The inverse of the comparator in string format
    :raises KeyError: if input is not recognized as a comparator
    �!=�==�>=�<=�>�<�not in�in�is not�is)
r�r�r�r�r�r�r�r�r�r�r�)rxs r��get_inverse_comparatorr��s;����
�
���������	�
�
r��	test_node�Gnodes.Compare | nodes.Name | nodes.UnaryOp | nodes.BoolOp | nodes.BinOpc��d|�����}t|tj��r|j���}�n,t|tj��rd|����d�}n�t|tj��r�|j}|jd\}}tj	tjtjtj
tjf}t||��rd|����d�n|���}t||��rd|����d�n|���}|�dt|���d|��}|S)Nznot znot (rarr`� )
rr�r�UnaryOp�operand�BoolOpr"r#�opsr�r�r[r�)r��msg�lhsr��rhs�lower_priority_expressionss      r��not_condition_as_stringr��sl��)��$�$�&�&�
(�
(�C��)�U�]�+�+�;���)�)�+�+���	�I�u�|�	,�	,�;�.�i�)�)�+�+�.�.�.���	�I�u�}�	-�	-�;��n���=��#���S��L��M��L��K��O�&
�"��#�9�:�:�
!�"��
�
���"�"�"�"������	��#�9�:�:�
!�"��
�
���"�"�"�"������	�
�:�:�-�c�2�2�:�:�S�:�:���Jr�rSc��ddlm}ttt|t
tg}|D]}|����dS)z-Clear caches holding references to AST nodes.r)�overridden_methodN)�pylint.checkers.variablesr�r^r�r�rr��cache_clear)r��caches_holding_node_references�lrus   r��clear_lru_cachesr�	sa��<�;�;�;�;�;�	����&��
E�"�.������������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�r�r�r�r�r�r�)r�rr�r�r�)r�r�r�r�r�r�)r.r/r�r�r�r�)r�r�r�r�)r<r/r�r�r�r�)rBr�r�rC)rXr�r�rY)rXr�r�rs)rXr�r�rz)rXr�r�r�)r�r�r�r�)r�r�r�r�)r<r�r�r�)r�r�r�r�rM)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�rr�r�)r8r�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�r2r3r�r4)r�r�r�r8)r<r�r2r3r�r�)r�r�r2r3r�r8)r�rCr�r�)r�r�r2r3r�r�)r�r/r�r�)r�r�rTr�r�r�)r�r�r�r�)r�r�r�r�r�r�)F)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�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�rR)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�r�)r�r�r�r�r�r�)r�rr	r�r�r�)r�r
r�r�)r�rr�r)rrrr�r�r�)r�r r�r�)r�r�r�r�r�r�)r�r�r�r�)r�r�rFrGr�rH)r�r�rFrGr�rK)r�r�rTrUr�r�)r�r�rrZr�r�)r�r_r�r`)r�rcr�rd)r�rmrnr�r�r�)r�rrr�rs)r�r}r~r�r�r�)r�r�r�r�)r�r�r�r/r�r�)r�r�r�r�r�r�)rxr�r�r�)r�r�r�r�)r�rS)�rN�
__future__rrr�r!r�r�rer��collectionsr�collections.abcrr�	functoolsrrr	r�r
rrr
ru�astroid.objectsr�rrr�astroid.contextr�astroid.exceptionsr�astroid.nodes._base_nodesr�astroid.typingrrr�pylint.checkersrr�rr�AstCallbackMethodr+rbrcrdr�r�rOr�	frozensetr�ryrprs�NEXT_METHODrhr�ryr|rmri�_SPECIAL_METHODS_PARAMSr��SPECIAL_METHODS_PARAMSrd�	PYMETHODSr�r�r�r�r�r�r�r�r�r��__dict__�copyr�r�r�r�r�rr&r-r5r9r;rArIrKrMrPrrryr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
rrr r-r&r7r;r@rBrErHrSr`rfrkrnrqrtrvrzr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rMr�r�r�rrrrrrr$r'r)r+r0r5r9r;r=r?rBrErZrNrSrYr^rbrhrlrqr|r�r�r�r�r�r�r�r�r�r�r��<module>r�s���
>�=�"�"�"�"�"�"�����������������	�	�	�	�
�
�
�
�����������.�.�.�.�.�.�.�.�(�(�(�(�(�(�(�(�������8�8�8�8�8�8�8�8�8�8�8�8���������3�3�3�3�3�3�3�3�3�3�,�,�,�,�,�,�+�+�+�+�+�+�0�0�0�0�0�0�E�E�E�E�E�E�E�E��,�,�,�,�,�,�,�+�+�+�+�+�+�	�����	.�	.�	.���G�K�}�5�5�5�	��i��0�$�6�7��
�N�	�M�	�N�	��	�����i� �������9�B�B�B����"�	�";�";�";�<�<����������*������ ����C�%�L?�@L� ���Wl�l��\��2�8�8�:�:�����

�C�&�'�'�	�(�y�'�) �) ��V'�&�&��$�9�D�D�D����
	�	�	�	�	�)�	�	�	�	�	�	�	�	�	�	�	�	�U�U�U�U���������I�I�I�I�
��!�!�#�#��$��3�3�3�3�
8�8�8�8�
B�B�B�B�-�-�-�-�`7�7�7�7�t�����&����"P�P�P�P�L�L�L�L�
����	�	�	�	�����01�1�1�1�&E�E�E�E�E�Y�E�E�E����������I0�I0�I0�I0�X.�.�.�.�=�=�=�=�DL�L�L�L�:��������2P�P�P�P�!�!�!�!�OS������<	�	�	�	�*�*�*�*�6
�
�
�
�����-�-�-�-�
.�.�.�.�
8�8�8�8�
����6����0/�/�/�/�d��4����>B�1�1�1�1���1�h����
�
�
�
� 8�8�8�8�26�6�6�6�<E������(����:C������.<E�(�(�(�(�(�00�0�0�0�<E�<�<�<�<�<�����4����0,�,�,�,�8�8�8�8�=�=�=�=�����:�:�:�:�<�<�<�<�<�<�<�<�<�<�<�<�.�.�.�.�	�	�	�	�����B5�5�5�5�5�A�A�A�A�+�+�+�+�
A�A�A�A�A�A�A�A�A�A�A�A�������4����(,�57�$�	57�57�57�57�57���57�p��3����;?�"�"�"�"���"�?C������*����*�*�*�*�*!�!�!�!�H����(����"����02�2�2�2�����*����<����&��4����V�V�V���V�����.����#'�
F�
F�
F�
F�
F�S�S�S�S�����0>�>�>�>�����*����8��������2����,:�:�:�:�"N�N�N�N�����	�	�	�	���������C�C�C�C�;�;�;�;���������������������"����B����2�������
���	:�	:�	:�	:�7�7�7�7�����,
�
�
�
�%�%�%�%�P����D��������,����,�,�,�,�^
�
�
�
�0����@�����r�

Hacked By AnonymousFox1.0, Coded By AnonymousFox