| Server IP : 35.80.110.71 / Your IP : 216.73.216.52 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/core/__pycache__/ |
Upload File : |
�
}�e� � � � d Z ddlZddlZddlmZ ddlmZ ddlmZ ej dej � Zd
d�Z G d� d e
� Zy)z�
Simple utility for splitting user input. This is used by both inputsplitter and
prefilter.
Authors:
* Brian Granger
* Fernando Perez
� N)� py3compat)�get_stream_enc)�OInfoaV
^(\s*) # any leading space
([,;/%]|!!?|\?\??)? # escape character or characters
\s*(%{0,2}[\w\.\*]*) # function/method, possibly with leading %
# to correctly treat things like '?%magic'
(.*?$|$) # rest of line
c � � t t j d� }t j | |� } |�t
}|j
| � }|s@ | j dd� \ }}t j d| � j � d }d}n|j � \ }}}}||xs d|j � |j � fS # t $ r | d}}Y �tw xY w)z`Split user input into initial whitespace, escape character, function part
and the rest.
zutf-8N� � z
^(\s*)(.*)r )
r �sys�stdinr �cast_unicode�
line_split�match�split�
ValueError�re�groups�strip�lstrip)�line�pattern�encodingr
�ifun�the_rest�pre�escs �9/usr/lib/python3/dist-packages/IPython/core/splitinput.py�split_user_inputr 6 s� � �
�c�i�i��1�H��!�!�$��1�D������M�M�$��E�� '�!�Z�Z��Q�/�N�D�(� �h�h�}�T�*�1�1�3�A�6����#(�<�<�>� ��S�$�� �� �r�4�:�:�<����):�:�:�� � '�!�3�(�D� '�s �
C �
C�Cc �* � e Zd ZdZdd�Zdefd�Zd� Zy)�LineInfoa= A single line of input and associated info.
Includes the following as properties:
line
The original, raw line
continue_prompt
Is this line a continuation in a sequence of multiline input?
pre
Any leading whitespace.
esc
The escape character(s) in pre or the empty string if there isn't one.
Note that '!!' and '??' are possible values for esc. Otherwise it will
always be a single character.
ifun
The 'function part', which is basically the maximal initial sequence
of valid python identifiers and the '.' character. This is what is
checked for alias and magic transformations, used for auto-calling,
etc. In contrast to Python identifiers, it may start with "%" and contain
"*".
the_rest
Everything else on the line.
c �� � || _ || _ t |� \ | _ | _ | _ | _ | j j � | _ | j rd| _ y | j | _ y )Nr )
r �continue_promptr r r r r r �pre_char�pre_whitespace)�selfr r s r �__init__zLineInfo.__init__o sY � �#�� �.���7G��7M�4���$�(�D�I�t�}�"�h�h�n�n�.��
��=�=�"$�D��"&�(�(�D�� �returnc �8 � |j | j � S )a Do a full, attribute-walking lookup of the ifun in the various
namespaces for the given IPython InteractiveShell instance.
Return a dict with keys: {found, obj, ospace, ismagic}
Note: can cause state changes because of calling getattr, but should
only be run if autocall is on and if the line hasn't matched any
other, less dangerous handlers.
Does cache the results of the call, so can be called multiple times
without worrying about *further* damaging state.
)�_ofindr )r# �ips r �ofindzLineInfo.ofindz s � � �y�y����#�#r% c �p � d| j �d| j �d| j �d| j �d� S )Nz
LineInfo [�|�])r r r r )r# s r �__str__zLineInfo.__str__� s! � �*.�(�(�D�H�H�d�i�i����W�Wr% N)F)�__name__�
__module__�__qualname__�__doc__r$ r r* r. � r% r r r R s � ��8 +�
$�5�
$�Xr% r )N)r2 r r �
IPython.utilsr �IPython.utils.encodingr �IPython.core.oinspectr �compile�VERBOSEr r �objectr r3 r% r �<module>r: sN ���*
�
� #� 1� '�"