403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.25
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 :  /lib/python3/dist-packages/IPython/terminal/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/IPython/terminal/__pycache__/magics.cpython-311.pyc
�

�@�c����dZddlmZddlZddlZddlmZmZddlm	Z	m
Z
mZddlm
Z
ddlmZddlmZmZdd	lmZejd
fd�Ze
Gd�d
e	����ZdS)zExtra magics for terminal use.�)�errorN)�TryNext�
UsageError)�Magics�magics_class�
line_magic)�ClipboardEmpty)�skip_doctest)�SList�strip_email_quotes)�	py3compatFc#�K�|std|z��d}nd}		||��}||krdS|V�n #t$rtd��YdSwxYw�:)zH Yield pasted lines until the user enters the given sentinel value.
    zAPasting code; enter '%s' alone on the line to stop or use Ctrl-D.�:�TNz<EOF>)�print�EOFError)�sentinel�l_input�quiet�prompt�ls     �9/usr/lib/python3/dist-packages/IPython/terminal/magics.py�get_pasted_linesrs�������
�Q���	�	�	������	�	������A��H�}�}����������	�	�	��'�N�N�N��F�F�	����	s�6�6�A�Ac���eZdZ�fd�Zd�Zd�Zdd�Zed
d���Ze	ed
d�����Z
ed
d	���Zej
d
kred���Z�xZS�xZS)�TerminalMagicsc�X��tt|���|��dS)N)�superr�__init__)�self�shell�	__class__s  �rrzTerminalMagics.__init__)s'���
�n�d�#�#�,�,�U�3�3�3�3�3�c�b�|rBt|�����|jj|<t	d|z��dS|�|��}||jjd<d|j_	|j�|d���d|j_dS#d|j_wxYw)zM Execute a block, or store it in a variable, per the user's request.
        zBlock assigned to '%s'�pasted_blockT)�
store_historyFN)r�
splitlinesr �user_nsr�preclean_input�using_paste_magics�run_cell)r�block�name�bs    r�store_or_executezTerminalMagics.store_or_execute,s����	6�',�U�-=�-=�-?�-?�'@�'@�D�J��t�$��*�T�1�2�2�2�2�2��#�#�E�*�*�A�12�D�J��~�.�,0�D�J�)�
6��
�#�#�A�T�#�:�:�:�05��
�-�-�-����
�-�5�5�5�5s�6B � B.c���|���}|r@|d���s&|dd�}|r|d����&td�|����S)Nr��
)r&�stripr�join)rr+�liness   rr(zTerminalMagics.preclean_input<sv��� � �"�"���	�E�!�H�N�N�,�,�	��!�"�"�I�E��	�E�!�H�N�N�,�,�	�!�$�)�)�E�"2�"2�3�3�3r"r$c�X�|jj�|��}|�td���t	|t
��std���t
d|�dd��dt|��fz��|j�	|��dS)z, Rerun a previously pasted command.
        Nz"No previous pasted block availablez6Variable 'pasted_block' is not a string, can't executezRe-executing '%s...' (%d chars)r1r0r)
r r'�getr�
isinstance�strr�split�lenr*)rr,r-s   r�rerun_pastedzTerminalMagics.rerun_pastedBs���
�J��"�"�4�(�(��
�9��A�B�B�B��!�S�!�!�	J��H�J�J�
J�	�/�!�'�'�$�q�/�/�!�2D�c�!�f�f�1M�M�N�N�N��
���A�����r"rc�|�|j���tdddg|jj��dS)z%Toggle autoindent on/off (deprecated)zAutomatic indentation is:�OFF�ONN)r �set_autoindentr�
autoindent)r�parameter_ss  rr@zTerminalMagics.autoindentQs=��	
�
�!�!�#�#�#�
�)�5��,�t�z�7L�*M�N�N�N�N�Nr"c��|�|dd���\}}d|vr|���dSd|v}|�dd��}d	�t	||�
����}|�||��dS)u�Paste & execute a pre-formatted code block from clipboard.

        You must terminate the block with '--' (two minus-signs) or Ctrl-D
        alone on the line. You can also provide your own sentinel with '%paste
        -s %%' ('%%' is the new sentinel for this operation).

        The block is dedented prior to execution to enable execution of method
        definitions. '>' and '+' characters at the beginning of a line are
        ignored, to allow pasting directly from e-mails, diff files and
        doctests (the '...' continuation prompt is also stripped).  The
        executed block is also assigned to variable named 'pasted_block' for
        later editing with '%edit pasted_block'.

        You can also pass a variable name as an argument, e.g. '%cpaste foo'.
        This assigns the pasted block to variable 'foo' as string, without
        dedenting or executing it (preceding >>> and + is still stripped)

        '%cpaste -r' re-executes the block previously entered by cpaste.
        '%cpaste -q' suppresses any additional output messages.

        Do not be alarmed by garbled output on Windows (it's a readline bug).
        Just press enter and type -- (and press enter again) and the block
        will be what was just pasted.

        Shell escapes are not supported (yet).

        See Also
        --------
        paste : automatically pull code from clipboard.

        Examples
        --------
        ::

          In [8]: %cpaste
          Pasting code; enter '--' alone on the line to stop.
          :>>> a = ["world!", "Hello"]
          :>>> print(" ".join(sorted(a)))
          :--
          Hello world!

        ::
          In [8]: %cpaste
          Pasting code; enter '--' alone on the line to stop.
          :>>> %alias_magic t timeit
          :>>> %t -n1 pass
          :--
          Created `%t` as an alias for `%timeit`.
          Created `%%t` as an alias for `%%timeit`.
          354 ns ± 224 ns per loop (mean ± std. dev. of 7 runs, 1 loop each)
        zrqs:�string��mode�rN�q�sz--r1)r)�
