403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/jedi/inference/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/jedi/inference/__pycache__/imports.cpython-312.pyc
�

Še*Z����dZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	l
mZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZmZddlmZmZddlmZm Z m!Z!ddl"m#Z#ddl$m%Z%Gd�d�Z&ee��d��Z'eg��d��Z(d�Z)d�Z*d�Z+Gd�d�Z,		d(d �Z-e%j\�ed!���Z/	d)d"�Z0d*d#�Z1d*d$�Z2d%�Z3d&�Z4edfd'�Z5y)+a�
:mod:`jedi.inference.imports` is here to resolve import statements and return
the modules/classes/functions/whatever, which they stand for. However there's
not any actual importing done. This module is about finding modules in the
filesystem. This can be quite tricky sometimes, because Python imports are not
always that simple.

This module also supports import autocompletion, which means to complete
statements like ``from datetim`` (cursor at the end would return ``datetime``).
�N)�Path)�tree)�search_ancestor)�debug)�settings)�FolderIO)�get_cached_code_lines)�sys_path)�helpers)�compiled)�analysis)�unite)�inference_state_method_cache)�
ImportName�
SubModuleName)�ValueSet�	NO_VALUES)�import_module_decorator�create_stub_module�parse_stub_module)�ImplicitNSInfo)�plugin_managerc��eZdZd�Zd�Zd�Zy)�ModuleCachec��i|_y�N��_name_cache��selfs �8/usr/lib/python3/dist-packages/jedi/inference/imports.py�__init__zModuleCache.__init__$s
�����c�(�|�||j|<yyrr)r �string_names�	value_sets   r!�addzModuleCache.add's���#�-6�D���\�*�$r#c�8�|jj|�Sr)r�get)r r%s  r!r)zModuleCache.get+s�����#�#�L�1�1r#N)�__name__�
__module__�__qualname__r"r'r)�r#r!rr#s���7�2r#r)�defaultc��|j�}t||�\}}}}|rF|�D|j||d��}|s.||fz}t|j|||�}|j�}t
jd|�|S)NF��name_context�analysis_errorszafter import: %s)�get_root_context�_prepare_infer_import�py__getattribute__�Importer�inference_state�followr�dbg)	�context�	tree_name�module_context�from_import_name�import_path�level�values�path�importers	         r!�infer_importrC1s����-�-�/�N��n�i�8�1��k�5�&�
��'��.�.� �$� %�/��F��"�&6�%8�8��#�G�$;�$;�T�>�SX�Y��!���*��	�I�I� �&�)��Mr#c
�b��|j�}t|��\}}}}|sgS|�qt|D�cgc]}|j||d����c}�}|rt	�fd�|D��s|S||fz}	t|j|	||�}
|
j�}td�|D��Scc}w)NFr0c3�:�K�|]}|j�u���y�wr)r;)�.0�nr;s  �r!�	<genexpr>zgoto_import.<locals>.<genexpr>Xs�����E�!�Q�[�[�I�5�E�s�c3�4K�|]}|j���y�wr)�name)rF�ss  r!rHzgoto_import.<locals>.<genexpr>^s����&�!�q�v�v�&�s�)	r3r4r�goto�anyr6r7r8�set)r:r;r<r=r>r?r@�c�namesrArBs `         r!�goto_importrQGs�����-�-�/�N��n�i�8�1��k�5�&���	��#��
�
�
�	
�F�F� �$� %�
�
�
�����E�u�E�E��L��.�0�0���G�3�3�T�>�5�Q�����"���&�v�&�&�&��
s�B,c�j�t|dd�}|j|�}d}	|j�}t|�dzt|�k(r|d}|}	t|jt|�||j�}|t|�|j|j�fS#t$rY�]wxYw)N�import_name�import_from����)
r�get_path_for_name�get_from_names�len�AttributeErrorr6r7�tupler?r8)r<r;�import_noder>r=�
from_namesrBs       r!r4r4as���!�)�]�M�J�K��/�/�	�:�K���
%� �/�/�1�
�
�z�?�Q��#�k�"2�2� +�2���$�K���6�6��k�8J�&��(9�(9�;�H��U�;�/��1B�1B�H�O�O�DU�U�U���
��
�s�B&�&	B2�1B2c��t|d�r|�tj|d||�ytjd|z�y)N�parentzimport-errorzImportError without origin: )�hasattrr
r'r�warning)�valuerJ�messages   r!�
_add_errorrdws5���t�X��5�#4����U�N�D�'�:�
�
�
�4�w�>�?r#c�D�t|dz
�D]*}|}tjj|�}||k(s�*y|}g}	||k(r||fStjj	|�}|r2|jd|�tjj|�}nd|fS�a)z�
    In case the level is outside of the currently known package (something like
    import .....foo), we can still try our best to help the user for
    completions.
    rU�NNrN)�range�osrA�dirname�basename�insert)�project_path�	directoryr?�i�old�d�level_import_paths�dir_names        r!�_level_to_base_import_pathrs~s����5�1�9�
������G�G�O�O�I�.�	��)���	�	�A�������%�q�(�(��7�7�#�#�A�&����%�%�a��2�������"�A���?�"�r#c�@�eZdZdd�Zed��Zd�Zd�Zd	d�Zd
d�Z	y)r6c��tjd|�d|���||_||_||_d|_d|_|r�|j�j�}|t|�kr/t|�}|dkDr	|d|dz}|t|�z}||_y|j�}|jjj}t|�}|�|}ntjj!|�}t#|||�\}	}
|
�d|_n|
g|_|	�|rt%||dd�	�||_y|	|z}||_y)
a
        An implementation similar to ``__import__``. Use `follow`
        to actually follow the imports.

        *level* specifies whether to use absolute or relative imports. 0 (the
        default) means only perform absolute imports. Positive values for level
        indicate the number of parent directories to search relative to the
        directory of the module calling ``__import__()`` (see PEP 328 for the
        details).

        :param import_path: List of namespaces (strings or Names).
        zimport � NTrUFrz3Attempted relative import beyond top-level package.)rc)r�speed�_inference_stater?�_module_context�_fixed_sys_path�_infer_possible�	get_value�
py__package__rYr[�
py__file__�projectrA�listrhrirsrdr>)r r7r>r<r?�baserArlrm�base_import_path�base_directorys           r!r"zImporter.__init__�s^��	���k�>�B�C� /�����
�-���#���#����!�+�+�-�;�;�=�D���D�	�!��T�{���1�9���%��!��,�D�"�U�;�%7�7��@'���=&�0�0�2��#�4�4�<�<�A�A��"�;�/���<�
!-�I� "������ 5�I�3M� �)�U�4�0� �.�"�)�,1�D�(�,:�+;�D�(�#�+�"�"�*�K��N�$Y��'���#3�[�"@�K�&��r#c�:�td�|jD��S)z:Returns the import path as pure strings instead of `Name`.c3�lK�|],}t|tj�r|jn|���.y�wr��
isinstancer�Namerb)rFrJs  r!rHz,Importer._str_import_path.<locals>.<genexpr>�s.����
��%�T�4�9�9�5�D�J�J�4�?�
���24)r[r>rs r!�_str_import_pathzImporter._str_import_path�s$���
��(�(�
�
�	
r#c���|j�|jS|jj|��tj|j
�D�cgc]
}t
|���c}zScc}w)N)�add_init_paths)rzrx�get_sys_pathr
�check_sys_path_modificationsry�str)r �
is_completion�ps   r!�_sys_path_with_modificationsz%Importer._sys_path_with_modifications�so�����+��'�'�'�
�!�!�.�.�-�>O�.�P��8�8��9M�9M�N����A���
�			
��
s�A-c�z�|jsp|jr^ddlm}tj
j
|jd�f}||j||j��}t|h�StS|jstS|jjj|j�}|�t|h�S|jjj|j�}|�|S|jd��}t!|j|j||j"�S)Nr��ImplicitNamespaceValue�r%�pathsF�r�)r>rz�jedi.inference.value.namespacer�rhrArjrxrrr{�stub_module_cacher)r��module_cacher��import_module_by_namesry)r r�r>�ns�
from_cacher
s      r!r8zImporter.follow�s������#�#�2R�!�w�w�/�/��0D�0D�Q�0G�H�J��+��)�)�!,��.�.���
 ���~�%����#�#����*�*�<�<�@�@��AV�AV�W�
��!��Z�L�)�)��*�*�7�7�;�;�D�<Q�<Q�R�
��!����4�4�5�4�I��%��!�!�4�#3�#3�X�t�?S�?S�
�	
r#Nc
��|�|jd��}n|}tt|j|j||�t
nt|duxr|du���S)z�
        Get the names of all modules in the search_path. This means file names
        and not names defined in the files.
        NTr�)�
module_cls�add_builtin_modules)r�r��iter_module_namesrxryrr)r �search_path�	in_moduler
s    r!�_get_module_nameszImporter._get_module_names,sf��
���8�8�t�8�L�H�"�H��%��!�!�4�#7�#7��%.�%6�z�M� +�t� 3� I�	�T�8I�
��	r#c��|jsgSg}|j�r}|jdk(r�|j�D]S}|j}|jd�s�!|t
d�d}|jt|j|���U|jd��D]W}tjj|d�}tjj|�s�C||j|g�z
}�Y|j�}	|	D]C}
|
j dvr�|
j#�r�#||
j%�j'�z
}�E|s@dd	lm}|	||	�z}|D]*}
|
j-�D]}||j'�z
}��,|S|j.r ||j|j0�z
}|S||j�z
}|S)
z�
        :param only_modules: Indicates wheter it's possible to import a
            definition that is not defined in a module.
        )�flask�ext�flask_NTr��flaskext)�module�	namespacer)�convert_values)r{r>r�r��string_name�
startswithrY�appendrryr�rhrA�join�isdirr8�api_type�is_compiled�sub_modules_dictr@�!jedi.inference.gradual.conversionr��get_filtersr?rz)r r7�only_modulesrP�mod�modname�extname�dirr�r@rbr��both_valuesrO�filters               r!�completion_nameszImporter.completion_names;s���
�#�#��I�������$�$�(8�8��1�1�3�P�C�!�o�o�G��)�)�(�3�")�#�h�-�.�"9�����Z��0D�0D�g�%N�O�	P� �<�<�4�<�P�D�C�!�w�w�|�|�C��<�H��w�w�}�}�X�.���!7�!7��
�!C�C��D�
�[�[�]�F��
?���>�>�)@�@���(�(�*��U�3�3�5�<�<�>�>�E�

?� �L�$�~�f�'=�=��$�1�A�"#�-�-�/�1�������0��1�1���
�z�z���/�/��0D�0D�E�E������/�/�1�1���r#)rrf)F)
r*r+r,r"�propertyr�r�r8r�r�r-r#r!r6r6�s2��D'�L�
��
�

�3
�j
�/r#r6Tc
��|�|j�}td�|D��}dg}t|�D]�\}}tj|D�	cgc]}	t||d|dz|	||����c}	�}|r�@ddj
|�z}
|�t|||
�tcStj|
�tcS|Scc}	w)Nc3�lK�|],}t|tj�r|jn|���.y�wrr�)rFrns  r!rHz)import_module_by_names.<locals>.<genexpr>rs.�����
��a����+�����2��r�rU)�prefer_stubszNo module named �.)r�r[�	enumerater�	from_sets�
import_moduler�rdrrar)r7�import_namesr
r<r��str_import_namesr&rnrJ�parent_module_valuercs           r!r�r�ms�����"�/�/�1����������I��\�*����4��&�&�*3�(
�&�

�� ��!�A�#�&�#��)�
�(
��	��(�3�8�8�4D�+E�E�G��)��>�4��9����
�
�g�&���!�"���!(
s�B>
c���|dtjvr!t|||�}|�tSt	|g�Sdj|�}|�-|jj|d||d��\}}|�KtS|j�}|�tS|jj|d||d��\}}|�tSt|t�r>ddlm}	|	|t|jjd��|j �	�}n&|�t|||�}|�tSt#||||�
�}|�t%j&d|d|�nt%j&d||�t	|g�S)
zC
    This method is very similar to importlib's `_gcd_import`.
    rr�rVT)�string�	full_namer
�is_global_searchF)r�rAr�r�r�r��r��
is_packagezglobal search_module %s: %sz search_module %s in paths %s: %s)r�auto_import_modules�_load_builtin_modulerrr��compiled_subprocess�get_module_info�
py__path__r�rr�r�r[rJ�splitr��_load_python_modulerr9)
r7r�r�r
r��module_name�
file_io_or_ns�is_pkgr�r�s
          r!r�r��s����A��(�6�6�6�%�o�|�X�N���>������!�!��(�(�<�(�K��"�!0� C� C� S� S���#�!��!�	!T�!
��
�v��>���#�.�.�0���=��� /� C� C� S� S���#��!�"�	!T�!
��
�v��>����-��0�I�'���}�1�1�7�7��<�=��%�%�
��

�	�%�o�|�X�N���>���$��]�%��
���"�
�	�	�/��b�1A�6�J�
�	�	�4�k�5�&�Q��V�H��r#c
���|j|dtjtj��}ddlm}|||||t
|j|j�|��S)NT)�file_io�cache�
diff_cache�
cache_pathr)�ModuleValue)r�r%�
code_linesr�)	�parser�fast_parser�cache_directory�jedi.inference.valuer�r	�grammarrA)r7r�r�r��module_noder�s      r!r�r��sc��!�'�'����'�'��+�+�	(��K�1�����!�(��)@�)@�'�,�,�O���r#c��|j}|�|j�}|js%|j|�}|D�cgc]	}||vs�|��}}dj	|�}|�J�tj|||��}|�y|Scc}w)Nr�)�dotted_namer
)rr��_load_unsafe_extensions�_get_base_sys_pathr�r�load_module)r7r�r
r�
safe_pathsr�r�r�s        r!r�r��s����%�%�G���"�/�/�1���*�*��/�/��@�
�'�;�!�1�
�?�A�;��;��(�(�<�(�K��"�"�"�
�
!�
!�/�{�U]�
^�F�
�~���M��<s�	B�
Bc	���t|j�}|�*|j�}tj||�\}}nt|t�sJ�|jdk(}|r�|j�}|jjd�rt|jdd�}|jdk(r|jd�}n|j|ddz�}	t||||�	�}	t|	g�}
t#||j$|
t'||�||�St)||||�
�}|j*j-|t|g��|S#t$r	t }
Y�lwxYw)z�
    This should pretty much only be used for get_modules_containing_name. It's
    here to ensure that a random path is still properly loaded into the Jedi
    module structure.
    Nz.pyiz-stubsi����z__init__.pyiz__init__.pyrVz.py)r�r�)rrAr�r
�transform_path_to_dottedr��bool�suffix�get_parent_folder�endswithrrJ�get_file_io�load_module_from_pathr�FileNotFoundErrorrr�latest_grammarrr�r�r')r7r�r�r�rA�
e_sys_path�is_stub�	folder_io�python_file_io�vr@r�s            r!r�r��sk�������D���$�1�1�3�
�#+�#D�#D�Z�QU�#V� ��j��*�d�+�+�+��k�k�V�#�G���-�-�/�	��>�>�"�"�8�,� ������!4�5�I��9�9��&�&�2�2�=�A�N�&�2�2�<��3C�e�3K�L�N�	�%������A��q�c�]�F�"��_�;�;�V��o�w�7��,�
�	
�
%��W�%�!�
��
	�$�$�(�(��x���7I�J��
��!�	��F�	�s�!E�E)�(E)c��tj|j�t|j��\}}ddlm}||||jg�S)Nrr�)r
r�r�rrAr�r�)r7r�r�r�r�s     r!�load_namespace_from_pathr�sK��'�@�@��$�$�&��Y�^�^�� ��L�*�F�!�/�<�)�.�.�AQ�R�Rr#c���tj|d�}|��d}t|j�D]+\}}|j|jkDrn
|dk(s�'|dz}�-|j|d}|dj�j}|dvrT|dk(}tj|||��\}	}
t|j|
|j�|	�j�Sy)N�
error_noder�;rU)�from�importr)�is_import_from�
until_node)
rrr��children�	start_pos�get_first_leafrbr�parse_dotted_namesr6r7r3r8)r:rJr�start_index�indexrG�nodes�
first_namerr?rPs           r!�%follow_error_node_imports_if_possibler's����%�%�d�L�9�J�����!�*�"5�"5�6�	(�H�E�1��{�{�T�^�^�+���C�x�#�a�i��		(�
�#�#�K�L�1���1�X�,�,�.�4�4�
��+�+�'�6�1�N�"�5�5��-���L�E�5�
��'�'���0H�0H�0J�E�S�SY�SY�S[�
\�r#c#�K�|r*|jj�D]
}|||����|jj|�D]
}|||����y�w)zx
    Get the names of all modules in the search_path. This means file names
    and not names defined in the files.
    N)r��get_builtin_module_namesr�)r7r<r�r�r�rJs      r!r�r�Dse�����#�7�7�P�P�R�	3�D��^�T�2�2�	3� �3�3�E�E�k�R�/�����.�.�/�s�AA)NNT)NFrf)6�__doc__rh�pathlibr�parso.pythonr�
parso.treer�jedirr�jedi.file_ior�jedi.parser_utilsr	�jedi.inferencer
rrr
�jedi.inference.utilsr�jedi.inference.cacher�jedi.inference.namesrr�jedi.inference.base_valuerr�jedi.inference.gradual.typeshedrrr�,jedi.inference.compiled.subprocess.functionsr�jedi.pluginsrrrCrQr4rdrsr6r��decorater�r�r�r�r�rr�r-r#r!�<module>r!s	��	�
���&���!�3�#�"�#�#�&�=�:�9�*�*�G�'�	2�	2��i�0��1��*�b�)�'�*�'�2V�,@�#�6Q�Q�hDH�=A��<������;���;�~7<��&�$+�\S��<",��/r#

Youez - 2016 - github.com/yon3zu
LinuXploit