????

Your IP : 18.222.183.63


Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/isort/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/isort/__pycache__/identify.cpython-311.pyc

�

�܋f� ����UdZddlmZddlmZddlmZmZmZm	Z	m
Z
ddlmZm
Z
mZddlmZddlmZmZd	Ze
ed
fed<Gd�d
e��Zeddfde	dedeededeef
d�ZdS)zVFast stream based import identification.
Eventually this will likely replace parse.py
�)�partial)�Path)�Iterator�
NamedTuple�Optional�TextIO�Tuple)�_normalize_line�
_strip_syntax�	skip_line�)�parse)�DEFAULT_CONFIG�Config)zdef zcdef zcpdef zclass �@z	async def.�STATEMENT_DECLARATIONSc��eZdZUeed<eed<eed<dZeeed<dZ	eeed<dZ
eed<dZeeed	<d
efd�Z
d
efd�ZdS)
�Import�line_number�indented�moduleN�	attribute�aliasF�cimport�	file_path�returnc��|jrdnd}|jrd|j�d|�d|j��}n|�d|j��}|jr
|d|j��z
}|S)Nr�import�from � z as )rrrr)�self�
import_cmd�
import_strings   �_/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/isort/identify.py�	statementzImport.statementsy��"&�,�<�Y�Y�H�
��>�	:�O�D�K�O�O�*�O�O�t�~�O�O�M�M�)�9�9�D�K�9�9�M��:�	1��0�D�J�0�0�0�M���c�h�|jpd�d|j�d|jrdnd�|�����S)N��:r z	indented )rrrr%)r!s r$�__str__zImport.__str__#s[���~�#��
H�
H�d�&6�
H�
H�"�m�3�{�{��
H�59�^�^�5E�5E�
H�
H�	
r&)�__name__�
__module__�__qualname__�int�__annotations__�bool�strrrrrrrr%r*�r&r$rrs�������������N�N�N��K�K�K�#�I�x��}�#�#�#��E�8�C�=�����G�T���� $�I�x��~�$�$�$��3�����
��
�
�
�
�
�
r&rNF�input_stream�configr�top_onlyrc
#��K�d}t|��}|D�]Z\}}t||||j���\}}|r|s|�t��rdS|r�E|����d��d}	|	�d��s|	�d��r�|	dkra|	r|	dkrY	t|��\}}
n#t$rYn9wxYw|
����d��d}	|	�S|	dk�Y|	�	d��rf	t|��\}}
n#t$rYnFwxYw|
����d��d}	|	�	d���f���|�dd��^}}d	�|�d
��D��}
|r|
d�d|d��|
d<|
D�]�}t|��\}}|�d��rd
}n|�d��rd}n�Ft|��\}}|�dd���dd���dd��}d|vp|�d��}tt|dz|�d��||���}d|�dd��dvr�|�d��d����	d��s~	t|��\}}
n#t$rYn^wxYwt|
��\}}|d|zz
}|�d��d����	d���~�n|����	d���r�	t|��\}}
n#t$rY�n�wxYwt|
��\}}d|�d��dvr�d|�d��dvr�|d|zz
}|�d��d����	d��s~	t|��\}}
n#t$rYn^wxYwt|
��\}}|d|zz
}|�d��d����	d���~n�|����	d��s'|����d��r	|d|zz
}n?|����d��dz|���z}|����	d�����|dkr�|�dd���dd���dd��}|�|rdnd��}|d�d��}|rdnd�|ddzd�|dd���zg|dd�z��}d�t%|�����D��}|dd�}d}d|v�ri|�d��dzt)|��k�r?d|v�r:d}|�d��}|dkr�||dz
}|d}|dz|z}||dz}|�|��|�|��|�d��||dd�<||kr|jr|||��V�n�||||� ��V�n||dz
}||dz}|�|��|�d��|�|��||kr|jr||��V�n|||� ��V�d|v��:|rB|dkr*|�d��}|D]}|||��V����u|D]}||��V�������\dS)!z9Parses a python file taking out and categorizing imports.r()�in_quote�index�section_comments�#r�raise�yield�\r
c�6�g|]}|�����Sr2)�strip)�.0�lines  r$�
<listcomp>zimports.<locals>.<listcomp>Rs ��?�?�?�t�d�j�j�l�l�?�?�?r&�;���)zimport zcimport �straightr�fromzimport(zimport (r �
z	 cimport r)r �	)rr�(�))z importz cimportz import Nc�b�g|],}|�dd���dd����-S)z{|z{ z|}z })�replace)r@�items  r$rBzimports.<locals>.<listcomp>�sF���������T�4�(�(�0�0��t�<�<���r&�as�.)r)�	enumeraterr9�
startswithrr?�split�next�
StopIteration�endswithr
�parse_commentsrLrr�rstrip�lstrip�joinrr8�len�remove�remove_redundant_aliases�pop)r3r4rr5r7�
indexed_inputr8�raw_line�
skipping_line�
stripped_line�	next_linerA�end_of_line_comment�
statementsr%�	_raw_line�type_of_importr#�_�normalized_import_string�cimports�identified_import�parts�from_import�just_imports�direct_imports�top_level_moduler�as_indexrrs                               r$�importsrq*s�	�����H��l�+�+�M�(�Z8�Z8���x�$-��x�u�v�G^�%
�%
�%
�!����	�H�	��)<�)<�=S�)T�)T�	��E�E��	�� ���(�(�.�.�s�3�3�A�6�
��#�#�G�,�,�	�
�0H�0H��0Q�0Q�	���'�'�'�D�=�G�+C�+C��+/�
�+>�+>�(��y�y��(����������%.�O�O�$5�$5�$;�$;�C�$@�$@��$C�M�
(�D�=�G�+C�+C� �(�(��.�.�
@��'+�M�':�':�$�E�9�9��$�����E�����!*��� 1� 1� 7� 7�� <� <�Q� ?�
�
 �(�(��.�.�
@�
�%-�^�^�C��%;�%;�"��"�?�?�t�z�z�#���?�?�?�
��	J� *�2��I�I�1D�Q�1G�I�I�J�r�N�#�x	8�x	8�I�-�i�8�8�O�D�)����6�7�7�
�!+�������)�)�
�!'����-�d�3�3��M�1��%�%�i��<�<�D�D�T�3�O�O�W�W�X\�^a�b�b�
%��7�7�B�+�6�6�y�A�A�
�!(����	��#�#�K�0�0� �#�!�!�!���d�j�j��a�(�(��+�+�+��*�*�S�/�/�!�,�2�2�4�4�=�=�c�B�B�1��+/�
�+>�+>�(��y�y��(����������-�Y�7�7�G�D�!�!�T�D�[�0�M��*�*�S�/�/�!�,�2�2�4�4�=�=�c�B�B�1���j�j�l�l�+�+�D�1�1���+/�
�+>�+>�(��y�y��(����������-�Y�7�7�G�D�!��d�j�j��o�o�a�0�0�0�S��
�
�3���PQ�@R�5R�5R�%����4�
�"&�*�*�S�/�/�!�"4�":�":�"<�"<�"E�"E�c�"J�"J�9�&�37�
�3F�3F� 0��y�y��#0�&�&�&� %��&����&4�Y�&?�&?�G�D�!�)�T�D�[�8�M�
#'�*�*�S�/�/�!�"4�":�":�"<�"<�"E�"E�c�"J�"J�9��)�.�.�0�0�9�9�3����!�Z�Z�\�\�4�4�5L�M�M��*�T�D�[�8�M�M�!.� 4� 4� 6� 6� =� =�d� C� C�c� I�D�K�K�M�M� Y�*�3�j�j�l�l�+�+�D�1�1��:��'�'�!�)�)�)�Z�@�@��W�T�3�'�'��W�T�3�'�'��
&�+�+�8�,S�K�K��T�T��#�A�h�n�n�S�1�1��08�!H���j� N� N� ��^�c�)�B�G�G�K����O�,D�,D�D�E��a�b�b�	�Q�!�!�
���)�-�8�8�>�>�@�@����L�
*�!�"�"�-�N�!���|�#�#��);�);�D�)A�)A�A�)E��\�IZ�IZ�(Z�(Z��l�*�*� $�I�+�1�1�$�7�7�H�%��/�/�$0��A��$>�	�+7��?�(�!1�C�!7�)�!C�� ,�X��\� :��&�-�-�i�8�8�8�&�-�-�e�4�4�4�&�-�-�d�3�3�3�+9��Q�R�R�(�$��-�-�&�2Q�-�"3�"3�4D�i�"P�"P�P�P�P�P�"3�"3�4D�i�W\�"]�"]�"]�]�]�]�]�".�h��l�!;�� ,�X��\� :��$�+�+�E�2�2�2�$�+�+�D�1�1�1�$�+�+�F�3�3�3�!�U�?�?�v�/N�?�"3�"3�F�";�";�;�;�;�;�"3�"3�F�%�"H�"H�"H�H�H�H�5�l�*�*�8�
8�!�V�+�+�)�-�-�a�0�0�F�%1�C�C�	�/�/��	�B�B�B�B�B�B�C�#/�8�8��/�/��7�7�7�7�7�7��qx	8�EZ8�Z8sZ�C�
C!� C!�/E�
E�E�$L7�7
M�M�O�
O-�,O-�R�
R%�$R%)�__doc__�	functoolsr�pathlibr�typingrrrrr	�isort.parser
rr�commentsrrV�settingsrrrr1r/rr0rqr2r&r$�<module>rys`�����������������@�@�@�@�@�@�@�@�@�@�@�@�@�@�A�A�A�A�A�A�A�A�A�A�-�-�-�-�-�-�,�,�,�,�,�,�,�,�*a���c�3�h��a�a�a�
�
�
�
�
�Z�
�
�
�8$� $��	d8�d8��d8��d8���~�d8��	d8�
�f��d8�d8�d8�d8�d8�d8r&