| 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 : /usr/lib/python3/dist-packages/IPython/utils/__pycache__/ |
Upload File : |
�
�@�cX � �h � d Z ddlmZ ddlmZ ddlmZ ddlZ edg d�� � Zd� Z dd �Z
dd
�ZdS )zToken-related utilities� )�
namedtuple)�StringIO)� iskeywordN�Token)�token�text�start�end�linec # �n K � t j | � � D ]}|V � �dS # t j $ r Y dS w xY w)z(wrap generate_tokens to catch EOF errorsN)�tokenize�generate_tokens�
TokenError)�readliner s �9/usr/lib/python3/dist-packages/IPython/utils/tokenutil.pyr r s_ � � � ���-�h�7�7� � �E��K�K�K�K� � ���� � � �������s �! �4�4c � � d}| � d� � }|D ]8}|t |� � z }|� d� � s|dz
}||k r n|}�9d}||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�
� � )�
splitlines�len�endswith)�cell�
cursor_pos�offset�linesr �next_offsets r �line_at_cursorr s � �"