| 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 : |
�
}�e� � � � d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddl m
Z
mZ edg d �� Zd
� Z
ddee
e fd�Zdd
�Zddedefd�Zy)zToken-related utilities� )�
namedtuple)�StringIO)� iskeywordN)� TokenInfo)�List�Optional�Token)�token�text�start�end�linec # �| K � t j | � D ] }|�� � y# t j $ r Y yw xY w�w)z'wrap generate_tkens to catch EOF errorsN)�tokenize�generate_tokens�
TokenError)�readliner
s �9/usr/lib/python3/dist-packages/IPython/utils/tokenutil.pyr r sA � �� ���-�-�h�7� �E��K� ����� ���s �<�# �<�9�<�9�<�extra_errors_to_catchc # �� � K � g d�}|�t |t � sJ �||xs g z }g } t j | � D ] }|j |� |�� � y # t j
$ r�� t
� fd�|D � � rh|r6|d j d |d j d f}|}|d j }ndx}}d}t j t j d|||� �� n� Y d � � y d � � ww xY w�w)N)zunterminated string literalzinvalid non-printable characterz!after line continuation characterc 3 �@ �K � | ] }|�j d v �� � y�w)r N)�args)�.0�error�excs �r � <genexpr>z/generate_tokens_catch_errors.<locals>.<genexpr>, s �� �� �A��u������#�A�s ����r )� r � )�
isinstance�listr r �appendr �anyr r
r r �
ERRORTOKEN)
r r �default_errors_to_catch�errors_to_catch�tokensr
r r
r r s
@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}| j d� }|D ]2 }|t |� z }|j d� s|dz
}||kD r ||fS |}�4 d}||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.
r T�
r r )�
splitlines�len�endswith)�cell�
cursor_pos�offset�linesr �next_offsets r �line_at_cursorr3 : s{ � �"