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__/imports.cpython-311.pyc

�

�܋f>�����UdZddlmZddlZddlZddlZddlZddlmZddlm	Z	m
Z
ddlmZm
Z
mZmZmZddlZddlmZddlmZdd	lmZmZdd
lmZmZmZmZmZddlmZddl m!Z!m"Z"dd
l#m$Z$ddl%m&Z&m'Z'm(Z(ddl)m*Z*ddl+m,Z,ddl-m.Z.erddl/m0Z0ej1dkrddl2m3Z3nddl4m5Z3ee6eeee6e
fee6ffZ7ddhdhdhdhdhhd�dhhd�hd�hd �d!�
Z8dtd&�Z9dud2�Z:dvd6�Z;dwd:�Z<dxdyd=�Z=dzdA�Z>d{dF�Z?idGdHdIdJdKdLgif�dMdN�dOdP�dQdR�dSdT�dUdV�dWdX�dYdZ�d[d\�d]d^�d_d`�dadb�dcdd�dedf�dgdh�didj�Z@dkeAdl<dmZBdnZCdmZDGdo�dpee��ZEd|ds�ZFdS)}z!Imports checkers for Python code.�)�annotationsN)�defaultdict)�	ItemsView�Sequence)�
TYPE_CHECKING�Any�Dict�List�Union)�nodes)�
ImportNode)�BaseChecker�DeprecatedMixin)�get_import_name�in_type_checking_block�is_from_fallback_block�is_sys_guard�node_ignores_exception)�EmptyReportError)�
DotBackend�
get_cycles)�HIGH)�	Paragraph�Section�VerbatimText)�MessageDefinitionTuple)�IsortDriver)�LinterStats)�PyLinter)��)�cached_property)�cachedpropertyztkinter.tix�fpectl�optparsezxml.etree.cElementTree�imp�	formatter>�smtpd�asynchat�asyncore�macpath>�binhex�parser�symbol�lib2to3>�	typing.io�	typing.re�	distutils>�uu�cgi�nis�aifc�spwd�cgitb�chunk�crypt�pipes�sunau�imghdr�msilib�sndhdr�xdrlib�audioop�mailcap�nntplib�	sre_parse�	telnetlib�ossaudiodev�sre_compile�
sre_constants)
)rrr)r �r)r r r)r �r)r �r)r �r)r �r)r �	r)r �
r)r �r�modname�
str | None�return�	list[str]c���|�|�d��nd��fd�tt�����D��S)z�Split the names of the given module into subparts.

    For example,
        _qualified_names('pylint.checkers.ImportsChecker')
    returns
        ['pylint', 'pylint.checkers', 'pylint.checkers.ImportsChecker']
    N�.�c�P��g|]"}d��d|dz�����#S)rVr�)�join)�.0�i�namess  ��h/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/checkers/imports.py�
<listcomp>z$_qualified_names.<locals>.<listcomp>`s2���B�B�B�1�C�H�H�U�1�q�1�u�9�%�&�&�B�B�B�)�split�range�len)rQr]s @r^�_qualified_namesrdWsH���#*�"5�G�M�M�#����2�E�B�B�B�B��c�%�j�j�0A�0A�B�B�B�Br`�noder
�context�nodes.LocalsDictNodeNG�name�str�base�level�
int | None�alias�9tuple[nodes.Import | nodes.ImportFrom | None, str | None]c���|r|�d|��n|�d}d}d}|jD�]}||ur�|���|���ur|j|jkr�At|tj��rDt
�fd�|jD����rd}n�|jD]\}	}
|
s|	|krd}d}n�|rno��t|tj��rR||j	krG|jD];\}	}
�|j
�d|	��krd}n#|dkr||	kr|s|
sd}n|
s|	|krd}d}n�<|rn��
|rtj||��s||fSd	S)
zEReturn the node where [base.]<name> is imported or None if not found.rVNF�
reimportedc3�0�K�|]}�|dkV��dS)rN�)r[�iname�fullnames  �r^�	<genexpr>z$_get_first_import.<locals>.<genexpr>xs,�����A�A�E�8�u�Q�x�'�A�A�A�A�A�Ar`T�shadowed-import�*�NN)
�body�scope�
fromlineno�
isinstancer�Import�anyr]�
ImportFromrkrQ�astroid�
are_exclusive)rerfrhrjrkrm�first�found�msg�
imported_name�imported_aliasrts           @r^�_get_first_importr�cs����$(�1�$�������T�H��E��E�
�C���"�"���D�=�=���;�;�=�=�D�J�J�L�L�(�(�U�-=���-O�-O���e�U�\�*�*�	��A�A�A�A�U�[�A�A�A�A�A�
�����16��
�
�-�
�~�%��-�5�*@�*@� �E�+�C��E���
���
�
��u�/�
0�
0�	����#�#�5:�[���1�M�>��e�m�#E�#E�m�#E�#E�E�E� $�������� �M�1�1�!&�2�*8�2�!%����)��m�u�.D�.D� $��/��������E����W�*�5�$�7�7���c�z���:r`�ignored_modules�
Sequence[str]�boolc���t|��D]	}||vrdS�
t|��rdSt|jtj��rt
|j��rdSt|t��S)NT)	rdrr|�parentr�Ifrr�ImportError)rerQr��	submodules    r^�_ignore_import_failurer��s���
&�g�.�.���	���'�'��4�4�(�
�d�#�#���t��$�+�u�x�(�(��\�$�+�-F�-F���t�!�$��4�4�4r`�mod_files_list�ItemsView[str, set[str]]�_ImportTreec�8�i}|D]�\}}|gg}|�d��D]=}t|dt��sJ�|d�|igf��}�>t|dt��sJ�|d�|����|S)z�Get a list of 2-uple (module, list_of_files_which_import_this_module),
    it will return a dictionary to represent this as a tree.
    rVrrY)rar|�dict�
