403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.170
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

}�e�r���dZddlZddlmZmZddlZddlZddlZddlm	Z	m
Z
mZmZddl
Z
ddlmZej d�Zd�Zd�ZGd	�d
�Zeej d�ej d��
�Zeej dej,��Zd�Zdeefd�Zdefd�Zde
eefdefd�ZGd�d�ZGd�de�ZGd�de�ZdZ dZ!dZ"d Z#d!Z$d"Z%d#Z&d$Z'd%Z(hd&�Z)dd hZ*d'�Z+d(�Z,d)�Z-d*�Z.d+�Z/d,�Z0d-�Z1e d.jde!d/jde"e,e#e-e$e.e&e/e'e0e(e1iZ3Gd0�d1e�Z4ej d2ej,�Z5Gd3�d4e�Z6d5e	e7fd6�Z8d7e	ejrfd8�Z:d9e7fd:�Z;d;Z<Gd<�d=�Z=d>�Z>Gd?�d@e�Z?GdA�dBe�Z@ej�ZBe@eB�C�ZCy)Da5Input transformer machinery to support IPython special syntax.

This includes the machinery to recognise and transform ``%magic`` commands,
``!system`` commands, ``help?`` querying, prompt stripping, and so forth.

Added: IPython 7.0. Replaces inputsplitter and inputtransformer which were
deprecated in 7.0.
�N)�CommandCompiler�Compile)�List�Tuple�Optional�Any)�	tokenutilz^[ \t]+c�h�|s|St|�D]\}}|s�	|j�r�||dcS|S)zyRemove leading empty lines

    If the leading lines are empty or contain only whitespace, they will be
    removed.
    N)�	enumerate�isspace)�lines�i�lines   �@/usr/lib/python3/dist-packages/IPython/core/inputtransformer2.py�leading_empty_linesrsB������U�#����4���������9����L�c���|s|Stj|d�}|s|S|jd�}t|�}|D�cgc]}|j	|�r||dn|��c}Scc}w)z�Remove leading indentation.

    If the first line starts with a spaces or tabs, the same whitespace will be
    removed from each following line in the cell.
    rN)�
_indent_re�match�group�len�
startswith)r
�m�space�n�ls     r�leading_indentr&st���������q��"�A����
�G�G�A�J�E��E�
�A�����\�\�%�(�A�a�b�E�a�/����s�A#c�$�eZdZdZdd�Zd�Zd�Zy)�PromptStripperaARemove matching input prompts from a block of input.

    Parameters
    ----------
    prompt_re : regular expression
        A regular expression matching any input prompt (including continuation,
        e.g. ``...``)
    initial_re : regular expression, optional
        A regular expression matching only the initial prompt, but not continuation.
        If no initial expression is given, prompt_re will be used everywhere.
        Used mainly for plain Python prompts (``>>>``), where the continuation prompt
        ``...`` is a valid Python expression in Python 3, so shouldn't be stripped.

    Notes
    -----

    If initial_re and prompt_re differ,
    only initial_re will be tested against the first line.
    If any prompt is found on the first two lines,
    prompts will be stripped from the rest of the block.
    Nc�(�||_|xs||_y�N��	prompt_re�
initial_re)�selfr#r$s   r�__init__zPromptStripper.__init__Ls��"���$�1�	��rc�d�|D�cgc] }|jjd|d����"c}Scc}w)N��)�count)r#�sub)r%r
rs   r�_stripzPromptStripper._stripPs,��<A�B�q����"�"�2�q��"�2�B�B��Bs�%-c���|s|S|jj|d�s,t|�dkDr/|jj|d�r|j	|�S|S�Nrr))r$rrr#r,�r%r
s  r�__call__zPromptStripper.__call__SsT����L��?�?� � ��q��*��U��a��D�N�N�$8�$8��q��$B��;�;�u�%�%��rr!)�__name__�
__module__�__qualname__�__doc__r&r,r0�rrrr6s���*2�C�rrz^(>>>|\.\.\.)( |$)z	^>>>( |$)r"a
        ^(                         # Match from the beginning of a line, either:

                                   # 1. First-line prompt:
        ((\[nav\]|\[ins\])?\ )?    # Vi editing mode prompt, if it's there
        In\                        # The 'In' of the prompt, with a space
        \[\d+\]:                   # Command index, as displayed in the prompt
        \                          # With a mandatory trailing space

        |                          # ... or ...

                                   # 2. The three dots of the multiline prompt
        \s*                        # All leading whitespace characters
        \.{3,}:                    # The three (or more) dots
        \ ?                        # With an optional trailing space

        )
        c��|r|djd�s|Stjd|d�r|S|dddj�j	d�\}}}dj|dd�}d|�d	|�d	|�d
