AlkantarClanX12
Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/dill/__pycache__/ |
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/dill/__pycache__/temp.cpython-311.pyc |
� �܋f[ � �t � d Z g d�ZddlZej dd�� � Zd� Zd� Zd� Zd � Zd � Z d� Z d� Zd � Zd� Z [dS )zb Methods for serialized objects (or source code) stored in temporary files and file-like objects. ) �dump_source�dump� dumpIO_source�dumpIO�load_source�load� loadIO_source�loadIO�capture� N�stdoutc # �� K � ddl }ddlm} t || � � }t || |� � � � t || � � V � t || |� � dS # t || |� � w xY w)z�builds a context that temporarily replaces the given stream name >>> with capture('stdout') as out: ... print ("foo!") ... >>> print (out.getvalue()) foo! r N)�StringIO)�sys�ior �getattr�setattr)�streamr r �origs �Z/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/dill/temp.pyr r s� � � � � �J�J�J��������3����D��C������$�$�$�#��c�6�"�"�"�"�"���V�T�"�"�"�"�"����V�T�"�"�"�"���s �A �A/c �@ � dd l }|� | � � d S )Nr )�codecs�latin_1_encode)�xr s r �br + s$ � ��M�M�M�� � ��#�#�A�&�&� c � � |� dd� � }|� dd� � }t | d| � � }t |fd|i|��� � � }|s~|� � � � � � d � � � }|d dk r,|� � � d }t d |z � � �|d }i }t ||� � t d |z |� � } | S )aC load an object that was stored with dill.temp.dump_source file: filehandle alias: string name of stored object mode: mode to open the file, one of: {'r', 'rb'} >>> f = lambda x: x**2 >>> pyfile = dill.temp.dump_source(f, alias='_f') >>> _f = dill.temp.load_source(pyfile) >>> _f(4) 16 �aliasN�mode�r�name���r �#NAME:�unknown name for code: %s�%s) �popr �open�read�strip� splitlines�split�IOError�exec�eval) �file�kwdsr r �fname�source�tag�stub�local�_s r r r / s � � �H�H�W�d�#�#�E��8�8�F�C� � �D��D�&�$�'�'�E� �%� +� +�d� +�d� +� +� 0� 0� 2� 2�F�� ��l�l�n�n�'�'�)�)�"�-�3�3�5�5���q�6�X����$�$�&�&�q�)�D��5��<�=�=�=��B����E��������T�E�\�5�!�!�A��Hr c � � ddl m}m} ddl}|� dd� � |� dd� � |� d d� � }t |� � p || � � }d |z } |j d ddi|��}|� t d� || |�� � |g� � � � � � |� � � |S )aM write object source to a NamedTemporaryFile (instead of dill.dump) Loads with "import" or "dill.temp.load_source". Returns the filehandle. >>> f = lambda x: x**2 >>> pyfile = dill.temp.dump_source(f, alias='_f') >>> _f = dill.temp.load_source(pyfile) >>> _f(4) 16 >>> f = lambda x: x**2 >>> pyfile = dill.temp.dump_source(f, dir='.') >>> modulename = os.path.basename(pyfile.name).split('.py')[0] >>> exec('from %s import f as _f' % modulename) >>> _f(4) 16 Optional kwds: If 'alias' is specified, the object will be renamed to the given string. If 'prefix' is specified, the file name will begin with that prefix, otherwise a default prefix is used. If 'dir' is specified, the file will be created in that directory, otherwise a default directory is used. If 'text' is specified and true, the file is opened in text mode. Else (the default) the file is opened in binary mode. On some operating systems, this makes no difference. NOTE: Keep the return value for as long as you want your file to exist ! � �� importable�getnamer N�deleteT�suffix� r � #NAME: %s z.py�r � )r1 r9 r: �tempfile� setdefaultr% �str�NamedTemporaryFile�writer �join�flush)�objectr/ r9 r: rA r r r. s r r r K s� � �@ ,�+�+�+�+�+�+�+��O�O�O��O�O�H�d�#�#�#��H�H�X�r�����H�H�W�b�!�!�E��u�:�:�(������D��T�!�D�&�8�&�<�<�e�<�t�<�<�D��J�J�q����*�*�V�5�9�9�9�$�?�@�@�A�A�B�B�B��J�J�L�L�L��Kr c � � ddl }|� dd� � }t | d| � � }|� t |fd|i|��� � S )z�load an object that was stored with dill.temp.dump file: filehandle mode: mode to open the file, one of: {'r', 'rb'} >>> dumpfile = dill.temp.dump([1, 2, 3, 4, 5]) >>> dill.temp.load(dumpfile) [1, 2, 3, 4, 5] r Nr �rbr )�dillr% r r r&