setdefault�list�extend)r��	tree_defs�mod�filesre�prefixs      r^�_make_tree_defsr��s��� �I�$���
��U�/8�"�o���i�i��n�n�	8�	8�F��d�1�g�t�,�,�,�,�,���7�%�%�f�r�2�h�7�7�D�D��$�q�'�4�(�(�(�(�(��Q����u������r`�data�
indent_strc�0�g}|���}tt|d������D]�\}\}\}}|sdn%dd�t|�����d�}|�|�|�d|����d	}	n>|�|�d
|�d|����|t|��dz
kr|�d	�}	n|�d�}	|r8t
|t��r#|�t||	������d
�|��S)z3Return a string which represents imports as a tree.c��|dS)Nrrr)�xs r^�<lambda>z!_repr_tree_defs.<locals>.<lambda>�s��a�PQ�d�r`)�keyrW�(�,�)N� z  z\-rYz| �
)	�items�	enumerate�sortedrZ�appendrcr|r��_repr_tree_defs)
r�r��lines�nodes_itemsr\r��subr��
files_list�sub_indent_strs
          r^r�r��sG���E��*�*�,�,�K�"+�F�;�N�N�,S�,S�,S�"T�"T�?�?����C��#�u�$�H�R�R�*H�c�h�h�v�e�}�}�.E�.E�*H�*H�*H�
����L�L�C�.�.�*�.�.�/�/�/�!�N�N��L�L�Z�=�=�3�=�=��=�=�>�>�>��C��$�$�q�(�(�(�$.�!2�!2�!2���$.�!2�!2�!2���	?�:�c�4�(�(�	?��L�L���n�=�=�>�>�>���9�9�U���r`�filename�dep_info�dict[str, set[str]]c��i}ttj�tj�|����dd���}|�d��t
|�����D]Q\}}t
|��}d||<|�|��|D] }||vrd||<|�|���!�Rt
|�����D]-\}}t
|��D]}|�	||����.|�
|��S)�,Write dependencies as a dot (graphviz) file.r�LR)�rankdirzURL="." node[shape="box"]rY)r�os�path�splitext�basename�emitr�r��	emit_node�	emit_edge�generate)r�r��done�printerrQ�dependencies�sorted_dependencies�
depmodnames        r^�_dependencies_graphr��sR��
�D����)�)�"�'�*:�*:�8�*D�*D�E�E�a�H�RV�W�W�W�G��L�L�,�-�-�-�!'����(8�(8�!9�!9�.�.����$�\�2�2����W�
����'�"�"�"�-�	.�	.�J���%�%�#$��Z� ��!�!�*�-�-�-��	.�%+�8�>�>�+;�+;�$<�$<�3�3� �
�L��l�+�+�	3�	3�G����g�z�2�2�2�2�	3����H�%�%�%r`�sectr�gtype�Nonec�v�t||��}|�t|�d|��f����dS)zaGenerate a dependencies graph and add some information about it in the
    report's section.
    z"imports graph has been written to N)r�r�r)r�r�r�r��
outputfiles     r^�_make_graphr��sD��%�X�x�8�8�J��K�K�	�e�S�S�z�S�S�U�V�V�W�W�W�W�Wr`�E0401zUnable to import %s�import-errorz4Used when pylint has been unable to import a module.�	old_names)�F0401zold-import-error�E0402)z2Attempted relative import beyond top-level package�relative-beyond-top-levelzSUsed when a relative import tries to access too many levels in the current package.�R0401)zCyclic import (%s)�
cyclic-importzBUsed when a cyclic import between two or more modules is detected.�R0402)zUse 'from %s import %s' instead�consider-using-from-importz�Emitted when a submodule of a package is imported and aliased with the same name, e.g., instead of ``import concurrent.futures as futures`` use ``from concurrent import futures``.�W0401)zWildcard import %s�wildcard-importz-Used when `from module import *` is detected.�W0404)zReimport %r (imported line %s)rpz.Used when a module is imported more than once.�W0406)zModule import itself�import-selfz'Used when a module is importing itself.�W0407)z!Prefer importing %r instead of %r�preferred-modulez?Used when a module imported has a preferred replacement module.�W0410)z:__future__ import is not the first non docstring statement�misplaced-futurezgPython 2.5 and greater require __future__ import to be the first non docstring statement in the module.�C0410)z!Multiple imports on one line (%s)�multiple-importszBUsed when import statement importing multiple modules is detected.�C0411)z%s should be placed before %s�wrong-import-orderzvUsed when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports).�C0412)z'Imports from package %s are not grouped�ungrouped-importsz.Used when imports are not grouped by packages.�C0413)z5Import "%s" should be placed at the top of the module�wrong-import-positionz%Used when code and imports are mixed.�C0414)z-Import alias does not rename original package�useless-import-aliaszwUsed when an import alias is same as original package, e.g., using import numpy as numpy instead of import numpy as np.�C0415)zImport outside toplevel (%s)�import-outside-toplevelzwUsed when an import statement is used anywhere other than the module toplevel. Move this import to the top of the file.�W0416)zShadowed %r (imported line %s)rvzFUsed when a module is aliased with a name that shadows another import.z!dict[str, MessageDefinitionTuple]�MSGSrr)�enchantc�&�eZdZdZdZiej�e�ZdZ	de	dddd�fd	e
dd
dd�fdd
dddd�fdd
dddd�fdd
dddd�fdedddd�fdedddd�fdddddd�fdddddd�fd dddd!d�ff
Z
ded&�Zdfd'�Zdgd)�Zdfd*�Zdhd,�Zdid/�Zdjd1�Zdkd3�Zdid4�Zdld6�ZexZxZxZxZxZxZxZZdmd8�Z e xZ!xZ"Z#dkd9�Z$dkd:�Z%dnd<�Z&dod?�Z'e(dpdB���Z)dqdE�Z*drdI�Z+dsdL�Z,dtdN�Z-dndO�Z.		dudvdT�Z/dwd[�Z0dwd\�Z1dxd^�Z2e3dgd_���Z4e3dgd`���Z5dydb�Z6dzdc�Z7dndd�Z8dPS){�ImportsCheckerz�BaseChecker for import statements.

    Checks for
    * external modules dependencies
    * relative / wildcard imports
    * cyclic imports
    * uses of deprecated modules
    * uses of modules instead of preferred modules
    �importsrrzdeprecated-modules�csvz	<modules>zBDeprecated modules which should not be used, separated by a comma.)�default�type�metavar�helpzpreferred-modulesz<module:preferred-module>z?Couples of modules and preferred modules, separated by a comma.zimport-graphrWr�z	<file.gv>z�Output a graph (.gv or any supported image format) of all (i.e. internal and external) dependencies to the given file (report RP0402 must not be disabled).zext-import-graphz�Output a graph (.gv or any supported image format) of external dependencies to the given file (report RP0402 must not be disabled).zint-import-graphz�Output a graph (.gv or any supported image format) of internal dependencies to the given file (report RP0402 must not be disabled).zknown-standard-libraryzYForce import order to recognize a module as part of the standard compatibility libraries.zknown-third-partyzJForce import order to recognize a module as part of a third party library.zallow-any-import-levelzNList of modules that can be imported at any level, not just the top level one.zallow-wildcard-with-allF�ynz<y or n>z8Allow wildcard imports from modules that define __all__.zallow-reexport-from-packagez:Allow explicit reexports by alias from a package __init__.�linterrrSr�c���tj||��tt��|_g|_d|_i|_t��|_dd|j	fdd|j
ff|_dS)N�RP0401zExternal dependencies�RP0402zModules dependencies graph)r�__init__r�set�import_graph�_imports_stack�_first_non_import_node�_module_pkg�_allow_any_import_level�_report_external_dependencies�_report_dependencies_graph�reports)�selfr�s  r^r�zImportsChecker.__init__�sy����T�6�*�*�*�8C�C�8H�8H���<>���&*��#�
�	
��25����$�
�.��0R�S�
�3�T�5T�U�
����r`c���i|jj_|jj|j_tt��|_i|_d|_tt��|_|jj	j
|_td�|jj	j
D����|_
t	|jj	j��|_|jj	j|_dS)�4Called before visiting project (i.e set of modules).Fc3�HK�|]}d|v�|�d��V��dS)�:N�ra)r[�modules  r^ruz&ImportsChecker.open.<locals>.<genexpr>�s@����&
�&
���f�}�}�
�L�L�����}�}�}�&
�&
r`N)r��statsr�rr�rr�_current_module_package�_excluded_edges�configr��_ignored_modulesr��preferred_modules�allow_any_import_levelr�allow_reexport_from_package�_allow_reexport_package�rs r^�openzImportsChecker.open�s���)+����&� �K�-����'��,�,������',��$�;F�s�;K�;K���/3�{�/A�/Q���!%�&
�&
��+�,�>�&
�&
�&
�"
�"
���
(+�4�;�+=�+T�'U�'U��$�'+�{�'9�'U��$�$�$r`�defaultdict[str, set[str]]c��tj|j��}|D](}||�|j|���)|S�N)�copy�deepcopyr�difference_updater)r�filtered_graphres   r^�#_import_graph_without_ignored_edgesz2ImportsChecker._import_graph_without_ignored_edges�sO����t�'8�9�9��"�	O�	O�D��4� �2�2�4�3G��3M�N�N�N�N��r`c��|j�d��ra|���}t|��}t	||���D].}|�dd�|������-dSdS)r
r�)�verticesz -> )�argsN)r��is_message_enabledr!r�r�add_messagerZ)r�graphr#�cycles    r^�closezImportsChecker.close�s����;�)�)�/�:�:�	K��<�<�>�>�E��E�{�{�H�#�E�H�=�=�=�
K�
K��� � ��v�{�{�5�7I�7I� �J�J�J�J�		K�	K�
K�
Kr`�set[str]c���t|jjj��}t���D]*\}}|tjkr|�|��}�+|S)z*Callback returning the deprecated modules.)	r�r�r�deprecated_modules�DEPRECATED_MODULESr��sys�version_info�union)r�all_deprecated_modules�
since_vers�mod_sets    r^r,z!ImportsChecker.deprecated_modules�se��"%�T�[�%7�%J�!K�!K��#5�#;�#;�#=�#=�	O�	O��J���S�-�-�-�)?�)E�)E�g�)N�)N�&��%�%r`re�nodes.Modulec��|j|_dS)z<Store if current module is a package, i.e. an __init__ file.N)�packager�rres  r^�visit_modulezImportsChecker.visit_modules��'+�|��$�$�$r`�nodes.Importc���|�|��|�|��|�|��d�|jD��}t	|��dkr+|�dd�|��|���|D]�}|�||��|�||��|�	||��}t|jtj
��r|�|��t|���tj
��r|�||��|���|�||j����dS)z+Triggered when an import statement is seen.c��g|]\}}|��Srrrr�r[rh�_s   r^r_z/ImportsChecker.visit_import.<locals>.<listcomp>s��0�0�0�'�$���0�0�0r`rIr��, �r$reN)�_check_reimport�_check_import_as_rename�_check_toplevelr]rcr&rZ�check_deprecated_module�_check_preferred_module�_get_imported_moduler|r�r�Module�_check_positionrz�_record_import�_add_imported_modulerh)rrer]rh�imported_modules     r^�visit_importzImportsChecker.visit_import	si�����T�"�"�"��$�$�T�*�*�*����T�"�"�"�0�0�T�Z�0�0�0���u�:�:��?�?����/�d�i�i��6F�6F�T��R�R�R��
	B�
	B�D��(�(��t�4�4�4��(�(��t�4�4�4�"�7�7��d�C�C�O��$�+�u�|�4�4�
+��$�$�T�*�*�*��$�*�*�,�,���5�5�
;��#�#�D�/�:�:�:��&���%�%�d�O�,@�A�A�A�A�
	B�
	Br`�nodes.ImportFromc�X�|j}|�||��}t||��}|�|��|�|��|�||��|�||��|�||��|�|��|�	|||j
���|�|��t|j
tj��r|�|��t|���tj��r|�||��|�dS|jD]G\}}|dkr!|�||j�d|�����,|�||j���HdS)z(Triggered when a from statement is seen.)r�rkNrwrV)rQrErrA�_check_misplaced_futurerCrD�_check_wildcard_imports�_check_same_line_importsr@rkrBr|r�rrFrGrzrHr]rIrh)rrer�rJ�
absolute_namerhr=s       r^�visit_importfromzImportsChecker.visit_importfrom"s����<���3�3�D�(�C�C��'��h�7�7�
��$�$�T�*�*�*��$�$�T�*�*�*��$�$�T�=�9�9�9��$�$�T�8�4�4�4��$�$�T�?�;�;�;��%�%�d�+�+�+����T�H�D�J��G�G�G����T�"�"�"��d�k�5�<�0�0�	'�� � ��&�&�&��d�j�j�l�l�E�L�1�1�	7�����o�6�6�6��"��F��z�	F�	F�G�D�!��s�{�{��)�)�$�?�3G�0P�0P�$�0P�0P�Q�Q�Q�Q��)�)�$��0D�E�E�E�E�		F�	Fr`c�V�|�|��\}}}t��}t��}d}||z|zD]�\}}	t|tj��r|n|}
|	�d��\}}}|rd||kr^||
vrZt
|��sKt|jtj��rt|j��s|�
d||���|}|j�d|j
��s��|
�|����g|_d|_dS)NrVr��rer$)�_check_imports_orderr�r|rr�	partitionrr�r�rr&r�r%r{�addrr)
rre�std_imports�ext_imports�loc_imports�
met_import�met_from�current_package�import_node�import_name�metr6r=s
             r^�leave_modulezImportsChecker.leave_module>sW��04�0I�0I�$�0O�0O�-��[�+� #�u�u�
� �U�U����(3�k�(A�K�(O�	�	�$�K��(��e�6F�G�G�W�(�(�Z�C�'�1�1�#�6�6�M�G�Q���

V�#�w�.�.��s�N�N�.�{�;�;�#��{�1�5�8�<�<�#�%�[�%7�8�8�	#�� � �!4�;�W� �U�U�U�%�O��;�1�1�#�[�%;���
���G�G�G����� ���&*��#�#�#r`��nodes.If | nodes.Expr | nodes.Comprehension | nodes.IfExp | nodes.Assign | nodes.AssignAttr | nodes.TryExcept | nodes.TryFinallyc���|jrdSt�jtj��sdStjtjg}�fd�|D��}|r:t��tj	tj
f����rdSt�tj��r"d��jD��}t|��rdS�|_dS)Nc�4��g|]}t�|���|��Srr)r|)r[�allowedres  �r^r_z@ImportsChecker.compute_first_non_import_node.<locals>.<listcomp>rs8���
�
�
��Z��g�5N�5N�
��
�
�
r`c��g|]P}t|tj��o3|j�d��o|j�d����QS)�__)r|r�
AssignNamerh�
startswith�endswith)r[�targets  r^r_z@ImportsChecker.compute_first_non_import_node.<locals>.<listcomp>|sg�������6�5�#3�4�4�/��K�*�*�4�0�0�/��K�(�(��.�.���r`)rr|r�rrF�	TryExcept�
TryFinallyr~�nodes_of_classr}r�Assign�targets�all)rre�nested_allowed�is_nested_allowed�
valid_targetss `   r^�compute_first_non_import_nodez,ImportsChecker.compute_first_non_import_node^s����&�	��F��$�+�u�|�4�4�	��F��/�5�+;�<��
�
�
�
�#1�
�
�
���	�������u�/?� @�A�A�"
�"
�	�
�F��d�E�L�)�)�
	���#�l�	���M��=�!�!�
���&*��#�#�#r`�<nodes.FunctionDef | nodes.While | nodes.For | nodes.ClassDefc���|jrdSt|j���tj��sdS|}t|jtj��s&|j}t|jtj���&t|tjtjtjf��r:t|�
tjtjf����rdS||_dSr)
rr|r�rzrrFr�rmrlr~rnr}r)rre�roots   r^�visit_functiondefz ImportsChecker.visit_functiondef�s����&�	��F��$�+�+�+�-�-�u�|�<�<�	��F����T�[�%�,�7�7�	��;�D��T�[�%�,�7�7�	��d�U�X�u�'7���I�J�J�	��4�&�&���e�6F�'G�H�H�I�I�
���&*��#�#�#r`c���|j}|dkrT|���}|r<t|tj��r|jdks|�d|���dSdS)N�
__future__r��re)rQ�previous_siblingr|rrr&)rrer��prevs    r^rNz&ImportsChecker._check_misplaced_future�sz���<���|�#�#��(�(�*�*�D��
D��t�U�%5�6�6�D�;?�<�<�;W�;W��$�$�%7�d�$�C�C�C��F�$�#r`c���d�|jD��}tj|��}|���D]*\}}|dkr|�d|||jf����+dS)Nc3� K�|]	\}}|V��
dSrrrr<s   r^ruz:ImportsChecker._check_same_line_imports.<locals>.<genexpr>�s&����0�0�'�$���0�0�0�0�0�0r`rYrprT)r]�collections�Counterr�r&r{)rrer]�counterrh�counts      r^rPz'ImportsChecker._check_same_line_imports�s|��0�0�T�Z�0�0�0���%�e�,�,��"�=�=�?�?�	X�	X�K�D�%��q�y�y�� � ��D��d�o�?V� �W�W�W��	X�	Xr`r
c��|jrt|j�d|jj��r,|�d||������dS|j�d|j|��dSdS)z�Check `node` import or importfrom node position is correct.

        Send a message  if `node` comes before another instruction
        r�rTN)rr�r%r{r&�	as_string�add_ignored_messager7s  r^rGzImportsChecker._check_position�s����&�
	��{�-�-�'��)D�)O���	
�� � �+�$�T�^�^�=M�=M�!��������/�/�+�T�_�d������
	�
	r`�importedmodnode�nodes.Module | Nonec�L�t|tj��r|j}n|r|jnd}|s,|jdd�d��d}t|tj��r|jpddkrd|z}|j�	||f��dS)z'Record the package `node` imports from.NrrVrY)
r|rrrQrhr]rarkrr�)rrer��importednames    r^rHzImportsChecker._record_import�s����d�E�,�-�-�	M��<�L�L�3B�L�?�/�/��L��	:��:�a�=��+�1�1�#�6�6�q�9�L��d�E�,�-�-�	.�4�:�?��q�2H�2H���-�L���"�"�D�,�#7�8�8�8�8�8r`�list[tuple[ImportNode, str]]r�c�R��d�|D��}t�fd�|D����S)Nc��g|]\}}|��Srrrr)r[r^r=s   r^r_z6ImportsChecker._is_fallback_import.<locals>.<listcomp>�s��?�?�?�#3�K��;�?�?�?r`c3�B�K�|]}tj|���V��dSr)r�r�)r[r^res  �r^ruz5ImportsChecker._is_fallback_import.<locals>.<genexpr>�s0�����W�W��7�(��d�;�;�W�W�W�W�W�Wr`)r~)rer�s` r^�_is_fallback_importz"ImportsChecker._is_fallback_import�s<���@�?�w�?�?�?���W�W�W�W�w�W�W�W�W�W�Wr`�_module_node�_tuple[list[tuple[ImportNode, str]], list[tuple[ImportNode, str]], list[tuple[ImportNode, str]]]c	��g}g}g}g}g}g}g}g}	t|jj��}
|jD�]$\}}|�d��rd|�d��dz}
n|�d��d}
t
|jtj	��}|j�
d|j��}|
�|
��}||
f}|dvr�|�
|��|p|p|	}|�||��r��|rT|sR|�d|d|����d�d|dd����d�f�����=|d	kr�|�
|��|�
|��|s9|s|�
|��n!|j�d|j|��|p|	}|rT|sR|�d|d
|����d�d|dd����d�f�����|dkr�|�
|��|�
|��|s9|s|�
|��n!|j�d|j|��|	}|rT|sR|�d|d|����d�d|dd����d�f������|d
krU|�
||
f��|s<|s|	�
||
f����|j�d|j|����&|||fS)z�Checks imports of module `node` are grouped by category.

        Imports must follow this order: standard, 3rd party, local
        rVrYrr�>�FUTURE�STDLIBzstandard import "�"rT�
THIRDPARTYzthird party import "�
FIRSTPARTYzfirst party import "�LOCALFOLDER)rr�rrrirar|r�rrFr%r{�place_moduler�r�r&r�r�)rr�rX�third_party_imports�first_party_imports�external_imports�
local_imports�third_party_not_ignored�first_party_not_ignored�local_not_ignored�isort_driverrerQr6�nested�ignore_for_import_order�import_category�node_and_package_import�wrong_imports                   r^rUz#ImportsChecker._check_imports_order�sI��57��<>��<>��9;��68�
�@B��@B��:<��"�4�;�#5�6�6��!�0�M	�M	�M�D�'��!�!�#�&�&�
0���
�
�c� 2� 2�1� 5�5���!�-�-��,�,�Q�/��#�D�K���>�>�>�F�*.�+�*H�*H�$�d�o�+�+�'�#�+�7�7��@�@�O�'+�W�o�#��"6�6�6��"�"�#:�;�;�;�+�)�.�)�(��
�+�+�D�,�?�?��������$�$�,�!�C����0@�0@�C�C�C�A��Q��� 2� <� <� >� >�A�A�A��%�����!�L�0�0�#�*�*�+B�C�C�C� �'�'�(?�@�@�@���2��/�6�6�7N�O�O�O�O���7�7�0�$�/�4���� 7�K�:K�������$�$�,�!�F�4�>�>�3C�3C�F�F�F�A��Q��� 2� <� <� >� >�A�A�A��%�����!�L�0�0�#�*�*�+B�C�C�C� �'�'�(?�@�@�@���2��/�6�6�7N�O�O�O�O���7�7�0�$�/�4���� 1�������$�$�,�!�F�4�>�>�3C�3C�F�F�F�A��Q��� 2� <� <� >� >�A�A�A��%�����!�M�1�1��$�$�d�G�_�5�5�5���2��)�0�0�$���A�A�A�A���7�7�0�$�/�4������,�m�;�;r`�
importnoderQrRc��	|�|��S#tj$r4t|||j��rYdS|�d|���Y�ntj$r;}d|�d|j�d�}|�d|j|t���Yd}~n�d}~wtj
$r�|j�d��sYdSt|||j��rYdS|jj
jst|��rYdSt!||��}|�dt#|��|�	��Ynt$$r}tj|�d}~wwxYwdS)
Nr�r|zCannot import z	 due to '�'zsyntax-error)�liner$�
confidencer�r?)�do_import_moduler��TooManyLevelsErrorr�rr&�AstroidSyntaxError�error�linenor�AstroidBuildingErrorr�r%r�analyse_fallback_blocksrr�repr�	Exception�AstroidError)rr�rQ�exc�message�dotted_modname�es       r^rEz#ImportsChecker._get_imported_moduleVs���	.��.�.�w�7�7�7���)�	K�	K�	K�%�j�'�4�;P�Q�Q�
��t�t����8�z��J�J�J�J�J��)�	�	�	�G�w�G�G�3�9�G�G�G�G�����Z�%6�W�QU�
�
�
�
�
�
�
�
�
������+�	Y�	Y�	Y��;�1�1�.�A�A�
��t�t�%�j�'�4�;P�Q�Q�
��t�t��K�&�>�
�*�:�6�6�
��t�t�,�Z��A�A�N����^�$�~�2F�2F�Z��X�X�X�X�X��	.�	.�	.��&�A�-�����	.�����tsD��%E�E�E�'1B�,E�E�% E�5E�?	E�
E�E�importedmodnameric��|���j}|���j}tj�tj�|����d}	tj�	||��}n#t$rYnwxYw||kr|�d|���d	Stj�|��s�|dkr-||j
vr$|�dd��d|j
|<|jjj}|�|t'����}||vr|�|��|j|�|��|j�d|j���rt1|��r$|j|�|��d	Sd	Sd	S)
z8Notify an imported module, used to analyze dependencies.rr�r|r�rVrYr�)r�N)rx�filerhr�r�r�r�r��modutils�get_module_partr�r&�is_stdlib_moduler�rsplitr�rr�r�r�rWrr%r�rr)rrer��module_file�context_namerj�dependencies_stat�importedmodnamess        r^rIz#ImportsChecker._add_imported_modulevs����i�i�k�k�&���y�y�{�{�'���w����� 0� 0�� =� =�>�>�q�A��	�%�.�>�>�����O�O���	�	�	��D�	�����?�*�*����]���6�6�6�6�6��!�2�2�?�C�C�	H��z�!�!�l�$�:J�&J�&J�2>�1D�1D�S�!�1L�1L�Q�1O�� ��.�6:�[�5F�5S��0�;�;�O�S�U�U�S�S���#3�3�3� �$�$�\�2�2�2�
��l�+�/�/��@�@�@��;�1�1��d�k�2���
H�'��-�-�
H��$�\�2�6�6��G�G�G�G�G�%	H�	H�
H�
Hs�6 B�
B$�#B$�mod_pathc����|g�t�tjjj��r�fd��jD����fd�|jD��}|r3|�d�|j|d|df���dSdS)z0Check if the module has a preferred replacement.c�4��g|]}�j�d|d����S�rVr)rQ�r[rhres  �r^r_z:ImportsChecker._check_preferred_module.<locals>.<listcomp>�s-���N�N�N�4�d�l�6�6�T�!�W�6�6�N�N�Nr`c�d��g|],}�D]'}||ks||�d��dv�%|��(�-Sr�r
)r[�kr��mod_compares   �r^r_z:ImportsChecker._check_preferred_module.<locals>.<listcomp>�s]���
�
�
��"�
�
���C�x�x��C�I�I�c�N�N�1�%�%�%�

�&�%�%�%r`r�rrTN)r|r�r�node_classesrr]rr&)rrer��matchesr�s `  @r^rDz&ImportsChecker._check_preferred_module�s����� �j���d�G�M�6�A�B�B�	O�N�N�N�N�4�:�N�N�N�K�
�
�
�
��+�
�
�
���	����"���,�W�Q�Z�8�'�!�*�E�
�
�
�
�
�
�	�	r`c��|j}|D]�}t|��sdS|d�dd���}|d}|d}||kr�Ht|��dkr0|jdus	|jdur|�d|t�����t|��d	kr |�d
||d|f�����dS)NrrVrY)�maxsplit���Fr�)rer�rIr�rT)r]rqr�rcrrr&r)rrer]rh�splitted_packagesr_�aliased_names       r^rAz&ImportsChecker._check_import_as_rename�s���
���	�	�D��t�9�9�
���� $�Q����s�Q�� ?� ?��+�B�/�K���7�L��l�*�*���$�%�%��*�*��,��5�5��/�5�8�8�� � �!7�d�t� �T�T�T�T��&�'�'�1�,�,�� � �0��+�A�.��<�!�����!	�	r`Nr�rkrlc
���|j�d��s|j�d��sdS|�d���}|���}||fg}||ur|�|df��|D]\\}}|jD]O\}	}
t
|||	|||
��\}}|�1|�/|dkr|	n|
}	|�|||	|jft����P�]dS)zDCheck if a module with the same name is already imported or aliased.rprvNT)�future)rer$r�)
r�r%�framerxr�r]r�r&r{r)
rrer�rkr�rx�contexts�
known_context�known_levelrhrmr�r�s
             r^r@zImportsChecker._check_reimport�s5���{�-�-��
�
�	��+�0�0�1B�C�C�	�
�F��
�
�$�
�'�'���y�y�{�{���E�N�#���u����O�O�T�4�L�)�)�)�*2�		�		�&�M�;�#�z�
�
���e�.��-��x��e���
��s��$���#&�,�#6�#6�4�4�E�D��$�$��$�d�E�4D�-E�RV�%�����

�		�		r`r�rr=r�_dummy�LinterStats | Nonec���t|j�����}|st���t	|��}|�t
|����dS)z5Return a verbatim layout for displaying dependencies.N)r��_external_dependencies_infor�rr�r�r)rr�r=r�r��tree_strs      r^rz,ImportsChecker._report_external_dependencies�sa��#�4�#C�#I�#I�#K�#K�L�L���	%�"�$�$�$�"�8�,�,�����L��*�*�+�+�+�+�+r`c��|jjj}|r3|jjjs0|jjjs|jjjst���|jjj}|rt|||d��|jjj}|rt||j	|d��|jjj}|rt||j
|d��dSdS)r�rWz	external z	internal N)r�rr�rr�ext_import_graph�int_import_graphrr�r��_internal_dependencies_info)rr�r=r�r�r�s      r^rz)ImportsChecker._report_dependencies_graph�s����;�$�1���	%��K��+�	%��{�!�2�	%��{�!�2�	%�
#�$�$�$��;�%�2���	6���(�D�"�5�5�5��;�%�6���	W���$�"B�D�+�V�V�V��;�%�6���	W���$�"B�D�+�V�V�V�V�V�	W�	Wr`�internalc�0�tt��}|jjj���D]]\}}|D]U}|j�||��}|�|��}|r|s|s|s||�	|���V�^|S)z4Build the internal or the external dependency graph.)
rr�r�rr�r�r�getrirW)rr�r'�importee�	importers�importerr6�	is_insides        r^�_filter_dependencies_graphz)ImportsChecker._filter_dependencies_graph	s���,7��,<�,<��#'�;�#4�#A�#G�#G�#I�#I�	2�	2��H�i�%�
2�
2���*�.�.�x��B�B��$�/�/��8�8�	��2��2��2�8�2��(�O�'�'��1�1�1��	
2�
�r`c�.�|�d���S)zYReturn cached external dependencies information or build and
        cache them.
        F�r��r�rs r^r�z*ImportsChecker._external_dependencies_infos��
�.�.��.�>�>�>r`c�.�|�d���S)zYReturn cached internal dependencies information or build and
        cache them.
        Tr�r�rs r^r�z*ImportsChecker._internal_dependencies_infos��
�.�.��.�=�=�=r`rJc���|���jrdS|�|��}|jD]*\}}|dkr|s|�d|j|����+dS)Nrwr�r?)rxr6�_wildcard_import_is_allowedr]r&rQ)rrerJ�wildcard_import_is_allowedrhr=s      r^rOz&ImportsChecker._check_wildcard_imports"s����9�9�;�;��	��F�%)�%E�%E�o�%V�%V�"��z�	R�	R�G�D�!��s�{�{�#=�{�� � �!2���D� �Q�Q�Q��	R�	Rr`c�>�|jjjo|duod|jvS)N�__all__)r�r�allow_wildcard_with_all�locals)rrJs  r^r�z*ImportsChecker._wildcard_import_is_allowed.s/���K��6�
4��t�+�
4��_�3�3�	
r`c����t����tj��rdS�fd��jD��}�fd�|D��}|r-��dd�|������dSdS)z=Check whether the import is made outside the module toplevel.Nc�x��g|]6}t�tj��r�j�d|d��n|d��7Sr�)r|rrrQr�s  �r^r_z2ImportsChecker._check_toplevel.<locals>.<listcomp><s]���
�
�
���$�� 0�1�1�
�t�|�'�'�d�1�g�'�'�'��a��
�
�
r`c�&��g|]
}|�jv�|��Srr)r)r[rhrs  �r^r_z2ImportsChecker._check_toplevel.<locals>.<listcomp>Ds-���
�
�
��T��9U�-U�-U�D�-U�-U�-Ur`r�r>r?)r|rzrrFr]r&rZ)rre�module_names�scoped_importss``  r^rBzImportsChecker._check_toplevel5s������d�j�j�l�l�E�L�1�1�	��F�
�
�
�
��
�	
�
�
��
�
�
�
�)�
�
�
���	����)��	�	�.�0I�0I�PT�
�
�
�
�
�
�	�	r`�r�rrSr�)rSr�)rSr)rSr*)rer4rSr�)rer9rSr�)rerLrSr�)rerbrSr�)rervrSr�)rer
rSr�)rer
r�r�rSr�)rer
r�r�rSr�)r�r4rSr�)r�r
rQrRrSr�)rer
r�rirSr�)rer
r�rirSr�rx)rer
r�rRrkrlrSr�)r�rr=rr�r�rSr�)r�r�rSr)rerLrJr�rSr�)rJr�rSr�)9�__name__�
__module__�__qualname__�__doc__rhr�DEPRECATED_MODULE_MESSAGEr��msgs�default_deprecated_modules�DEFAULT_PREFERRED_MODULES�DEFAULT_STANDARD_LIBRARY�DEFAULT_KNOWN_THIRD_PARTY�optionsr�rr!r)r,r8rKrRraru�visit_tryfinally�visit_tryexcept�visit_assignattr�visit_assign�visit_ifexp�visit_comprehension�
visit_expr�visit_ifry�visit_classdef�	visit_for�visit_whilerNrPrGrH�staticmethodr�rUrErIrDrAr@rrr�r"r�r�rOr�rBrrr`r^r�r�Ts����������D�@�o�7�@�4�@�D�!#��
!�5��&�)�	
�
�		
�
 �4��6�)�	