�gS)Nr�%%z%%\w+\?�� r(r)zget_ipython().run_cell_magic(�, z)
)r�rer�rstrip�	partition�join)r
�
magic_name�_�
first_line�bodys     r�
cell_magicrCys�����a��+�+�D�1���	�x�x�
�E�!�H�%��� %�a����� 3� 3� 5� ?� ?�� D��J��:�
�7�7�5���9��D��:�t�
-�.�.r�returnc��d}t|�D]9\}}|j}|dk(r	|dk(r|cS|dvr|dz
}�*|dvs�/|dkDs�5|dz}�;y)z�Get the index of the first assignment in the line ('=' not inside brackets)

    Note: We don't try to support multiple special assignment (a = b = %foo)
    r�=��(�[�{r)��)�]�}N)r�string)�
token_line�paren_levelr�ti�ss     r�_find_assign_oprT�sm��
�K��:�&�!���2��I�I����8��q�(��H��
���1��K�
�/�
!��Q���q� ��!�r�
start_linec��|}||jd�r+|dz
}|t|�k\r	|S||jd�r�+|S)zjFind the last line of a line explicitly extended using backslashes.

    Uses 0-indexed line numbers.
    z\
r))�endswithr)r
rU�end_lines   r�find_end_of_continued_linerY�sS��
�H�
��/�
"�
"�6�
*��A�
���s�5�z�!���O�	��/�
"�
"�6�
*��Or�startrXc���||d|ddg||ddz|dzz}dj|ddD�cgc]}|j�dd��c}|dj�gz�Scc}w)aAssemble a single line from multiple continued line pieces

    Continued lines are lines ending in ``\``, and the line following the last
    ``\`` in the block.

    For example, this code continues over multiple lines::

        if (assign_ix is not None) \
             and (len(line) >= assign_ix + 2) \
             and (line[assign_ix+1].string == '%') \
             and (line[assign_ix+2].type == tokenize.NAME):

    This statement contains four continued line pieces.
    Assembling these pieces into a single line would give::

        if (assign_ix is not None) and (len(line) >= assign_ix + 2) and (line[...

    This uses 0-indexed line numbers. *start* is (lineno, colno).

    Used to allow ``%magic`` and ``!system`` commands to be continued over
    multiple lines.
    rr)Nr9���)r>r<)r
rZrX�parts�ps     r�assemble_continued_liner_�s���.�5��8�_�U�1�X�Y�
'�(�5��q��!��H�Q�J�+G�G�E��8�8�e�C�R�j�9��Q�X�X�Z���_�9��R�y�'�'�)�*�+�,�,��9s�A'c�B�eZdZdZdZd�Zd�Zed��Zde	e
fd�Zy)	�TokenTransformBasea�Base class for transformations which examine tokens.

    Special syntax should not be transformed when it occurs inside strings or
    comments. This is hard to reliably avoid with regexes. The solution is to
    tokenise the code as Python, and recognise the special syntax in the tokens.

    IPython's special syntax is not valid Python syntax, so tokenising may go
    wrong after the special syntax starts. These classes therefore find and
    transform *one* instance of special syntax at a time into regular Python
    syntax. After each transformation, tokens are regenerated to find the next
    piece of special syntax.

    Subclasses need to implement one class method (find)
    and one regular method (transform).

    The priority attribute can select which transformation to apply if multiple
    transformers match in the same place. Lower numbers have higher priority.
    This allows "%magic?" to be turned into a help call rather than a magic call.
    �
c�H�|j|j|jfSr!)rU�	start_col�priority�r%s r�sortbyzTokenTransformBase.sortby�s���������
�
�=�=rc�2�|ddz
|_|d|_yr.)rUrd)r%rZs  rr&zTokenTransformBase.__init__�s����(�Q�,����q���rc��t�)a�Find one instance of special syntax in the provided tokens.

        Tokens are grouped into logical lines for convenience,
        so it is easy to e.g. look at the first token of each line.
        *tokens_by_line* is a list of lists of tokenize.TokenInfo objects.

        This should return an instance of its class, pointing to the start
        position it has found, or None if it found no match.
        ��NotImplementedError��cls�tokens_by_lines  r�findzTokenTransformBase.find�s
��"�!rr
c��t�)z�Transform one instance of special syntax found by ``find()``

        Takes a list of strings representing physical lines,
        returns a similar list of transformed lines.
        rjr/s  r�	transformzTokenTransformBase.transform�s
��"�!rN)r1r2r3r4rergr&�classmethodror�strrqr5rrrara�s<���(�H�>�"��
"��
"�"�t�C�y�"rrac�2�eZdZdZed��Zdeefd�Zy)�MagicAssignz2Transformer for assignments from magics (a = %foo)c��|D]u}t|�}|��t|�|dzk\s�#||dzjdk(s�9||dzjtj
k(s�]|||dzj�cSy)z@Find the first magic assignment (a = %foo) in the cell.
        Nr8r)�%)rTrrO�type�tokenize�NAMErZ�rmrnr�	assign_ixs    rrozMagicAssign.find�s��#�	4�D�'��-�I��%��T��i�!�m�3��i��k�*�1�1�S�8��i��k�*�/�/�8�=�=�@��4�	�!��,�2�2�3�3�
	4rr
c�8�|j|j}}||d|}t||�}t|||f|�}|j	d�sJ|��|ddjd�\}}}	|d|}
dj
||	�}||zdz}||dzd}
|
|gz|
zS)zJTransform a magic assignment found by the ``find()`` classmethod.
        Nrwr)r9z(get_ipython().run_line_magic({!r}, {!r})�
)rUrdrYr_rr=�format)r%r
rUrd�lhsrX�rhsr?r@�args�lines_before�call�new_line�lines_afters              rrqzMagicAssign.transform�s���!%������I�
��J��
��+��-�e�Z�@��%�e�j�)�-D�h�O���~�~�c�"�'�C�'�"�!�!�"�g�/�/��4��
�A�t��[�j�)��9�@�@��T�R����:��$���H�Q�J�K�(���x�j�(�;�6�6rN)	r1r2r3r4rrrorrsrqr5rrruru�s'��<��	4��	4�7�t�C�y�7rruc�R�eZdZdZed��Zed��Zed��Zdee	fd�Z
y)�SystemAssignz;Transformer for assignments from system commands (a = !foo)c�\�|D�]&}t|�}|��||jj�jd�r�?t	|�|dzk\s�Q||dzj
tjk(s�u|dz}|t	|�ks��||j
tjk(s��||jdk(r|||j�cS||jj�s��|dz
}|t	|�ks��||j
tjk(r�}��)y�NrFr8r)�!)rTr�striprrrxry�
ERRORTOKENrOrZr)rmrnrr|�ixs     r�find_pre_312zSystemAssign.find_pre_312s���"�
	�D�'��-�I��%� ��O�0�0�6�6�8�C�C�C�H��T��i�!�m�3��i�!�m�,�1�1�X�5H�5H�H���]���3�t�9�n��b����(�:M�:M�)M��B�x���#�-�"�4��8�>�>�2�2�!�"�X�_�_�4�4�6���!�G�B��3�t�9�n��b����(�:M�:M�)M�
	rc�R�|D]�}t|�}|��||jj�jd�r�>t	|�|dzk\s�P||dzj