parse_optionsr;r6r3rr.)rrA�optsr,rrr+s       r�cpastezTerminalMagics.cpasteWs���l�'�'��V�(�'�K�K�
��d��$�;�;��������F������8�8�C��'�'���	�	�*�8�5�A�A�A�B�B�����e�T�*�*�*�*�*r"c���|�|dd���\}}d|vr|���dS	|jj���}nl#t
$rB}t
|d��}|rt|d��ntd��Yd}~dSd}~wt$r}td	��|�d}~wwxYwd
|vr�tj�|j�
|����|�d��stj�d��tj�d��|�||��dS)
a�Paste & execute a pre-formatted code block from clipboard.

        The text is pulled directly from the clipboard without user
        intervention and printed back on the screen before execution (unless
        the -q flag is given to force quiet mode).

        The block is dedented prior to execution to enable execution of method
        definitions. '>' and '+' characters at the beginning of a line are
        ignored, to allow pasting directly from e-mails, diff files and
        doctests (the '...' continuation prompt is also stripped).  The
        executed block is also assigned to variable named 'pasted_block' for
        later editing with '%edit pasted_block'.

        You can also pass a variable name as an argument, e.g. '%paste foo'.
        This assigns the pasted block to variable 'foo' as string, without
        executing it (preceding >>> and + is still stripped).

        Options:

          -r: re-executes the block previously entered by cpaste.

          -q: quiet mode: do not echo the pasted text back to the terminal.

        IPython statements (magics, shell escapes) are not supported (yet).

        See Also
        --------
        cpaste : manually paste code into terminal until you mark its end.
        �rqrCrDrFN�argsrz&Could not get text from the clipboard.z!The clipboard appears to be emptyrGr1z## -- End pasted text --
)rIr;r �hooks�
clipboard_getr�getattrrr	r�sys�stdout�write�
pycolorize�endswithr.)rrArJr,r+�
clipboard_exc�message�es        r�pastezTerminalMagics.paste�s���>�'�'��T��'�I�I�
��d��$�;�;��������F�
	I��J�$�2�2�4�4�E�E���	�	�	��m�V�4�4�G��
@��g�a�j�!�!�!�!��>�?�?�?��F�F�F�F�F������	I�	I�	I��@�A�A�q�H�����	I�����d�?�?��J���T�Z�2�2�5�9�9�:�:�:��>�>�$�'�'�
'��
� � ��&�&�&��J���9�:�:�:����e�T�*�*�*�*�*s#�A�
B?� 7B�
B?�*B:�:B?�win32c�.�tjd��dS)zClear screen.
            �clsN)�os�system)rrHs  rr]zTerminalMagics.cls�s��
�I�e�����r")r$)r)�__name__�
__module__�__qualname__rr.r(r;rr@r
rKrZrR�platformr]�
__classcell__)r!s@rrr's�������4�4�4�4�4�6�6�6� 4�4�4�
�
�
�
��O�O�O��Z�O�
��=+�=+�=+��Z��\�=+�~�5+�5+�5+��Z�5+�p�|�w���	�	�	�
��	�	�	�	�	����r"r)�__doc__�loggingrr^rR�IPython.core.errorrr�IPython.core.magicrrr�IPython.lib.clipboardr	�IPython.testing.skipdoctestr
�IPython.utils.textrr�
IPython.utilsr
�inputrr�r"r�<module>ros��$�$�������	�	�	�	�
�
�
�
�2�2�2�2�2�2�2�2�?�?�?�?�?�?�?�?�?�?�0�0�0�0�0�0�4�4�4�4�4�4�8�8�8�8�8�8�8�8�#�#�#�#�#�#�'0��e�����*�n�n�n�n�n�V�n�n���n�n�nr"

Youez - 2016 - github.com/yon3zu
LinuXploit