�
�		
�
���&�9�	
�
�
	
�
���&�9�	
�
�
	
�
���&�9�	
�
�
	
�
%�3��&�8�	
�
�		
�
 �4��&�)�	
�
�		
�
%���&�)�
�
�	
�
&� ��%�R�	
�
�	
�
*� ��%�T�	
�
�	
�h�G�T
�
�
�
�V�V�V�V�$����K�K�K�K�&�&�&�&�4�4�4�4�B�B�B�B�2F�F�F�F�8+�+�+�+�@&+�&+�&+�&+�`7T�T��T��T�	�T�
	�T�	�T�	�T�)�8�+�+�+�+�,0A�@�N�@�Y������X�X�X�X�����&9�9�9�9�2�X�X�X��\�X�c<�c<�c<�c<�J����@"H�"H�"H�"H�H����6����6 $� �	�����:,�,�,�,�W�W�W�W�*	�	�	�	��?�?�?��_�?��>�>�>��_�>�
R�
R�
R�
R�
�
�
�
������r`r�r�rc�J�|�t|����dSr)�register_checkerr�)r�s r^�registerrNs$��
���N�6�2�2�3�3�3�3�3r`)rQrRrSrT)rer
rfrgrhrirjrRrkrlrmrRrSrn)rer
rQrRr�r�rSr�)r�r�rSr�r)r�r�r�rRrSri)r�rir�r�rSri)
r�rir�r�r�rr�rirSr�r�)Grr{rr�rr�r.r�collections.abcrr�typingrrr	r
rr�r�astroid.nodes._base_nodesr
�pylint.checkersrr�pylint.checkers.utilsrrrrr�pylint.exceptionsr�pylint.graphrr�pylint.interfacesr�pylint.reporters.ureports.nodesrrr�
pylint.typingr�pylint.utilsr�pylint.utils.linterstatsr�pylint.lintrr/�	functoolsr"�astroid.decoratorsr#rir�r-rdr�r�r�r�r�r�r��__annotations__rrrr�rrrr`r^�<module>r's���
(�'�'�"�"�"�"�"�"���������	�	�	�	�
�
�
�
�#�#�#�#�#�#�/�/�/�/�/�/�/�/�8�8�8�8�8�8�8�8�8�8�8�8�8�8�����������0�0�0�0�0�0�8�8�8�8�8�8�8�8���������������/�.�.�.�.�.�/�/�/�/�/�/�/�/�"�"�"�"�"�"�L�L�L�L�L�L�L�L�L�L�0�0�0�0�0�0�$�$�$�$�$�$�0�0�0�0�0�0��%�$�$�$�$�$�$���v���)�)�)�)�)�)�)�D�D�D�D�D�D�
�3��d�4��S��>�2�D��I�=�>�>�?���x�(��|�(�)��w��}�0�0�0��{�8�8�8�7�7�7����"�"��J	C�	C�	C�	C�4�4�4�4�n5�5�5�5�,���������(&�&�&�&�&X�X�X�X�Z+����>�	�4�5�6�	�Z+���Z+���Z+�$��%Z+�4��5Z+�>��?Z+�H��IZ+�R��SZ+�\��]Z+�h��iZ+�r��sZ+�~��Z+�H��IZ+�R��SZ+�^��_Z+�j��kZ+��Z�Z�Z�Z�z��(����w�w�w�w�w�_�k�w�w�w�t4�4�4�4�4�4r`

Hacked By AnonymousFox1.0, Coded By AnonymousFox