tjk(s�t||dzjdk(s��|||dzj�cSyr�)
rTrr�rrrxry�OPrOrZr{s    r�
find_post_312zSystemAssign.find_post_312#s���"�		6�D�'��-�I��&��Y��,�,�2�2�4�?�?��D���Y�)�a�-�/��)�a�-�(�-�-����<��)�a�-�(�/�/�3�6��4�	�A�
�.�4�4�5�5�		6rc�l�tjdkr|j|�S|j|�S)z8Find the first system assignment (a = !foo) in the cell.)��)�sys�version_infor�r�rls  rrozSystemAssign.find0s4�����g�%��#�#�N�3�3�� � ��0�0rr
c��|j|j}}||d|}t||�}t|||f|�}|j	d�sJ|��|dd}|d|}dj|�}	||	zdz}
||dzd}||
gz|zS)zKTransform a system assignment found by the ``find()`` classmethod.
        Nr�r)�get_ipython().getoutput({!r})r~)rUrdrYr_rr)r%r
rUrdr�rXr��cmdr�r�r�r�s            rrqzSystemAssign.transform7s���!%������I�
��J��
��+��-�e�Z�@��%�e�j�)�-D�h�O���~�~�c�"�'�C�'�"��!�"�g���[�j�)��.�5�5�c�:����:��$���H�q�L�M�*���x�j�(�;�6�6rN)r1r2r3r4rrr�r�rorrsrqr5rrr�r�sO��E����� �
6��
6��1��1�7�t�C�y�7rr�r�z!!�?�??rwr7�,�;�/>r�rwr�r�r�r�c��|dk(rdnd|vrdnd}dj||g�}|jd�\}}}|jt�}d|�d|�d	�S)
zUPrepares a pinfo(2)/psearch call from a target name and the escape
    (i.e. ? or ??)r��pinfo2�*�psearch�pinfor9�get_ipython().run_line_magic(r:rL)r>r=�lstrip�	ESC_MAGIC)�target�esc�method�arg�t_magic_namer@�
t_magic_arg_ss       r�_make_help_callr�\sc����+�h�"%��-�Y����(�(�F�F�#�
$�C�%(�]�]�3�%7�"�L�!�]��&�&�y�1�L�5A�=�Q�Qrc� �|syt|d�S)zrTranslate lines escaped with: ?

    A naked help line should fire the intro help screen (shell.show_usage())
    �get_ipython().show_usage()r��r���contents r�_tr_helpr�is��
