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__/dynamic_params.cpython-312.pyc
�

Še����dZddlmZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
dd	lmZdd
lmZddlmZmZddlmZdd
lmZdZd�Zej6ed���Zed��ed���Zd�Zd�Zd�Z y)a�
One of the really important features of |jedi| is to have an option to
understand code like this::

    def foo(bar):
        bar. # completion here
    foo(1)

There's no doubt wheter bar is an ``int`` or not, but if there's also a call
like ``foo('str')``, what would happen? Well, we'll just show both. Because
that's what a human would expect.

It works as follows:

- |Jedi| sees a param
- search for function calls named ``foo``
- execute these calls and check the input.
�)�settings)�debug)�get_parent_scope)�inference_state_method_cache)�
TreeArguments)�get_executed_param_names)�is_stdlib_path)�to_list)�instance)�ValueSet�	NO_VALUES)�#get_module_contexts_containing_name)�	recursion�c����fd�}|S)Nc�F��|j}tj||j�5}|r=|xjdz
c_	�||�|xjdzc_cddd�St
cddd�S#|xjdzc_wxYw#1swYyxYw)N�)�inference_stater�execution_allowed�	tree_node�dynamic_params_depthr
)�function_value�param_index�inf�allowed�funcs    ��?/usr/lib/python3/dist-packages/jedi/inference/dynamic_params.py�wrapperz"_avoid_recursions.<locals>.wrapper&s�����,�,��
�
(�
(��n�.F�.F�
G�
	�7���(�(�A�-�(�2����<��,�,��1�,�
	�
	��
	�
	���,�,��1�,��
	�
	�s)�B�A=�B�.B�=B�B�B �)rrs` r�_avoid_recursionsr %s�����N�c�����jjstS�j}�j	�j�}|�t
|�rtS|jdk(rt|�}|�tS|jj}tjd|d���j	�}t|||�}tj��fd�|D��}tjdd��|S)a:
    A dynamic search for param values. If you try to complete a type:

    >>> def func(foo):
    ...     foo
    >>> func(1)
    >>> func("")

    It is not known what the type ``foo`` without analysing the whole code. You
    have to look for all calls to ``func`` to find out what ``foo`` possibly
    is.
    �lambdefzDynamic param search in %s.�MAGENTA)�colorc3�X�K�|]!}t�|��j����#y�w)N)r�infer)�.0�	argumentsrrs  ��r�	<genexpr>z'dynamic_param_lookup.<locals>.<genexpr>\s9����� �
�	!��I�	
�
�	��u�w�	� �s�'*zDynamic param result finished)r�do_dynamic_params_searchr
r�get_root_context�
py__file__r	�type�_get_lambda_name�name�valuer�dbg�_search_function_argumentsr�	from_sets)rr�funcdef�path�string_name�module_context�arguments_list�valuess``      r�dynamic_param_lookupr;6s�����)�)�B�B����&�&�G��*�*�,�7�7�9�D���N�4�0�
���|�|�y� �&�w�/�������l�l�(�(��	�I�I�+�[�	�J�#�4�4�6�N�/����U�N�
�
�
� �(�	 ��F�
�I�I�-�Y�?��Mr!N)�defaultc	#�K�|}|dk(r2t|�}|jdk(r|jj}|}d}d}|j}t
jrt||g|d��}n|g}|D]c}	t|	|�D]N\}
}|dz
}||jztkDry|	j|
�}t||||
|�D]}
d	}|
���
�P|s�cyy�w)
z(
    Returns a list of param names.
    �__init__�classdefFr�)�limit_reductionrNT)
rr.r0r1rr� dynamic_params_for_other_modulesr�_get_potential_nodesr�MAX_PARAM_SEARCHES�create_context�_check_name_for_execution)r8r5r7�compare_node�cls�found_arguments�ir�module_contexts�for_mod_contextr0�trailer�random_contextr)s              rr3r3fs	�����L��j� ��w�'���8�8�z�!��(�(�.�.�K��L��O�	�A�$�4�4�O��0�0�=��n�-�{��
��*�*��*���1�/�;�O�
	 �M�D�'�
��F�A�
�?�7�7�7�:L�L��,�;�;�D�A�N�6�#�^�\�4��R�
 �	�"&����
 �
	 �"��'�s�CC�Cc���|j}|jdk(rIt|j�d�}|dk(r*|jd}|jdk(r|j
Sy)N�	expr_stmt�=rr0)�parentr.�next�yield_operators�childrenr1)�node�stmt�first_operator�firsts    rr/r/�s[���;�;�D��y�y�K���d�2�2�4�d�;���S� ��M�M�!�$�E��z�z�V�#��{�{�"�r!c#��K�	|jj�|}|D]:}|j�}|j}|j
dk(s�/|dk(s�5||f���<y#t$rYywxYw�w)NrM�()r�get_used_names�KeyError�
get_next_leafrRr.)�module_value�func_string_name�namesr0�bracketrMs      rrCrC�s|������&�&�5�5�7�8H�I��� ���$�$�&���.�.���<�<�9�$��C����-��	 ������s3�A0�A!�0A0�A0�	A0�!	A-�*A0�,A-�-A0c	#�����K�ddlm}���fd�}�j�|�D�]@}|j}||k(r||���� t	|j
|�s�7|jdk(s�G|j
j�}	t|	�dk7r�p|	dj�}
|
D�cgc]}|j��c}|gk(s���j�}|j||��}
t||	dj�}|D]Z\}�|j|jcxkr|jks�0n�3|
j|�}t!�|||��Ed{����\��Cycc}w7��w)Nr)�BaseFunctionExecutionContextc�*���jd}|dk(rd}t��|��}ddlm}|jj
dk(r+t
j�|j||�}|||�S|j�r||j|�}|S)Nr�)r)�InstanceArgumentsr?)
rUr�jedi.inference.value.instancergrr.r�TreeInstance�parent_context�is_bound_method)r1�arglist�argsrg�created_instance�contextrrMs     ���r�create_argsz._check_name_for_execution.<locals>.create_args�s�����"�"�1�%���c�>��G��_�g�w��H��C��?�?���:�-�'�4�4���$�$���	 ��%�%5�t�<�<��$�$�&�(�����>���Kr!r5r)�jedi.inference.value.functionrdr'r�
isinstancerjr.�get_param_names�lenr,�
as_contextrCr7�	start_pos�end_posrErF)rrorGr0rMrdrpr1�
value_node�param_namesr:�vr8�execution_context�potential_nodesrNs``  `           rrFrF�s_�����J��&!�&�&�w��5����_�_�
��:�%��e�$�$�
��,�,�.J�
K� �%�%��2� �.�.�>�>�@�K��;��1�$�� ��^�)�)�+�F�%+�,�����,���>�!(�!9�!9�!;��$)�$4�$4�[��5G�$H�!�"6�~�{�ST�~�Ga�Ga�"b��%4�	�M�D�'�!�+�+�d�n�n�Q�z�?Q�?Q�Q�):�)I�)I�$�)O��#<�+�*�(� �#�$���	�%��-��s8�AE1�E1�,AE1�,E*�?E1�A1E1�9&E1�E/� E1)!�__doc__�jedirr�jedi.parser_utilsr�jedi.inference.cacher�jedi.inference.argumentsr�jedi.inference.paramr�jedi.inference.helpersr	�jedi.inference.utilsr
�jedi.inference.valuer�jedi.inference.base_valuerr
�jedi.inference.referencesr�jedi.inferencerrDr �increase_indentr;r3r/rCrFrr!r�<module>r�s����&��.�=�2�9�1�(�)�9�I�$����"����+���+�\�d�+��+�	�,�+�\	�
 �1r!

Youez - 2016 - github.com/yon3zu
LinuXploit