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

 

Command :


[ Back ]     

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

}�e���dZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
Gd�d	e�Zdd
�Zdd�Ze
d��Ze
d
��Zy)z
IO related utilities.
�N)�Path)�warn)�undoc�)�
CapturedIO�capture_outputc�0�eZdZdZdd�Zd�Zd�Zd�Zd�Zy)	�Teez�A class to duplicate an output stream to stdout/err.

    This works in a manner very similar to the Unix 'tee' command.

    When the object is closed or deleted, it closes the original file given to
    it for duplication.
    c��|dvrtd|z��t|d�rt|d�r||_nd|vrdnd}t|||��|_||_tt|�|_tt||�d	|_	y)
aNConstruct a new Tee object.

        Parameters
        ----------
        file_or_name : filename or open filehandle (writable)
            File that will be duplicated
        mode : optional, valid mode for open().
            If a filename was give, open with this mode.
        channel : str, one of ['stdout', 'stderr']
        )�stdout�stderrzInvalid channel spec %s�write�seek�bN�utf-8��encodingF)
�
ValueError�hasattr�file�open�channel�getattr�sys�ostream�setattr�_closed)�self�file_or_name�moderrs     �2/usr/lib/python3/dist-packages/IPython/utils/io.py�__init__zTee.__init__ s}���.�.��6��@�A�A��<��)�g�l�F�.K�$�D�I�"�d�{�t��H��\�4�(�C�D�I�����s�G�,�����W�d�#����c��|j�tt|j|j�|j
j
�d|_y)z'Close the file and restore the channel.TN)�flushrrrrr�closer�rs r!r&z	Tee.close8s4���
�
����T�\�\�4�<�<�0��	�	������r#c��|jj|�|jj|�|jj�y)zWrite data to both channels.N)rrrr%)r�datas  r!rz	Tee.write?s4���	�	����������4� ������r#c�l�|jj�|jj�y)zFlush both channels.N)rr%rr's r!r%z	Tee.flushEs ���	�	���������r#c�>�|js|j�yy)N)rr&r's r!�__del__zTee.__del__Js���|�|��J�J�L�r#N)�wr)	�__name__�
__module__�__qualname__�__doc__r"r&rr%r,�r#r!r
r
s ����0���
r#r
c�:�ddddd�}d}||j�vr4	t|dz�j�}|s|}||j�vr�4||S#t$r|r|}t	d�Y�2t
$r#||j�vr
|}t	�n�Y�\wxYw)a�Asks a question and returns a boolean (y/n) answer.

    If default is given (one of 'y','n'), it is used if the user input is
    empty. If interrupt is given (one of 'y','n'), it is used if the user
    presses Ctrl-C. Otherwise the question is repeated until an answer is
    given.

    An EOF is treated as the default answer.  If there is no default, an
    exception is raised to prevent infinite loops.

    Valid answers are: y/yes/n/no (match is not case sensitive).TF)�y�n�yes�noN� �
)�keys�input�lower�KeyboardInterrupt�print�EOFError)�prompt�default�	interrupt�answers�anss     r!�
ask_yes_norEOs����E��%�8�G�
�C�

�W�\�\�^�
#�
	���s�
�#�)�)�+�C����	�W�\�\�^�
#� �3�<���!�	�����$�K��	��'�,�,�.�(�������	�s� A�B�/(B�Bc���tj|�d}tt|�dd��5}|j	|�|j�ddd�|S#1swY|SxYw)a�Make a temporary python file, return filename and filehandle.

    Parameters
    ----------
    src : string or list of strings (no need for ending newlines if list)
        Source code to be written to the file.
    ext : optional, string
        Extension for the generated file.

    Returns
    -------
    (filename, open filehandle)
        It is the caller's responsibility to close the open file and unlink it.
    rr-rrN)�tempfile�mkstemprrrr%)�src�ext�fname�fs    r!�temp_pyfilerMqs]��
���S�!�!�$�E�	
�d�5�k�3��	1��Q�	�����	���	���L���L�s�"A�A&c���tdtd��t||jdd�|jdd�tj
d��tj
j
�y	)
zRDEPRECATED: Raw print to sys.__stdout__, otherwise identical interface to print().z@IPython.utils.io.raw_print has been deprecated since IPython 7.0���
stacklevel�sepr8�end�
�rRrSrN)r�DeprecationWarningr>�getr�
__stdout__r%��args�kws  r!�	raw_printr\�sN��	�	K�M_�lm�n�	�4�R�V�V�E�3�'�R�V�V�E�4�-@��~�~���N�N���r#c���tdtd��t||jdd�|jdd�tj
d��tj
j
�y	)
zRDEPRECATED: Raw print to sys.__stderr__, otherwise identical interface to print().zDIPython.utils.io.raw_print_err has been deprecated since IPython 7.0rOrPrRr8rSrTrUN)rrVr>rWr�
__stderr__r%rYs  r!�
raw_print_errr_�sN��	�	O�Qc�pq�r�	�4�R�V�V�E�3�'�R�V�V�E�4�-@��~�~���N�N���r#)NN)z.py)r1�atexit�osrrG�pathlibr�warningsr�IPython.utils.decoratorsr�capturerr�objectr
rErMr\r_r2r#r!�<module>rgsd����	�
����*�/�7�&�7�t�D�,�������r#

Youez - 2016 - github.com/yon3zu
LinuXploit