�+��7�C�(�(rc� �|syt|d�S)zsTranslate lines escaped with: ??

    A naked help line should fire the intro help screen (shell.show_usage())
    r�r�r�r�s r�	_tr_help2r�ss��
�+��7�D�)�)rc�>�|jd�\}}}d|�d|�d�S)z.Translate lines escaped with a percent sign: %r9r�r:rL�r=�r��namer@r�s    r�	_tr_magicr�}s#���%�%�c�*�M�D�!�T�59�4�@�@rc�v�|jd�\}}}|�ddj|j���d�S)z'Translate lines escaped with a comma: ,r9�("z", "�")�r=r>�splitr�s    r�	_tr_quoter��s2���%�%�c�*�M�D�!�T��v�{�{�4�:�:�<�8�:�:rc�<�|jd�\}}}|�d|�d�S)z+Translate lines escaped with a semicolon: ;r9r�r�r�r�s    r�
_tr_quote2r��s#���%�%�c�*�M�D�!�T��t�$�$rc�v�|jd�\}}}|�ddj|j���d�S)z'Translate lines escaped with a slash: /r9rHr:rLr�r�s    r�	_tr_parenr��s2���%�%�c�*�M�D�!�T��T�Y�Y�t�z�z�|�4�5�5rzget_ipython().system({!r})r�c�&�eZdZdZed��Zd�Zy)�EscapedCommandz9Transformer for escaped commands like %foo, !foo, or /fooc�r�|D]�}|s�d}t|�}||kDri||jtjtjhvr:|dz
}||kDr0||jtjtjhvr�:||k\r��||j
tvs��|||j�cSy)zGFind the first escaped command (%foo, !foo, etc.) in the cell.
        rr)N)rrxry�INDENT�DEDENTrO�ESCAPE_SINGLESrZ)rmrnrr��lls     rrozEscapedCommand.find�s���#�
	+�D����B��T��B��r�'�d�2�h�m�m�������/Q�Q��a����r�'�d�2�h�m�m�������/Q�Q��R�x���B�x���.�0��4��8�>�>�*�*�
	+rc�B�|j|j}}||d|}t||�}t|||f|�}t	|�dkDr|ddt
vr|dd|dd}}n
|dd|dd}}|tvrt
||�}	nd}	|d|}
||	zdz}||dzd}|
|gz|zS)zGTransform an escaped line found by the ``find()`` classmethod.
        Nr)r8r(r~)rUrdrYr_r�ESCAPE_DOUBLES�tr)
r%r
rUrd�indentrXr�escaper�r�r�r�r�s
             rrqzEscapedCommand.transform�s���!%������I�
��z�"�:�I�.��-�e�Z�@��&�u�z�9�.E�x�P���t�9�q�=�T�"�1�X��7�"�2�A�h��Q�R��G�F�"�2�A�h��Q�R��G�F��R�<��f�:�g�&�D��D��[�j�)���D�=�4�'���H�q�L�M�*���x�j�(�;�6�6rN)r1r2r3r4rrrorqr5rrr�r��s��C��
+��
+�7rr�z�(%{0,2}
    (?!\d)[\w*]+            # Variable name
    (\.(?!\d)[\w*]+|\[-?[0-9]+\])*       # .etc.etc or [0], we only support literal integers.
    )
    (\?\??)$                # ? or ??
    c�<��eZdZdZdZ�fd�Zed��Zd�Z�xZ	S)�HelpEndz+Transformer for help syntax: obj? and obj??�c�R��t�|�|�|ddz
|_|d|_yr.)�superr&�q_line�q_col)r%rZ�q_locn�	__class__s   �rr&zHelpEnd.__init__�s*���
������Q�i�!�m����A�Y��
rc�j�|D]�}t|�dkDs�|djdk(s�%d}||jtjtj
hvr5|dz
}||jtjtj
hvr�5|||j|dj�cSy)z8Find the first help command (foo?) in the cell.
        r8���r�rr)N)rrOrxryr�r�rZ)rmrnrr�s    rrozHelpEnd.find�s���#�	;�D��4�y�1�}��b����C�!7����2�h�m�m�������'I�I��!�G�B��2�h�m�m�������'I�I��4��8�>�>�4��8�>�>�:�:�	;rc��dj||j|jdz�}|d|j||jd}}|d|j}||jdzd}tj|�}|st
|��|�J|��|jd�}|jd�}	t||	�}
||
zdz}||gz|zS)zFTransform a help command found by the ``find()`` classmethod.
        r(r)Nr�r~)	r>rUr�rd�_help_end_re�search�SyntaxErrorrr�)r%r
