403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/jedi/inference/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/jedi/inference/__pycache__/context.cpython-311.pyc
�

p�{cC����ddlmZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZmZddlmZmZdd	lmZmZdd
lmZddlmZddlmZGd
�d��ZGd�de��ZGd�d��ZGd�dee��ZGd�dee��ZGd�dee��Z Gd�dee��Z!Gd�dee��Z"Gd�de��Z#Gd�d e#��Z$d!�Z%d"�Z&d#S)$�)�abstractmethod)�contextmanager)�Path)�Optional)�search_ancestor)�Name)�ParserTreeFilter�MergedFilter�GlobalNameFilter)�AnonymousParamName�TreeNameDefinition)�	NO_VALUES�ValueSet)�get_parent_scope)�debug)�parser_utilsc���eZdZd�Zedd���Zd�Z		dd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zed���Zd�Zed���Zd�Zd�Zed���ZdS)�AbstractContextc�"�||_i|_dS�N)�inference_state�predefined_names)�selfrs  �8/usr/lib/python3/dist-packages/jedi/inference/context.py�__init__zAbstractContext.__init__s��.��� "�����Nc��t�r��NotImplementedError�r�until_position�origin_scopes   r�get_filterszAbstractContext.get_filters���!�!rc��ddlm}t|t|t��r|nd|��}|�||��}t
jd|||��|S)Nr)�finderzcontext.goto %s in (%s): %s)�jedi.inferencer&�_get_global_filters_for_name�
isinstancer�filter_namer�dbg)r�name_or_str�positionr&�filters�namess      r�gotozAbstractContext.gotosp��)�)�)�)�)�)�.���K��!>�!>�H�+�+�D�(�
�
���"�"�7�K�8�8��
�	�/��d�E�J�J�J��rTc��|�|}|�||��}t|t��r|jn|}d}|jr|t|t��rg|}|�ctj|��sO|j}|jdvr)	|j|}	|	|}
|
}n&#t$rY�KwxYw|�tj|���O|�9|r7ddl
m}|�||j
|���}||jurt}
n!|}
nt!jd�|D����}
|s<|
s:|r8t|t��r#ddl
m}d|z}|�|d	||��t)jd
||
��|
r|
S|�|||��S)zZ
        :param position: Position of the last statement -> tuple of line, column
        N)�if_stmt�for_stmt�comp_for�
sync_comp_forr)�
flow_analysis)�context�value_scope�nodec3�>K�|]}|���V��dSr)�infer)�.0�names  r�	<genexpr>z5AbstractContext.py__getattribute__.<locals>.<genexpr>Ms*����'G�'G���
�
���'G�'G�'G�'G�'G�'Gr)�analysisz$NameError: name '%s' is not defined.z
name-errorz context.names_to_types: %s -> %s)r0r)r�valuerr�is_scope�parent�type�KeyErrorr'r6�reachability_check�	tree_node�UNREACHABLErr�	from_setsr?�addrr+�_check_for_additional_knowledge)rr,�name_contextr-�analysis_errorsr/�string_name�found_predefined_typesr9�	name_dict�typesr6�check�valuesr?�messages                r�py__getattribute__z"AbstractContext.py__getattribute__&s��
���L��	�	�+�x�0�0��+5�k�4�+H�+H�Y�k�'�'�k��"&��� �	�Z��T�%B�%B�	��D��"�<�+@��+F�+F�"��{���9� T�T�T��$(�$9�$�$?�	� )�+� 6��27�.���	$�!�!�!� ��!����
�"�<�+@��+F�+F�"�"�-�%�-�4�4�4�4�4�4�!�4�4�� �N� �5���E�
�
�1�1�1�"���/����'�'G�'G��'G�'G�'G�G�G�F��	O�V�	O��	O��+�t�,�,�
O�3�3�3�3�3�3�A�K�O�����\�<��g�N�N�N�
�	�4�e�V�D�D�D��	��M��3�3�K��x�X�X�Xs�B�
B%�$B%c��|p|}t|t��rn|���sZ|}|jg}t	d�|D����rt
Sddlm}	t|d���}|||||��}|�|S||vrn�)t
S)Nc3�(K�|]
}|jdvV��dS)�r4r5N)rC)r<�bs  rr>zBAbstractContext._check_for_additional_knowledge.<locals>.<genexpr>as*����O�O�q�1�6�:�:�O�O�O�O�O�Orr)�check_flow_informationT)�
include_flows)	r)r�is_instancerF�anyr�jedi.inference.finderrYr)rr,rKr-�
flow_scope�
base_nodesrY�ns        rrJz/AbstractContext._check_for_additional_knowledgeZs���#�+�t���k�4�(�(�	��1I�1I�1K�1K�	�$�J�&�0�1�J��O�O�J�O�O�O�O�O�
!� � �D�D�D�D�D�D�
�-�j��M�M�M�
�*�*�<��+6��B�B���=��H���+�+��
��rc�@�|j}|�|S|���Sr)�parent_context�get_root_context)rrbs  rrcz AbstractContext.get_root_contextns'���,���!��K��.�.�0�0�0rc��dS�NF��rs r�	is_modulezAbstractContext.is_modulet����urc��dSrerfrgs r�is_builtins_modulez"AbstractContext.is_builtins_modulewrirc��dSrerfrgs r�is_classzAbstractContext.is_classzrirc��dSrerfrgs r�is_stubzAbstractContext.is_stub}rirc��dSrerfrgs rr[zAbstractContext.is_instance�rirc��dSrerfrgs r�is_compiledzAbstractContext.is_compiled�rirc��dSrerfrgs r�is_bound_methodzAbstractContext.is_bound_method�rirc��t�rrrgs r�
py__name__zAbstractContext.py__name__�r$rc��t�rrrgs r�	get_valuezAbstractContext.get_value�s��!�!rc��dSrrfrgs rr=zAbstractContext.name�s���trc��dS)Nrfrfrgs r�get_qualified_namesz#AbstractContext.get_qualified_names�����rrc��dS)N�rfrgs r�	py__doc__zAbstractContext.py__doc__�r|rc#�BK�|j}|||<	dV�||=dS#||=wxYwr)r)rr^�dct�
predefineds    r�predefine_nameszAbstractContext.predefine_names�sH�����*�
�!$�
�:��	'��E�E�E��:�&�&�&��
�:�&�&�&�&�&s���NN)NNT)�__name__�
__module__�__qualname__rrr#r0rTrJrcrhrkrmror[rrrtrvrx�propertyr=r{rrr�rfrrrrsz������#�#�#��"�"�"��^�"����KO�+/�2Y�2Y�2Y�2Y�h���(1�1�1�����������������������"�"��^�"�"�"�"�����X���������'�'��^�'�'�'rrc���eZdZdZ�fd�Zed���Zed���Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zed
���Zd�Zd�Zd�Zd�Z�xZS)�ValueContextzC
    Should be defined, otherwise the API returns empty types.
    c�b��t���|j��||_dSr)�superrr�_value)rr@�	__class__s  �rrzValueContext.__init__�s)���
������.�/�/�/�����rc��|jjSr)r�rFrgs rrFzValueContext.tree_node�s
���{�$�$rc��|jjSr)r�rbrgs rrbzValueContext.parent_context�s
���{�)�)rc�4�|j���Sr)r�rhrgs rrhzValueContext.is_module�����{�$�$�&�&�&rc�,�|j|jjkSr)r�r�builtins_modulergs rrkzValueContext.is_builtins_module�s���{�d�2�B�B�Brc�4�|j���Sr)r�rmrgs rrmzValueContext.is_class�s���{�#�#�%�%�%rc�4�|j���Sr)r�rorgs rrozValueContext.is_stub�s���{�"�"�$�$�$rc�4�|j���Sr)r�r[rgs rr[zValueContext.is_instance�����{�&�&�(�(�(rc�4�|j���Sr)r�rrrgs rrrzValueContext.is_compiled�r�rc�4�|j���Sr)r�rtrgs rrtzValueContext.is_bound_method�s���{�*�*�,�,�,rc�4�|j���Sr)r�rvrgs rrvzValueContext.py__name__�����{�%�%�'�'�'rc��|jjSr)r�r=rgs rr=zValueContext.name�s
���{��rc�4�|j���Sr)r�r{rgs rr{z ValueContext.get_qualified_names�s���{�.�.�0�0�0rc�4�|j���Sr)r�rrgs rrzValueContext.py__doc__�r�rc��|jSr�r�rgs rrxzValueContext.get_value��
���{�rc�0�|jj�d|j�d�S�N�(�))r�r�r�rgs r�__repr__zValueContext.__repr__�s���>�2�2�2�D�K�K�K�@�@r)r�r�r��__doc__rr�rFrbrhrkrmror[rrrtrvr=r{rrxr��
__classcell__�r�s@rr�r��sQ���������������%�%��X�%��*�*��X�*�'�'�'�C�C�C�&�&�&�%�%�%�)�)�)�)�)�)�-�-�-�(�(�(�� � ��X� �1�1�1�'�'�'����A�A�A�A�A�A�Arr�c�&�eZdZd�Zd�Zd�Zd�ZdS)�TreeContextMixinc�&�ddlm}|||��S)Nr)�
infer_node)�jedi.inference.syntax_treer�)rr9r�s   rr�zTreeContextMixin.infer_node�s&��9�9�9�9�9�9��z�$��%�%�%rc�\�ddlm}||jkr*|���sJ�|���S|�|��}|jdvr�|j�||��}|�	��rj|j
�|j��}|�|j
|j
|��}|�||���|���}|S|jdkr|�|j
||��St#d|z���)Nr)r@)�funcdef�lambdef)�instance�
class_context�function�classdefzProbably shouldn't happen: %s)r'r@rFrhrx�create_contextrC�
FunctionValue�from_contextrmrb�create_value�AnonymousInstancer�BoundMethod�
as_context�
ClassValuer)rr9r@rb�func�class_valuer�s       rr�zTreeContextMixin.create_value�sC��(�(�(�(�(�(��4�>�!�!��>�>�#�#�#�#�#��>�>�#�#�#��,�,�T�2�2���9�.�.�.��&�3�3�N�D�I�I�D��&�&�(�(�
�,�;�H�H��Ia�b�b�� �2�2��(�.�*G��V�V���(�(�%�"-�"8�"8�":�":�!�)����
�K�
�Y�*�
$�
$��#�#�D�$8�.�$�O�O�O�%�&E��&L�M�M�Mrc������d����fd�	�d������}|jdvr]|j|j�d��}�j|jkr(�j}|jdkr|j�ks�|��}�|d���S)	NTc�@��|�jkr�S|jdvr'��|�����S|jdvrF��|j����}�j|jdjkr|St||��Std|z���)N)r�r�r�rW���z(There's a scope that was not managed: %s)	rFrCr�r�rB�	start_pos�children�CompForContext�	Exception)�
scope_node�	is_nestedrb�from_scope_noder9�parent_scopers   ����rr�z8TreeContextMixin.create_context.<locals>.from_scope_node�s�����T�^�+�+�����"D�D�D��(�(��4�4�?�?�A�A�A���$A�A�A�!0����j�>O�1P�1P�!Q�!Q���>�Z�%8��%<�%F�F�F�)�)�%�n�j�A�A�A��F��S�T�T�Trc���	|j}tj|��r|S|jdvr"|jdjdvr
|jdSn*|jdkr|jdd�D]}|jdvr|cS��s)NT)�argument�
testlist_comp�rW�dictorsetmaker�)rBrrArCr�)r9r`s  rr�z5TreeContextMixin.create_context.<locals>.parent_scope
s���
%��{���(��.�.�	%��K��Y�"?�?�?��}�Q�'�,�0M�M�M�#�}�Q�/�/�N��Y�"2�2�2�!�]�1�Q�3�/�%�%���6�%B�B�B�#$�H�H�H�C�
%r)r�r��:�param)r�)T)rCr��indexr�rBr=)rr9r��colonrBr�r�s``   @@rr�zTreeContextMixin.create_context�s�������	U�	U�	U�	U�	U�	U�	U�	U�	U�
	%�
	%�
	%�"�\�$�'�'�
��?�5�5�5��'�
�(;�(A�(A�#�(F�(F�G�E��~���/�/������w�.�.�6�;�$�3F�3F�!-��j�!9�!9�J���z�T�:�:�:�:rc��|���}|rL|jdkrA|j|kr6t|dd��}|�|��}t||��S|�|��}t||��S)Nr�r�r�)�get_definitionrCr=rr�rr�r
)r�	tree_name�
definitionr�r�r7s      r�create_namezTreeContextMixin.create_name"s����-�-�/�/�
��	:�*�/�W�4�4���I�9U�9U�%�j�)�Y�G�G�G��$�$�W�-�-�D�%�d�I�6�6�6��)�)�)�4�4�G�%�g�y�9�9�9rN)r�r�r�r�r�r�r�rfrrr�r��sT������&�&�&�N�N�N�4$;�$;�$;�L:�:�:�:�:rr�c��eZdZdd�ZdS)�FunctionContextNc#�>K�t|j|||���V�dS�N)rbr!r")r	rr s   rr#zFunctionContext.get_filters.s@������ ��)�%�	
�
�
�	
�	
�	
�	
�	
rr��r�r�r�r#rfrrr�r�-s(������
�
�
�
�
�
rr�c�f�eZdZdeefd�Zd	d�Zd�Zed���Z	ed���Z
d�ZdS)
�
ModuleContext�returnc�4�|j���Sr�r��
py__file__rgs rr�zModuleContext.py__file__8r�rNc#��K�|j�|��}t|d��tt	|||���|�����V�|Ed{V��dSr�)r�r#�nextr
r	�get_global_filter)rr!r"r.s    rr#zModuleContext.get_filters;s������+�)�)�,�7�7���W�d������#�-�)�
�
�
�

�"�"�$�$�

�
�	
�	
�	
����������rc� �t|��Sr)rrgs rr�zModuleContext.get_global_filterIs����%�%�%rc��|jjSr�r��string_namesrgs rr�zModuleContext.string_namesL�
���{�'�'rc��|jjSr)r��
code_linesrgs rr�zModuleContext.code_linesPs
���{�%�%rc��|jS)z�
        This is the only function that converts a context back to a value.
        This is necessary for stub -> python conversion and vice versa. However
        this method shouldn't be moved to AbstractContext.
        r�rgs rrxzModuleContext.get_valueTs���{�rr�)r�r�r�rrr�r#r�r�r�r�rxrfrrr�r�7s�������(�H�T�N�(�(�(�(�����&�&�&��(�(��X�(��&�&��X�&�����rr�c�J�eZdZdd�Zd�Zed���Zdeefd�Z	dS)�NamespaceContextNc�4�|j���Sr�r�r#r s   rr#zNamespaceContext.get_filters^r�rc��|jSrr�rgs rrxzNamespaceContext.get_valuear�rc��|jjSrr�rgs rr�zNamespaceContext.string_namesdr�rr�c�4�|j���Srr�rgs rr�zNamespaceContext.py__file__hr�rr�)
r�r�r�r#rxr�r�rrr�rfrrr�r�]sq������)�)�)�)�����(�(��X�(�(�H�T�N�(�(�(�(�(�(rr�c��eZdZdd�Zdd�ZdS)�ClassContextNc#�:K�|�||��V�dSr)r�r s   rr#zClassContext.get_filtersms(�����$�$�^�\�B�B�B�B�B�B�Brc�&�t|||���Sr��r	r s   rr�zClassContext.get_global_filterps"����)�%�
�
�
�	
rr�)r�r�r�r#r�rfrrr�r�ls@������C�C�C�C�
�
�
�
�
�
rr�c�8��eZdZ�fd�Zdd�Zd�Zd�Zd�Z�xZS)r�c�p��t���|j��||_||_dSr)r�rrrFrb)rrbr4r�s   �rrzCompForContext.__init__ys3���
������7�8�8�8�!���,����rNc#�,K�t|��V�dSrr�r s   rr#zCompForContext.get_filters~s �����t�$�$�$�$�$�$�$rc��dSrrfrgs rrxzCompForContext.get_value�s���trc��dS)Nz<comprehension context>rfrgs rrvzCompForContext.py__name__�s��(�(rc�0�|jj�d|j�d�Sr�)r�r�rFrgs rr�zCompForContext.__repr__�s���>�2�2�2�D�N�N�N�C�Crr�)	r�r�r�rr#rxrvr�r�r�s@rr�r�xs��������-�-�-�-�-�
%�%�%�%����)�)�)�D�D�D�D�D�D�Drr�c��eZdZdd�ZdS)�CompiledContextNc�4�|j���Srr�r s   rr#zCompiledContext.get_filters�r�rr�r�rfrrrr�s(������)�)�)�)�)�)rrc�F�eZdZdZd�Zed���Zdeefd�Z	dS)�CompiledModuleContextNc��|jSrr�rgs rrxzCompiledModuleContext.get_value�r�rc��|jjSrr�rgs rr�z"CompiledModuleContext.string_names�r�rr�c�4�|j���Srr�rgs rr�z CompiledModuleContext.py__file__�r�r)
r�r�r�r�rxr�r�rrr�rfrrrr�sb�������J�����(�(��X�(�(�H�T�N�(�(�(�(�(�(rrc��|�ht|ddd��}d}|dkr|}t|dd��}|�9|jd}|�*||jkr|�||jdjkr|j}t|||��S)Nr�r�r����)rr�r��get_global_filters)r7�name_or_noner-�ancestorr�r�s      rr(r(�s�����"�<��J�	�R�R�����y� � ��G�&�|�Y�
�K�K�H����%�b�)�E��#��5�?�(B�(B��?�h��1A�"�1E�1O�&O�&O�'�1�H��g�x��>�>�>rc#�K�|}ddlm}|�?|�||���Ed{V��t||tf��rd}|j}|�?t
|jj���d��}|�J�|V�dS)a�
    Returns all filters in order of priority for name resolution.

    For global name lookups. The filters will handle name resolution
    themselves, but here we gather possible filters downwards.

    >>> from jedi import Script
    >>> script = Script('''
    ... x = ['a', 'b', 'c']
    ... def func():
    ...     y = None
    ... ''')
    >>> module_node = script._module_node
    >>> scope = next(module_node.iter_funcdefs())
    >>> scope
    <Function: func@3-5>
    >>> context = script._get_module_context().create_context(scope)
    >>> filters = list(get_global_filters(context, (4, 0), None))

    First we get the names from the function scope.

    >>> print(filters[0])  # doctest: +ELLIPSIS
    MergedFilter(<ParserTreeFilter: ...>, <GlobalNameFilter: ...>)
    >>> sorted(str(n) for n in filters[0].values())  # doctest: +NORMALIZE_WHITESPACE
    ['<TreeNameDefinition: string_name=func start_pos=(3, 4)>',
     '<TreeNameDefinition: string_name=x start_pos=(2, 0)>']
    >>> filters[0]._filters[0]._until_position
    (4, 0)
    >>> filters[0]._filters[1]._until_position

    Then it yields the names from one level "lower". In this example, this is
    the module scope (including globals).
    As a side note, you can see, that the position in the filter is None on the
    globals filter, because there the whole module is searched.

    >>> list(filters[1].values())  # package modules -> Also empty.
    []
    >>> sorted(name.string_name for name in filters[2].values())  # Module attributes
    ['__doc__', '__name__', '__package__']

    Finally, it yields the builtin filter, if `include_builtin` is
    true (default).

    >>> list(filters[3].values())  # doctest: +ELLIPSIS
    [...]
    r)�BaseFunctionExecutionContextN)r!r")	�jedi.inference.value.functionrr#r)r�rbr�rr�)r7r!r"�base_contextrrXs      rr
r
�s�����^�L�J�J�J�J�J�J�
�
��&�&�)�%�'�
�
�	
�	
�	
�	
�	
�	
�	
��g� <�m�L�M�M�	"�!�N��(���
�	
�\�
)�
9�
E�
E�
G�
G��N�N�A��=�=�=�
�G�G�G�G�GrN)'�abcr�
contextlibr�pathlibr�typingr�
parso.treer�parso.python.treer�jedi.inference.filtersr	r
r�jedi.inference.namesrr
�jedi.inference.base_valuerr�jedi.parser_utilsr�jedirrrr�r�r�r�r�r�r�rrr(r
rfrr�<module>rs	��������%�%�%�%�%�%�������������&�&�&�&�&�&�"�"�"�"�"�"�����������G�G�G�G�G�G�G�G�9�9�9�9�9�9�9�9�.�.�.�.�.�.�������������O'�O'�O'�O'�O'�O'�O'�O'�d6A�6A�6A�6A�6A�?�6A�6A�6A�rM:�M:�M:�M:�M:�M:�M:�M:�`
�
�
�
�
�&��
�
�
�#�#�#�#�#�$�l�#�#�#�L(�(�(�(�(�'��(�(�(�	
�	
�	
�	
�	
�#�\�	
�	
�	
�D�D�D�D�D�%��D�D�D�&)�)�)�)�)�l�)�)�)�
(�(�(�(�(�O�(�(�(�?�?�?�*@�@�@�@�@r

Youez - 2016 - github.com/yon3zu
LinuXploit