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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

�@�c����dZddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
ddlmZddl
mZdd�Zd�Zd	�Zd
�Ze	Gd�de����Zd
�ZdS)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���|j�di��}|�7|���D] \}}|j�||���!dS|j�|||��dS)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_aliasesrs�����	�	�*�B�/�/�I��}��?�?�$�$�	/�	/�C�A�a�
��)�)�!�A�.�.�.�.�	/�	/�
	��%�%�e�Y�u�-=�>�>�>�>�>�c�:�|j}|�d��D]}}tj�|��}	||}||j|<�5#t$r<td|z��tdtj	��d��Y�zwxYwdS)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�w�����	7�	7�	7��Y�\c�c�d�d�d��"�C�L�N�N�1�$5�6�6�6�6�6�	7����
&�
&s�A�AB�Bc�L�|j�dg��|jd<dS)N�dhist�_dh)rrr�rs r�
restore_dhistr+2s$����	�	�'�"�-�-�B�J�u���rc�`�t|��t|��t|��dS�N)r&rr+r*s r�restore_datar.6s2���b�����B�����"�����rc���eZdZdZedd����d���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|���|���|jj�|��|jrt|j��dSdS)N)�shell)�superr0�__init__r4�
configurables�append�autorestorer.)�selfr4�	__class__s  �rr6zStoreMagics.__init__Hsh���
�k�4� � �)�)��)�6�6�6��
� �'�'��-�-�-���	%����$�$�$�$�$�	%�	%r�c�R	�|�|dd���\}}|���}|j}|j}d|vrY	|d}	|d|z=dS#t$r}td|z��|�d}~wwxYw#t$r}td	��|�d}~wwxYwd
|vr|�d��D]}	||	=�dSd|vru|rb|D]]}
	|d|
z}||j|
<�#t$r8	t||
�
��n"#t$rtd|
z��YnwxYwY�ZwxYwdSt|��dS|s�|�d��}|�
��|r#ttt |����}
nd}
td��dt#|
��zdz}|j}|D]T}t&j�|��}t||t-||d����dd�fz���UdSt!|��dk�rm|d�d���rQt&j�|d�d�������}|d�d��rt5|dd���}nt5|dd���}|5|�|d��}td|d�d|jj�d|�d���t=|t"��sddlm}|||��n?|� |��|�!d ��s|� d ��ddd��n#1swxYwYdS|D�]}
	|j|
}tEtGj$|��d!d"��}|d#kr+ttKj&d$|
�d%|�d&�����dS||d|
z<td'|
�d|jj�d(�����#t$r~|
}	|j'�(|��}n%#tR$r}td)|z��|�d}~wwxYw|�d*i��}|||<||d*<td+|�d,|�d(���YdSwxYwdS)-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__r<�__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;rL�
isinstancerJ�write�endswith�getattr�inspect�	getmodule�textwrap�dedentr�retrieve_alias�
ValueError)r:�parameter_s�opts�argsl�argsrr�todel�er�argr%�vars�size�fmtr�varr$�fnam�filrJ�modname�name�cmdrs                         r�storezStoreMagics.storeNs$��\�'�'��E�x�'�H�H�
��U��{�{�}�}��
�Z��
�U���$�;�;�
R��Q���R��>�E�1�2�2�2��$�R�R�R�$�%A�E�%I�J�J�PQ�Q�����R������
S�
S�
S� �!J�K�K�QR�R�����
S�����D�[�[��W�W�_�-�-�
�
���q�E�E�
�
��D�[�[��
!��	.�	.�C�.� ��#�!5�6��+.��
�3����
$�J�J�J�J�+�B�c�:�:�:�:�:��'�J�J�J�!�"B�S�"H�I�I�I�I�I�J������J����	.�	.��R� � � � � ��F	N��7�7�?�+�+�D��I�I�K�K�K��
��3�s�D�>�>�*�*������<�=�=�=��s�4�y�y�.��*�C��&�C��
M�
M���'�*�*�3�/�/���c�W�d�3�3�s�O�+D�+D�&E�&E�c�r�c�&J�K�K�L�L�L�L�
M�
M��4�y�y�1�}�}��a��!3�!3�C�!8�!8�}��w�)�)�$�q�'�.�.��*=�*=�*D�*D�*F�*F�G�G����7�%�%�d�+�+�<��t�S�7�;�;�;�C�C��t�S�7�;�;�;�C��,�,��%�%��Q��.�.�C��E�t�A�w�w�w��
�.�.�.����6�7�7�7�&�s�C�0�0�,�1�1�1�1�1�1���s�C�(�(�(�(��	�	�#����"�|�|�D�1�1�,��I�I�d�O�O�O�,�,�,�,�,�,�,�,�,�,�,����,�,�,�,����
N�
N��N��*�S�/�C� &�g�&7��&<�&<�j�"�M�M�G��*�,�,��h�o�o�
 #�s�s�C�C�C�/)�+�+�,�,�,����14�B���,�.��E����S�]�5K�5K�5K�L�M�M�M�M��5 �����D�P� �.�=�=�d�C�C����%�P�P�P�(�)@�4�)G�H�H�a�O�����P����!#���'7�� ;� ;�I�&)�I�d�O�+4�B�'�(��E�T�T�T�3�3�3�?�@�@�@��F�F�F�����
N�
Ns��A9�A�
A6�A1�1A6�9
B�B�B�C�
D�(C:�9D�:D�D�D�D�D�B,M?�?N�N�
P�R$�)Q�R$�
Q&�Q!�!Q&�&9R$�#R$)r<)rL�
__module__�__qualname__�__doc__r�tagr9r6rrrx�
__classcell__)r;s@rr0r0<s��������"�"��$�u�	����
�c��c���	�%�%�%�%�%���VN�VN�VN��Z��\�VN�VN�VN�VN�VNrr0c�:�|�t��dS)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�s6��	�	�"�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�)�)�)�)�)�)�?�?�?�?�?�?�?�?�?�?�4�4�4�4�4�4�������?�?�?�?�&�&�&�.�.�.�����iN�iN�iN�iN�iN�&�iN�iN���iN�X$�$�$�$�$r

Youez - 2016 - github.com/yon3zu
LinuXploit