�piecer�r�r�r�rr�r�r�r�s            rrqzHelpEnd.transform�s�������d�o�o����a��@�A��� 0�$�.�.�1�5����9I�3J����.�t���/���D�K�K�!�O�-�.������(����g�&�&��}�%�g�%�}��������g�g�a�j���v�s�+���D�=�4�'���x�j�(�;�6�6r)
r1r2r3r4rer&rrrorq�
__classcell__�r�s@rr�r��s+���5��H��
�
;��
;�7rr�r
c�p�tjtj}}gg}t|�dkDr+|dj	d�stjdd��d}	tjt|�jdg��D]y}|d	j|�|j|k(s|j|k(r|dkr|jg��L|jd
vr|dz
}�`|jdvs�o|dkDs�u|dz}�{	|d	s|j�|S#tj$rY�,wxYw)acTokenize a series of lines and group tokens by line.

    The tokens for a multiline Python string or expression are grouped as one
    line. All lines except the last lines should keep their line ending ('\n',
    '\r\n') for this to properly work. Use `.splitlines(keeplineending=True)`
    for example when passing block of text to this function.

    r)r)r~�
z
��z�`make_tokens_by_line` received a list of lines which do not have lineending markers ('\n', '\r', '\r\n', '\x0b', '\x0c'), behavior will be unspecifiedr8��
stacklevelzexpected EOF)�extra_errors_to_catchr\rGrK)ry�NEWLINE�NLrrW�warnings�warnr	�generate_tokens_catch_errors�iter�__next__�appendrxrO�
TokenError�pop)r
r�r�rn�parenlev�tokens      r�make_tokens_by_liner��s2���"�"�H�K�K�R�G�')�d�N�
�5�z�A�~�e�A�h�/�/�0T�U��
�
�
k��	
��H�
��;�;���K� � ��8H�
�	"�E�
�2��%�%�e�,��
�
�g�%����r�)��A�
��%�%�b�)�����0��A�
������0��a�<���M�H�	"�"�"������������
��
�s� BD�:D�D�D5�4D5�tokensc�t�d}|D]1}|jdvr|dz
}�|jdvs�&|dz}|dks�1yy)zBCheck if the depth of brackets in the list of tokens drops below 0rrGr)rKTF)rO)r�r�r�s   r�has_sunken_bracketsr�/sO���H�����<�<�?�*���M�H�
�\�\�_�
,���M�H��!�|��
�rrSc���tjdtd��|jd�s|dz
}|j	d��}t|�D] }t
d�|D]}t
d|���"y	)
zFor investigation and debuggingz4show_linewise_tokens is deprecated since IPython 8.6r8r�r~T��keependszLine -------r9N)r�r��DeprecationWarningrW�
splitlinesr��print)rSr
r�tokinfos    r�show_linewise_tokensr<ss���M�M�>����

�:�:�d��	�T�	��
�L�L�$�L�'�E�#�E�*� ��
�n���	 �G��#�w��	 � ri�c�>�eZdZdZd�Zd�Zd�Zdedefd�Zdefd�Z	y	)
�TransformerManagerz�Applies various transformations to a cell or code block.

    The key methods for external use are ``transform_cell()``
    and ``check_complete()``.
    c��ttttg|_t
g|_ttttg|_yr!)rr�classic_prompt�ipython_prompt�cleanup_transformsrC�line_transformsrur�r�r��token_transformersrfs rr&zTransformerManager.__init__Ts?������	#
���
� 
���
����	#
��rc�(�t|�}g}|jD]'}|j|�}|s�|j|��)|sd|fSt	|t
j��}|D]}	d|j|�fcSd|fS#t$rY�)wxYw)a2Find and run the transform earliest in the code.

        Returns (changed, lines).

        This method is called repeatedly until changed is False, indicating
        that all available transformations are complete.

        The tokens following IPython special syntax might not be valid, so
        the transformed code is retokenised every time to identify the next
        piece of special syntax. Hopefully long code cells are mostly valid
        Python, not using lots of IPython special syntax, so this shouldn't be
        a performance issue.
        F)�keyT)	r�r
ror��sortedrargrqr�)r%r
rn�
candidates�transformer_cls�transformer�ordered_transformerss       r�do_one_token_transformz)TransformerManager.do_one_token_transformes���-�U�3���
�#�6�6�	/�O�)�.�.�~�>�K���!�!�+�.�	/�
��%�<��%�j�6H�6O�6O�P��/�	�K�
��[�2�2�5�9�9�9�	�
�e�|����
��
�s�+B�	B�Bc��tt�D]}|j|�\}}|r�|cStdtz��)NzBInput transformation still changing after %d iterations. Aborting.)�range�TRANSFORM_LOOP_LIMITr�RuntimeError)r%r
r@�changeds    r�do_token_transformsz&TransformerManager.do_token_transforms�sR���+�,�	�A�!�8�8��?�N�G�U����	�
�6�8L�M�N�	Nr�cellrDc���|jd�s|dz
}|jd��}|j|jzD]
}||�}�|j	|�}dj|�S)zTransforms a cell of input coder~Tr�r()rWr�rr	rr>)r%rr
rqs    r�transform_cellz!TransformerManager.transform_cell�sq���}�}�T�"��D�L�D������.���0�0�4�3G�3G�G�	%�I��e�$�E�	%��(�(��/���w�w�u�~�rc���d}t|�D]}|dk(rd}n|j�rn�|s|dz
}|jd��}|syt|�D]C}|j�s�|jd�jd�rdt	|�fcSn	|j
D]}t
|dd�r�||�}�	|d
jd�r!|dj�r
dt	|�fSy	|jD]}t
|dd�r�||�}�|j|�}t|�}t|�d
k(r|rt|d
�ry	|s
dt	|�fS|ddjtj k7r0|ddjtj"k7r
dt	|�fStj$tj&tj h}d}	|dD�
chc]}
|
j��c}
tj(tj htj hfvrt|�d
kDr|j+�}	|drA|ddj|vr-|dj+�|dr|ddj|vr�-|ds
dt	|�fS|ddj,dk(r�d
}|d|jtj.tj(hvr8|d
z
}|d|jtj.tj(hvr�8|d|j0d
}d|dzfS|dd
j2jd�ry	t5j6�5t5j8dt:�t=dj?|�d��}
ddd�
�
dt	|�fS|	r0|	d
jtj(k(r|rydt	|�fS|dj�syy#t$rYy	wxYw#t$rYy	wxYwcc}
w#1swY��xYw#tt@tBtDtFt:f$rYy	wxYw)aReturn whether a block of code is ready to execute, or should be continued

        Parameters
        ----------
        cell : string
            Python input code, which can be multiline.

        Returns
        -------
        status : str
            One of 'complete', 'incomplete', or 'invalid' if source is not a
            prefix of valid code.
        indent_spaces : int or None
            The number of spaces by which to indent the next line of code. If
            status is not 'incomplete', this is None.
        Fr~Tr�)�completeN�\�
incomplete�has_side_effects)�invalidNrr7r\r)N�:�)rN�errorr(�exec)�symbol)$�reversedr�r�rW�find_last_indentr�getattrr�rr	rr�rr�rxry�	ENDMARKERr�r��COMMENTr�r�rOr�rZrr��catch_warnings�simplefilter�
SyntaxWarning�compile_commandr>�
OverflowError�
ValueError�	TypeError�MemoryError)r%r�ends_with_newline�	characterr
rrqrn�
newline_types�last_token_line�tr�r��ress              r�check_completez!TransformerManager.check_complete�s���$"��!�$��	�I��D� �$(�!�����"���	�!�
�D�L�D������.���#��U�O�	�D��:�:�<�����D�!�*�*�4�0�#�%5�e�%<�<�<��
	�	#�!�4�4�
-�	��y�*<�e�D�%�e�,�E�
-���8���t�$��R�y��� �#�%5�e�%<�<�<�'�	#�!�1�1�
-�	��y�*<�e�D�%�e�,�E�
-��,�,�U�3�E�-�U�3��

��J�!�O��#�N�1�$5�6�"���!1�%�!8�8�8�
�2��r�"�'�'�8�+=�+=�=��r�"�2�&�+�+�x�/B�/B�B� �!1�%�!8�8�8�!�)�)�8�+;�+;�X�=O�=O�P�
���*�2�.�/�q�A�F�F�/�
�_�_�h�0�0�1�
�
�
� �4
�
��.�!�A�%�,�0�0�2�O��R� �^�B�%7��%;�%@�%@�M�%Q��2��"�"�$��R� �^�B�%7��%;�%@�%@�M�%Q��b�!��!1�%�!8�8�8��"��b�!�(�(�C�/��B� ��$�R�(�-�-�(�/�/�8�?�?�1S�S��a���!��$�R�(�-�-�(�/�/�8�?�?�1S�S�$�B�'��+�1�1�!�4�F���!��+�+��"��a� �%�%�.�.�t�4�%�		=��(�(�*�
E��%�%�g�}�=�%�b�g�g�e�n�V�D��
E��{�#�%5�e�%<�<�<���q�1�6�6�(�/�/�I� �'��!1�%�!8�8�8��R�y��� �#���s�	#�"�	#���	#�"�	#��80�6
E�
E���]�J�	��]�,�	#�"�	#�s`�P�9
P�:P+�P+�6P:�3Q�7P?�>Q�	P(�'P(�+	P7�6P7�?Q�Q�#Q1�0Q1N)
r1r2r3r4r&rrrsrr:r5rrrrNs9���

�"�@N�	�3�	�3�	�K �3�K rrc��tj|d�}|syt|jd�j	dd��S)Nr\r�	z    )rrrr�replace)r
rs  rr(r('s<������r��#�A����q�w�w�q�z�!�!�$��.�/�/rc� ��eZdZd�fd�	Z�xZS)�MaybeAsyncCompilec�L��t�|��|xj|zc_yr!)r�r&�flags)r%�extra_flagsr�s  �rr&zMaybeAsyncCompile.__init__/s���
�����
�
�k�!�
r�r)r1r2r3r&r�r�s@rr?r?.s
���"�"rr?c��eZdZdd�Zy)�MaybeAsyncCommandCompilerc�&�t|��|_y)N�rB)r?�compiler)r%rBs  rr&z"MaybeAsyncCommandCompiler.__init__5s��)�k�B��
rNrC)r1r2r3r&r5rrrErE4s��CrrErG)Dr4�ast�codeoprrr;r�ry�typingrrrrr��
IPython.utilsr	�compilerrrrr�VERBOSErrC�intrTrYr_rarur��	ESC_SHELL�
ESC_SH_CAP�ESC_HELP�	ESC_HELP2r��
ESC_MAGIC2�	ESC_QUOTE�
ESC_QUOTE2�	ESC_PARENr�r�r�r�r�r�r�r�r�rr�r�r�r�rsr��	TokenInfor�rrrr(r?rE�PyCF_ALLOW_TOP_LEVEL_AWAIT�_extra_flagsr/r5rr�<module>r[s\����+�	�
��-�-��#�
�R�Z�Z�
�
#�
��� #�#�J ��b�j�j�.�/��r�z�z�,�'���
 ��B�J�J�	�$	�
�
�'���2	.��8�C�=��"
�#�
�,�%��S��/�,�S�,�61"�1"�f7�$�7�@77�%�77�~�	�
�
�
��
�	�
�	�
�
�
�	�
�
�
�	�/������
R�)�*�A�
;�
%�
6�
�0�7�7��3�:�:��H��I��I��I��J��I� ��)7�'�)7�X�r�z�z���J�J���,7� �,7�\-�d�3�i�-�`
��X�%7�%7� 8�
�
 �C�
 � ��V �V �r0�"��"�C��C�
�-�-��+��E�r

Youez - 2016 - github.com/yon3zu
LinuXploit