ok

Mini Shell

Direktori : /opt/alt/python36/lib64/python3.6/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/__pycache__/pickle.cpython-36.opt-1.pyc

3

)j�a���@sdZddlmZddlmZddlmZmZmZddlm	Z	ddl
mZddlZddlm
Z
dd	lmZmZddlZddlZddlZddlZd
ddd
dddddg	ZeefZdZdddddddgZdZdZGdd
�d
e�ZGdd�de�ZGdd�de�Z Gdd �d e�Z!ydd!l"m#Z#Wne$k
�r2dZ#YnXd"Z%d#Z&d$Z'd%Z(d&Z)d'Z*d(Z+d)Z,d*Z-d+Z.d,Z/d-Z0d.Z1d/Z2d0Z3d1Z4d2Z5d3Z6d4Z7d5Z8d6Z9d7Z:d8Z;d9Z<d:Z=d;Z>d<Z?d=Z@d>ZAd?ZBd@ZCdAZDdBZEdCZFdDZGdEZHdFZIdGZJdHZKdIZLdJZMdKZNdLZOdMZPdNZQdOZRdPZSdQZTdRZUdSZVdTZWdUZXdVZYdWZZdXZ[eKeUeVeWgZ\dYZ]dZZ^d[Z_d\Z`d]Zad^Zbd_Zcd`ZddaZedbZfdcZgddZhejidedf�ej�D��Gdgdh�dh�ZkGdidj�dj�Zldkdl�Zmdmdn�Zndodp�Zodqdr�ZpGdsdt�dt�ZqGdudv�dv�Zrd�dwdx�dydz�Zsd�dwdx�d{d|�Ztdwd}d~d�d�d��Zudwd}d~d�d�d��Zvy0dd�lwmZmZm Z mxZxmyZymzZzm{Z{m|Z|m}Z}Wn4e$k
�rbeqerZxZyeseteuevf\ZzZ{Z|Z}YnXd�d��Z~ed�k�rddl�Z�e�j�d�d��Z�e�j�d�e�j�d��d�d�d��e�j�d�d�d�d�d��e�j�d�d�d�d��e�j��Z�e�j��r�e~�n>e�j��s�e�j��n,ddl�Z�x"e�j�D]Z�e|e��Z�e�j�e���q�WdS)�a�Create portable serialized representations of Python objects.

See module copyreg for a mechanism for registering custom picklers.
See module pickletools source for extensive comments.

Classes:

    Pickler
    Unpickler

Functions:

    dump(object, file)
    dumps(object) -> string
    load(file) -> object
    loads(string) -> object

Misc variables:

    __version__
    format_version
    compatible_formats

�)�FunctionType)�dispatch_table)�_extension_registry�_inverted_registry�_extension_cache)�islice)�partialN)�maxsize)�pack�unpack�PickleError�
PicklingError�UnpicklingError�Pickler�	Unpickler�dump�dumps�load�loadsz4.0z1.0z1.1z1.2z1.3z2.0z3.0��c@seZdZdZdS)rz6A common base class for the other pickling exceptions.N)�__name__�
__module__�__qualname__�__doc__�rr�+/opt/alt/python36/lib64/python3.6/pickle.pyr@sc@seZdZdZdS)r
z]This exception is raised when an unpicklable object is passed to the
    dump() method.

    N)rrrrrrrrr
Dsc@seZdZdZdS)raThis exception is raised when there is a problem unpickling an object,
    such as a security violation.

    Note that other exceptions may also be raised during unpickling, including
    (but not necessarily limited to) AttributeError, EOFError, ImportError,
    and IndexError.

    N)rrrrrrrrrKsc@seZdZdd�ZdS)�_StopcCs
||_dS)N)�value)�selfrrrr�__init__Ysz_Stop.__init__N)rrrr rrrrrXsr)�PyStringMap�(�.�0�1�2�F�I�J�K�L�M�N�P�Q�R�S�T�U�V�X�a�b�c�d�}�e�g�h�i�j�l�]�o�p�q�r�s�t�)�u�GsI01
sI00
�������������������������B�C��������������������cCsg|]}tjd|�r|�qS)z[A-Z][A-Z0-9_]+$)�re�match)�.0�xrrr�
<listcomp>�srgc@s:eZdZdZdd�Zdd�Zdd�Zdd
d�Zdd
�ZdS)�_Framer�@icCs||_d|_dS)N)�
file_write�
current_frame)rrjrrrr �sz_Framer.__init__cCstj�|_dS)N)�io�BytesIOrk)rrrr�
start_framing�sz_Framer.start_framingcCs*|jr&|jj�dkr&|jdd�d|_dS)NrT)�force)rk�tell�commit_frame)rrrr�end_framing�sz_Framer.end_framingFcCst|jrp|j}|j�|jks|rp|j��2}t|�}|j}|t�|td|��||�WdQRX|jd�|j	�dS)Nz<Qr)
rkrp�_FRAME_SIZE_TARGET�	getbuffer�lenrj�FRAMEr
�seek�truncate)rro�f�data�n�writerrrrq�s

z_Framer.commit_framecCs |jr|jj|�S|j|�SdS)N)rkr|rj)rrzrrrr|�sz
_Framer.writeNi)F)	rrrrsr rnrrrqr|rrrrrh�s

rhc@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)�	_UnframerNcCs||_||_d|_dS)N)�	file_read�
file_readlinerk)rr~rZ	file_tellrrrr �sz_Unframer.__init__cCsV|jrH|jj|�}|r0|dkr0d|_|j|�St|�|krDtd��|S|j|�SdS)Nrz$pickle exhausted before end of frame)rk�readr~rur)rr{rzrrrr��s
z_Unframer.readcCsF|jr:|jj�}|s"d|_|j�S|ddkr6td��|S|j�SdS)N��
rz$pickle exhausted before end of frame����
)rk�readlinerr)rrzrrrr��s
z_Unframer.readlinecCs2|jr|jj�dkrtd��tj|j|��|_dS)N�z4beginning of a new frame before end of current frame)rkr�rrlrmr~)r�
frame_sizerrr�
load_frame�sz_Unframer.load_frame)N)rrrr r�r�r�rrrrr}�s


r}cCslxb|jd�D]T}|dkr(tdj||���y|}t||�}Wqtk
r^tdj||���YqXqW||fS)N�.z<locals>z&Can't get local attribute {!r} on {!r}z Can't get attribute {!r} on {!r})�split�AttributeError�format�getattr)�obj�nameZsubpath�parentrrr�
_getattributes
r�cCszt|dd�}|dk	r|Sx\ttjj��D]J\}}|dks(|dkrBq(yt||�d|krZ|SWq(tk
rpYq(Xq(WdS)z$Find the module an object belong to.rN�__main__r)r��list�sys�modules�itemsr�r�)r�r��module_name�modulerrr�whichmodules
r�cCsh|dkrdS|j�d?d}|j|ddd�}|dkrd|dkrd|ddkrd|d
d
@dkrd|dd�}|S)a�Encode a long to a two's complement little-endian binary string.
    Note that 0 is a special case, returning an empty string, to save a
    byte in the LONG1 pickling context.

    >>> encode_long(0)
    b''
    >>> encode_long(255)
    b'\xff\x00'
    >>> encode_long(32767)
    b'\xff\x7f'
    >>> encode_long(-256)
    b'\x00\xff'
    >>> encode_long(-32768)
    b'\x00\x80'
    >>> encode_long(-128)
    b'\x80'
    >>> encode_long(127)
    b'\x7f'
    >>>
    rr�rr��littleT)�	byteorder�signed���Nr����r�)�
bit_length�to_bytes)rf�nbytes�resultrrr�encode_long$sr�cCstj|ddd�S)a\Decode a long from a two's complement little-endian binary string.

    >>> decode_long(b'')
    0
    >>> decode_long(b"\xff\x00")
    255
    >>> decode_long(b"\xff\x7f")
    32767
    >>> decode_long(b"\x00\xff")
    -256
    >>> decode_long(b"\x00\x80")
    -32768
    >>> decode_long(b"\x80")
    -128
    >>> decode_long(b"\x7f")
    127
    r�T)r�r�)�int�
from_bytes)rzrrr�decode_longBsr�c@sheZdZd7dd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zd8dd�Z	dd�Z
dd�Zd9dd�ZiZ
dd�Zee
ed�<dd�Zee
e<dd�Zee
e<dd�Zee
e<d d!�Zee
e<d"d#�Zee
e<d$d%�Zee
e<d&d'�Zee
e<d(Zd)d*�Zd+d,�Z e e
e!<e"dk	�re e
e"<d-d.�Z#d/d0�Z$e$e
e%<d1d2�Z&e&e
e'<d:d3d4�Z(d5d6�Z)e(e
e*<e)e
e<dS);�_PicklerNT)�fix_importscCs�|dkrt}|dkrt}n$d|ko,tkns>tdt��y|j|_Wntk
rftd��YnXt|j�|_|jj|_i|_	t
|�|_|dk|_d|_
|o�|dk|_dS)a�This takes a binary file for writing a pickle data stream.

        The optional *protocol* argument tells the pickler to use the
        given protocol; supported protocols are 0, 1, 2, 3 and 4.  The
        default protocol is 3; a backward-incompatible protocol designed
        for Python 3.

        Specifying a negative protocol version selects the highest
        protocol version supported.  The higher the protocol used, the
        more recent the version of Python needed to read the pickle
        produced.

        The *file* argument must have a write() method that accepts a
        single bytes argument. It can thus be a file object opened for
        binary writing, an io.BytesIO instance, or any other custom
        object that meets this interface.

        If *fix_imports* is True and *protocol* is less than 3, pickle
        will try to map the new Python 3 names to the old module names
        used in Python 2, so that the pickle data stream is readable
        with Python 2.
        Nrzpickle protocol must be <= %dz"file must have a 'write' attributer�r)�DEFAULT_PROTOCOL�HIGHEST_PROTOCOL�
ValueErrorr|�_file_writer��	TypeErrorrh�framer�memor��proto�bin�fastr�)r�file�protocolr�rrrr [s"


z_Pickler.__init__cCs|jj�dS)aClears the pickler's "memo".

        The memo is the data structure that remembers which objects the
        pickler has already seen, so that shared or recursive objects
        are pickled by reference and not by value.  This method is
        useful when re-using picklers.
        N)r��clear)rrrr�
clear_memo�sz_Pickler.clear_memocCsrt|d�std|jjf��|jdkr<|jttd|j��|jdkrP|jj	�|j
|�|jt�|jj�dS)z7Write a pickled representation of obj to the open file.r�z2Pickler.__init__() was not called by %s.__init__()r�z<BrN)
�hasattrr
�	__class__rr�r|�PROTOr
r�rn�save�STOPrr)rr�rrrr�s





z
_Pickler.dumpcCs:|jr
dSt|j�}|j|j|��||f|jt|�<dS)zStore an object in the memo.N)r�rur�r|�put�id)rr��idxrrr�memoize�s

z_Pickler.memoizecCsT|jdkrtS|jr:|dkr*ttd|�Sttd|�Sntt|�jd�dSdS)Nr�z<Bz<I�asciir�)	r��MEMOIZEr��BINPUTr
�LONG_BINPUT�PUT�repr�encode)rr�rrrr��s
z_Pickler.putcCs@|jr*|dkrttd|�Sttd|�Stt|�jd�dS)Nr�z<Bz<Ir�r�)r��BINGETr
�LONG_BINGET�GETr�r�)r�irrr�get�s
z_Pickler.getcCs�|jj�|j|�}|dk	r.|r.|j|�dS|jjt|��}|dk	r^|j|j|d��dSt|�}|j	j|�}|dk	r�|||�dSt
|dt�j|�}|dk	r�||�}n�yt|t�}	Wnt
k
r�d}	YnX|	r�|j|�dSt
|dd�}|dk	�r||j�}n0t
|dd�}|dk	�r&|�}ntd|j|f��t|t��rT|j||�dSt|t��sltd|��t|�}
d|
k�o�d	kn�s�td
|��|j|d|i�dS)NrrF�
__reduce_ex__�
__reduce__zCan't pickle %r object: %rz%s must return string or tupler��z3Tuple returned by %s must have two to five elementsr�)r�rq�
persistent_id�	save_persr�r�r�r|�type�dispatchr�r�
issubclassr��save_globalr�r
r�
isinstance�str�tupleru�save_reduce)rr��save_persistent_id�pidrf�try�reduce�rvZissc�lrrrr��sT








z
_Pickler.savecCsdS)Nr)rr�rrrr�sz_Pickler.persistent_idcCsb|jr |j|dd�|jt�n>y |jtt|�jd�d�Wntk
r\td��YnXdS)NF)r�r�r�z2persistent IDs in protocol 0 must be ASCII strings)	r�r�r|�	BINPERSID�PERSIDr�r��UnicodeEncodeErrorr
)rr�rrrr�s z_Pickler.save_perscCst|t�std��t|�s"td��|j}|j}t|dd�}	|jdkr�|	dkr�|\}
}}t|
d�sntdj	|	���|dk	r�|
|j
k	r�td	j	|	���|jd
kr�||
�||�||�|t�n,t|
j
|
f|�|�}||�|f�|t�n�|jdko�|	dk�r\|d}
t|
d��std
��|dk	�r6|
|j
k	�r6td��|dd�}||
�||�|t�n||�||�|t�|dk	�r�t|�|jk�r�|t|j|jt|�d��n
|j|�|dk	�r�|j|�|dk	�r�|j|�|dk	�r�||�|t�dS)Nz'args from save_reduce() must be a tuplez(func from save_reduce() must be callabler�r��
__newobj_ex__�__new__z#args[0] from {} args has no __new__z(args[0] from {} args has the wrong classr�
__newobj__rz+args[0] from __newobj__ args has no __new__z0args[0] from __newobj__ args has the wrong classr�)r�r�r
�callabler�r|r�r�r�r�r��	NEWOBJ_EXrr��REDUCE�NEWOBJr�r��POPr�r��_batch_appends�_batch_setitems�BUILD)r�func�args�stateZ	listitemsZ	dictitemsr�r�r|Z	func_name�cls�kwargsrrrr�sd







"





z_Pickler.save_reducecCs|jt�dS)N)r|�NONE)rr�rrr�	save_none�sz_Pickler.save_nonecCs4|jdkr|j|rtnt�n|j|r*tnt�dS)Nr�)r�r|�NEWTRUE�NEWFALSE�TRUE�FALSE)rr�rrr�	save_bool�s
z_Pickler.save_boolcCs�|jr~|dkrN|dkr.|jttd|��dS|dkrN|jttd|��dSd
|ko`dknr~|jttd|��dS|jd	kr�t|�}t|�}|d
kr�|jt	td|�|�n|jt
td|�|�dS|jtt|�j
d�d�dS)Nrr�z<Bi��z<Hli���z<ir�r�r�sL
i�)r�r|�BININT1r
�BININT2�BININTr�r�ru�LONG1�LONG4�LONGr�r�)rr��encodedr{rrr�	save_long�s&
z_Pickler.save_longcCs<|jr|jttd|��n|jtt|�jd�d�dS)Nz>dr�r�)r�r|�BINFLOATr
�FLOATr�r�)rr�rrr�
save_float�sz_Pickler.save_floatcCs�|jdkr@|s |jtf|d�n|jtjt|d�df|d�dSt|�}|dkrj|jtt	d|�|�nD|dkr�|jdkr�|jt
t	d|�|�n|jtt	d	|�|�|j|�dS)
Nr)r��latin1r�z<Bl��rz<Qz<I)
r�r��bytes�codecsr�r�rur|�SHORT_BINBYTESr
�	BINBYTES8�BINBYTESr�)rr�r{rrr�
save_bytes�s
z_Pickler.save_bytescCs�|jr�|jdd�}t|�}|dkrF|jdkrF|jttd|�|�q�|dkrr|jdkrr|jttd|�|�q�|jttd|�|�n0|j	d	d
�}|j	dd�}|jt
|jd
�d�|j|�dS)Nzutf-8�
surrogatepassr�rz<Bl��z<Qz<I�\z\u005c�
z\u000azraw-unicode-escaper�)r�r�rur�r|�SHORT_BINUNICODEr
�BINUNICODE8�
BINUNICODE�replace�UNICODEr�)rr�rr{rrr�save_str�sz_Pickler.save_strcCsB|s(|jr|jt�n|jtt�dSt|�}|j}|j}|dkr�|jdkr�x|D]}||�qTWt	|�|kr�|j
|t	|�d�}|jt||�n|jt|�|j
|�dS|j}|t�x|D]}||�q�Wt	|�|k�r,|j
|t	|�d�}|j�r|t|�n|t|d|�dS|t�|j
|�dS)Nrr�rr�)r�r|�EMPTY_TUPLE�MARK�TUPLErur�r�r�r�r�r��_tuplesize2coder��POP_MARK)rr�r{r�r��elementr�r|rrr�
save_tuple�s:


z_Pickler.save_tuplecCs8|jr|jt�n|jtt�|j|�|j|�dS)N)r�r|�
EMPTY_LISTr�LISTr�r�)rr�rrr�	save_lists

z_Pickler.save_listi�cCs�|j}|j}|js4x|D]}||�|t�qWdSt|�}xrtt||j��}t|�}|dkr�|t	�x|D]}||�qlW|t
�n|r�||d�|t�||jkr>dSq>WdS)Nr�r)r�r|r��APPEND�iterr�r�
_BATCHSIZErur�APPENDS)rr�r�r|rf�it�tmpr{rrrr�s*



z_Pickler._batch_appendscCs<|jr|jt�n|jtt�|j|�|j|j��dS)N)r�r|�
EMPTY_DICTr�DICTr�r�r�)rr�rrr�	save_dict.s

z_Pickler.save_dictc	Cs�|j}|j}|js@x(|D] \}}||�||�|t�qWdSt|�}x�tt||j��}t|�}|dkr�|t	�x |D]\}}||�||�qxW|t
�n(|r�|d\}}||�||�|t�||jkrJdSqJWdS)Nr�r)r�r|r��SETITEMr#r�rr$rur�SETITEMS)	rr�r�r|�k�vr&r'r{rrrr�;s2

z_Pickler._batch_setitemscCs�|j}|j}|jdkr0|jtt|�f|d�dS|t�|j|�t|�}xXtt	||j
��}t|�}|dkr�|t�x|D]}||�qzW|t
�||j
krLdSqLWdS)Nr)r�r)r�r|r�r��setr��	EMPTY_SETr�r#rr$rur�ADDITEMS)rr�r�r|r&Zbatchr{�itemrrr�save_setZs$



z_Pickler.save_setcCs�|j}|j}|jdkr0|jtt|�f|d�dS|t�x|D]}||�q>Wt|�|jkr�|t	|j
|jt|�d��dS|t�|j|�dS)Nr)r�r)
r�r|r�r��	frozensetr�rr�r�rr��	FROZENSETr�)rr�r�r|r2rrr�save_frozensetrs

 z_Pickler.save_frozensetc
CsT|j}|j}|dkr t|dd�}|dkr.|j}t||�}y(t|dd�tj|}t||�\}}Wn,t	t
tfk
r�td|||f��YnX||k	r�td|||f��|j
dk�rtj||f�}	|	�r|	dkr�|ttd|	��n0|	d	k�r|ttd
|	��n|ttd|	��dS|jd�d}
||k�r4|
}|j
d
k�r^|j|�|j|�|t�n�||k	�rz|jt||
f�n�|j
dk�r�|tt|d�dt|d�d�n�|j�r�tj}tj}||f|k�r�|||f\}}n||k�r�||}y(|tt|d�dt|d�d�Wn*tk
�rDtd|||j
f��YnX|j|�dS)Nrr)�levelz(Can't pickle %r: it's not found as %s.%sz2Can't pickle %r: it's not the same object as %s.%sr�r�z<Bi��z<Hz<ir�rrzutf-8r�r�z?can't pickle global identifier '%s.%s' using pickle protocol %i) r|r�r�rr��
__import__r�r�r��ImportError�KeyErrorr�r
r�rr��EXT1r
�EXT2�EXT4�
rpartitionr��STACK_GLOBALr��GLOBALr	r��_compat_pickleZREVERSE_NAME_MAPPINGZREVERSE_IMPORT_MAPPINGr�r�)
rr�r�r|r�r�r�Zobj2r��codeZlastnameZr_name_mappingZr_import_mappingrrrr��sn







$
&z_Pickler.save_globalcCs`|td�kr|jtd|d�S|tt�kr:|jttf|d�S|td�krV|jtd|d�S|j|�S)N)r�.)N).)r�r��NotImplementedr�)rr�rrr�	save_type�sz_Pickler.save_type)N)T)NNNN)N)+rrrr r�rr�r�r�r�r�r�r�r�r�r�r��boolrr�r�floatrr	rr�rr�r!r�r$r�r*�dictr!r�r3r/r6r4r�rDrrrrrr�YsV)
	
B
c1		

B	r�c@sneZdZdddd�dd�Zdd�Zd	d
�Zdd�ZiZd
d�Zeee	d<dd�Z
e
eed<dd�Zeee
d<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<d d!�Zeeed<d"d#�Zeeed<d$d%�Zeeed<d&d'�Z e ee!d<d(d)�Z"e"ee#d<d*d+�Z$e$ee%d<d,d-�Z&e&ee'd<d.d/�Z(d0d1�Z)e)ee*d<d2d3�Z+e+ee,d<d4d5�Z-e-ee.d<d6d7�Z/e/ee0d<d8d9�Z1e1ee2d<d:d;�Z3e3ee4d<d<d=�Z5e5ee6d<d>d?�Z7e7ee8d<d@dA�Z9e9ee:d<dBdC�Z;e;ee<d<dDdE�Z=e=ee>d<dFdG�Z?e?ee@d<dHdI�ZAeAeeBd<dJdK�ZCeCeeDd<dLdM�ZEeEeeFd<dNdO�ZGeGeeHd<dPdQ�ZIeIeeJd<dRdS�ZKeKeeLd<dTdU�ZMeMeeNd<dVdW�ZOeOeePd<dXdY�ZQeQeeRd<dZd[�ZSd\d]�ZTeTeeUd<d^d_�ZVeVeeWd<d`da�ZXeXeeYd<dbdc�ZZeZee[d<ddde�Z\e\ee]d<dfdg�Z^e^ee_d<dhdi�Z`e`eead<djdk�Zbebeecd<dldm�Zdedeeed<dndo�Zfdpdq�Zgdrds�Zheheeid<dtdu�Zjejeekd<dvdw�Zleleemd<dxdy�Zneneeod<dzd{�Zpepeeqd<d|d}�Zrereesd<d~d�Zteteeud<d�d��Zveveewd<d�d��Zxexeeyd<d�d��Zzezee{d<d�d��Z|e|ee}d<d�d��Z~e~eed<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�S)��
_UnpicklerT�ASCII�strict)r��encoding�errorscCs2|j|_|j|_i|_||_||_d|_||_dS)a�This takes a binary file for reading a pickle data stream.

        The protocol version of the pickle is detected automatically, so
        no proto argument is needed.

        The argument *file* must have two methods, a read() method that
        takes an integer argument, and a readline() method that requires
        no arguments.  Both methods should return bytes.  Thus *file*
        can be a binary file object opened for reading, an io.BytesIO
        object, or any other custom object that meets this interface.

        The file-like object must have two methods, a read() method
        that takes an integer argument, and a readline() method that
        requires no arguments.  Both methods should return bytes.
        Thus file-like object can be a binary file object opened for
        reading, a BytesIO object, or any other custom object that
        meets this interface.

        Optional keyword arguments are *fix_imports*, *encoding* and
        *errors*, which are used to control compatibility support for
        pickle stream generated by Python 2.  If *fix_imports* is True,
        pickle will try to map the old Python 2 names to the new names
        used in Python 3.  The *encoding* and *errors* tell pickle how
        to decode 8-bit string instances pickled by Python 2; these
        default to 'ASCII' and 'strict', respectively. *encoding* can be
        'bytes' to read theses 8-bit string instances as bytes objects.
        rN)	r��_file_readliner��
_file_readr�rKrLr�r�)rr�r�rKrLrrrr �sz_Unpickler.__init__cCs�t|d�std|jjf��t|j|j�|_|jj|_|jj	|_	g|_
g|_|jj|_d|_
|j}|j}y*x$|d�}|s|t�||d|�qlWWn"tk
r�}z|jSd}~XnXdS)z�Read a pickled object representation from the open file.

        Return the reconstituted object hierarchy specified in the file.
        rNz4Unpickler.__init__() was not called by %s.__init__()rr�N)r�rr�rr}rNrM�	_unframerr�r��	metastack�stack�appendr�r��EOFErrorrr)rr�r��keyZstopinstrrrrs(



z_Unpickler.loadcCs |j}|jj�|_|jj|_|S)N)rQrP�poprR)rr�rrr�pop_marks
z_Unpickler.pop_markcCstd��dS)Nz%unsupported persistent id encountered)r)rr�rrr�persistent_load%sz_Unpickler.persistent_loadcCs<|jd�d}d|ko tkns2td|��||_dS)Nr�rzunsupported pickle protocol: %d)r�r�r�r�)rr�rrr�
load_proto*sz_Unpickler.load_protorcCs8td|jd��\}|tjkr(td|��|jj|�dS)Nz<Q�zframe size > sys.maxsize: %d)rr�r�r	r�rOr�)rr�rrrr�1s
z_Unpickler.load_framecCsLy|j�dd�jd�}Wntk
r6td��YnX|j|j|��dS)Nr�r�z2persistent IDs in protocol 0 must be ASCII stringsr�)r��decode�UnicodeDecodeErrorrrRrW)rr�rrr�load_persid8sz_Unpickler.load_persidcCs|jj�}|j|j|��dS)N)rQrUrRrW)rr�rrr�load_binpersidAs
z_Unpickler.load_binpersidcCs|jd�dS)N)rR)rrrr�	load_noneFsz_Unpickler.load_nonecCs|jd�dS)NF)rR)rrrr�
load_falseJsz_Unpickler.load_falsecCs|jd�dS)NT)rR)rrrr�	load_trueNsz_Unpickler.load_truecCsL|j�}|tdd�krd}n |tdd�kr4d}n
t|d�}|j|�dS)Nr�FTr)r�r�r�r�rR)rrz�valrrr�load_intRs
z_Unpickler.load_intcCs|jtd|jd��d�dS)Nz<irr)rRrr�)rrrr�load_binint]sz_Unpickler.load_binintcCs|j|jd�d�dS)Nr�r)rRr�)rrrr�load_binint1asz_Unpickler.load_binint1cCs|jtd|jd��d�dS)Nz<Hr�r)rRrr�)rrrr�load_binint2esz_Unpickler.load_binint2cCs@|j�dd�}|r,|ddkr,|dd�}|jt|d��dS)Nr�r+rr�r��Lr�)r�rRr�)rrarrr�	load_longisz_Unpickler.load_longcCs*|jd�d}|j|�}|jt|��dS)Nr�r)r�rRr�)rr{rzrrr�
load_long1ps
z_Unpickler.load_long1cCs>td|jd��\}|dkr"td��|j|�}|jt|��dS)Nz<irrz#LONG pickle has negative byte count)rr�rrRr�)rr{rzrrr�
load_long4vs

z_Unpickler.load_long4cCs|jt|j�dd���dS)Nr�r�)rRrFr�)rrrr�
load_floatsz_Unpickler.load_floatcCs|jtd|jd��d�dS)Nz>drYr)rRrr�)rrrr�
load_binfloat�sz_Unpickler.load_binfloatcCs"|jdkr|S|j|j|j�SdS)Nr	)rKrZrL)rrrrr�_decode_string�s
z_Unpickler._decode_stringcCsl|j�dd�}t|�dkrF|d|dkrF|ddkrF|dd�}ntd��|j|jtj|�d��dS)	Nr�r�rs"'z)the STRING opcode argument must be quotedr�r�r�)r�rurrRrlr
�
escape_decode)rrzrrr�load_string�s
(z_Unpickler.load_stringcCs@td|jd��\}|dkr"td��|j|�}|j|j|��dS)Nz<irrz(BINSTRING pickle has negative byte count)rr�rrRrl)rrurzrrr�load_binstring�s

z_Unpickler.load_binstringcCs:td|jd��\}|tkr&tdt��|j|j|��dS)Nz<Irz2BINBYTES exceeds system's maximum size of %d bytes)rr�r	rrR)rrurrr�
load_binbytes�s
z_Unpickler.load_binbytescCs |jt|j�dd�d��dS)Nr�zraw-unicode-escaper�)rRr�r�)rrrr�load_unicode�sz_Unpickler.load_unicodecCsBtd|jd��\}|tkr&tdt��|jt|j|�dd��dS)Nz<Irz4BINUNICODE exceeds system's maximum size of %d byteszutf-8r)rr�r	rrRr�)rrurrr�load_binunicode�s
z_Unpickler.load_binunicodecCsBtd|jd��\}|tkr&tdt��|jt|j|�dd��dS)Nz<QrYz5BINUNICODE8 exceeds system's maximum size of %d byteszutf-8r)rr�r	rrRr�)rrurrr�load_binunicode8�s
z_Unpickler.load_binunicode8cCs:td|jd��\}|tkr&tdt��|j|j|��dS)Nz<QrYz3BINBYTES8 exceeds system's maximum size of %d bytes)rr�r	rrR)rrurrr�load_binbytes8�s
z_Unpickler.load_binbytes8cCs,|jd�d}|j|�}|j|j|��dS)Nr�r)r�rRrl)rrurzrrr�load_short_binstring�s
z_Unpickler.load_short_binstringcCs"|jd�d}|j|j|��dS)Nr�r)r�rR)rrurrr�load_short_binbytes�sz_Unpickler.load_short_binbytescCs*|jd�d}|jt|j|�dd��dS)Nr�rzutf-8r)r�rRr�)rrurrr�load_short_binunicode�sz _Unpickler.load_short_binunicodecCs|j�}|jt|��dS)N)rVrRr�)rr�rrr�
load_tuple�sz_Unpickler.load_tuplecCs|jf�dS)N)rR)rrrr�load_empty_tuple�sz_Unpickler.load_empty_tuplecCs|jdf|jd<dS)Nr�r�r�)rQ)rrrr�load_tuple1�sz_Unpickler.load_tuple1cCs$|jd|jdfg|jdd�<dS)Nr�r�r�r�r�)rQ)rrrr�load_tuple2�sz_Unpickler.load_tuple2cCs,|jd|jd|jdfg|jdd�<dS)Nrr�r����r�r�r|)rQ)rrrr�load_tuple3�sz_Unpickler.load_tuple3cCs|jg�dS)N)rR)rrrr�load_empty_list�sz_Unpickler.load_empty_listcCs|ji�dS)N)rR)rrrr�load_empty_dictionary�sz _Unpickler.load_empty_dictionarycCs|jt��dS)N)rRr/)rrrr�load_empty_set�sz_Unpickler.load_empty_setcCs|j�}|jt|��dS)N)rVrRr4)rr�rrr�load_frozenset�sz_Unpickler.load_frozensetcCs|j�}|j|�dS)N)rVrR)rr�rrr�	load_list�sz_Unpickler.load_listcs4|j���fdd�tdt��d�D�}|j|�dS)Ncsi|]}�|d�|�qS)r�r)rer�)r�rr�
<dictcomp>sz(_Unpickler.load_dict.<locals>.<dictcomp>rr�)rV�rangerurR)r�dr)r�r�	load_dicts
z_Unpickler.load_dictcCs�|st|t�st|d�rly||�}Wqvtk
rh}z&td|jt|�ftj�d��WYdd}~XqvXn
|j|�}|j	|�dS)NZ__getinitargs__zin constructor for %s: %sr�)
r�r�r�r�rr�r��exc_infor�rR)r�klassr�r�errrrr�_instantiates
0
z_Unpickler._instantiatecCsL|j�dd�jd�}|j�dd�jd�}|j||�}|j||j��dS)Nr�r�r�r�)r�rZ�
find_classr�rV)rr�r�r�rrr�	load_instsz_Unpickler.load_instcCs"|j�}|jd�}|j||�dS)Nr)rVrUr�)rr�r�rrr�load_obj!s
z_Unpickler.load_objcCs2|jj�}|jj�}|j|f|��}|j|�dS)N)rQrUr�rR)rr�r�r�rrr�load_newobj(s

z_Unpickler.load_newobjcCs>|jj�}|jj�}|jj�}|j|f|�|�}|j|�dS)N)rQrUr�rR)rr�r�r�r�rrr�load_newobj_ex/s



z_Unpickler.load_newobj_excCsF|j�dd�jd�}|j�dd�jd�}|j||�}|j|�dS)Nr�zutf-8r�r�)r�rZr�rR)rr�r�r�rrr�load_global7sz_Unpickler.load_globalcCsJ|jj�}|jj�}t|�tk	s,t|�tk	r4td��|j|j||��dS)NzSTACK_GLOBAL requires str)rQrUr�r�rrRr�)rr�r�rrr�load_stack_global>s


z_Unpickler.load_stack_globalcCs|jd�d}|j|�dS)Nr�r)r��
get_extension)rrBrrr�	load_ext1Fsz_Unpickler.load_ext1cCs td|jd��\}|j|�dS)Nz<Hr�)rr�r�)rrBrrr�	load_ext2Ksz_Unpickler.load_ext2cCs td|jd��\}|j|�dS)Nz<ir)rr�r�)rrBrrr�	load_ext4Psz_Unpickler.load_ext4cCspg}tj||�}||k	r&|j|�dStj|�}|sP|dkrDtd��td|��|j|�}|t|<|j|�dS)NrzEXT specifies code <= 0zunregistered extension code %d)rr�rRrrr�r�)rrBZnilr�rTrrrr�Us


z_Unpickler.get_extensioncCs�|jdkrF|jrF||ftjkr2tj||f\}}n|tjkrFtj|}t|dd�|jdkrpttj||�dSt	tj||�SdS)Nrr)r7r)
r�r�rAZNAME_MAPPINGZIMPORT_MAPPINGr8r�r�r�r�)rr�r�rrrr�es


z_Unpickler.find_classcCs&|j}|j�}|d}||�|d<dS)Nr�r�r�)rQrU)rrQr�r�rrr�load_reducersz_Unpickler.load_reducecCs|jr|jd=n|j�dS)Nr�r�)rQrV)rrrr�load_popys
z_Unpickler.load_popcCs|j�dS)N)rV)rrrr�
load_pop_mark�sz_Unpickler.load_pop_markcCs|j|jd�dS)Nr�r�)rRrQ)rrrr�load_dup�sz_Unpickler.load_dupcCs(t|j�dd��}|j|j|�dS)Nr�r�)r�r�rRr�)rr�rrr�load_get�sz_Unpickler.load_getcCs"|jd�d}|j|j|�dS)Nr�r)r�rRr�)rr�rrr�load_binget�sz_Unpickler.load_bingetcCs&td|jd��\}|j|j|�dS)Nz<Ir)rr�rRr�)rr�rrr�load_long_binget�sz_Unpickler.load_long_bingetcCs8t|j�dd��}|dkr$td��|jd|j|<dS)Nr�rznegative PUT argumentr�r�)r�r�r�rQr�)rr�rrr�load_put�sz_Unpickler.load_putcCs2|jd�d}|dkrtd��|jd|j|<dS)Nr�rznegative BINPUT argumentr�)r�r�rQr�)rr�rrr�load_binput�sz_Unpickler.load_binputcCs6td|jd��\}|tkr"td��|jd|j|<dS)Nz<Irznegative LONG_BINPUT argumentr�r�)rr�r	r�rQr�)rr�rrr�load_long_binput�sz_Unpickler.load_long_binputcCs|j}|jd|t|�<dS)Nr�r�)r�rQru)rr�rrr�load_memoize�sz_Unpickler.load_memoizecCs$|j}|j�}|d}|j|�dS)Nr�r�)rQrUrR)rrQrr�rrr�load_append�sz_Unpickler.load_appendcCsH|j�}|jd}t|t�r(|j|�n|j}x|D]}||�q4WdS)Nr�r�)rVrQr�r��extendrR)rr�Zlist_objrRr2rrr�load_appends�s


z_Unpickler.load_appendscCs*|j}|j�}|j�}|d}|||<dS)Nr�r�)rQrU)rrQrrTrGrrr�load_setitem�s
z_Unpickler.load_setitemcCsD|j�}|jd}x,tdt|�d�D]}||d|||<q$WdS)Nr�rr�r�)rVrQr�ru)rr�rGr�rrr�
load_setitems�s
z_Unpickler.load_setitemscCsH|j�}|jd}t|t�r(|j|�n|j}x|D]}||�q4WdS)Nr�r�)rVrQr�r/�update�add)rr�Zset_objr�r2rrr�
load_additems�s


z_Unpickler.load_additemsc
Cs�|j}|j�}|d}t|dd�}|dk	r6||�dSd}t|t�rXt|�dkrX|\}}|r�|j}tj}x6|j	�D]*\}}	t
|�tkr�|	|||�<qr|	||<qrW|r�x |j	�D]\}}	t|||	�q�WdS)Nr��__setstate__r�r�)
rQrUr�r�r�ru�__dict__r��internr�r�r��setattr)
rrQr�Zinst�setstateZ	slotstateZ	inst_dictr�r-r.rrr�
load_build�s(z_Unpickler.load_buildcCs"|jj|j�g|_|jj|_dS)N)rPrRrQ)rrrr�	load_mark�sz_Unpickler.load_markcCs|jj�}t|��dS)N)rQrUr)rrrrr�	load_stop�s
z_Unpickler.load_stopN)�rrrr rrVrWr�rXr�r�rvr\r�r]r�r^r�r_r�r`r�rb�INTrcr�rdr�rer�rgrrhrrirrjrrkrrlrn�STRINGro�	BINSTRINGrpr
rqrrrrrsrrtrru�SHORT_BINSTRINGrvrrwrrxrryrrz�TUPLE1r{�TUPLE2r}�TUPLE3r~rrr(r�r0r�r5r�r r�r)r�r��INSTr��OBJr�r�r�r�r�r@r�r?r�r;r�r<r�r=r�r�r�r�r�r�r�rr��DUPr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r"r�r%r�r+r�r,r�r1r�r�r�rr�r�rrrrrH�s$		
		rHT)r�cCst|||d�j|�dS)N)r�)r�r)r�r�r�r�rrr�_dumpsr�cCs(tj�}t|||d�j|�|j�}|S)N)r�)rlrmr�r�getvalue)r�r�r�ry�resrrr�_dumpssr�rIrJ)r�rKrLcCst||||d�j�S)N)r�rKrL)rHr)r�r�rKrLrrr�_load
sr�cCs0t|t�rtd��tj|�}t||||d�j�S)Nz%Can't load pickle from unicode string)r�rKrL)r�r�r�rlrmrHr)�sr�rKrLr�rrr�_loadss


r�)	rr
rrrrrrrcCsddl}|j�S)Nr)�doctestZtestmod)r�rrr�_test*sr�r�z$display contents of the pickle files)Zdescription�pickle_file�br�*zthe pickle file)r��nargs�helpz-tz--test�
store_truezrun self-test suite)�actionr�z-vz)run verbosely; only affects self-test run)N)N)�r�typesr�copyregrrrr�	itertoolsr�	functoolsrr�r	Zstructr
rrcrlr
rA�__all__r	�	bytearrayZbytes_typesZformat_versionZcompatible_formatsr�r��	Exceptionrr
rrZorg.python.corer!r9rr�r�rr�rr�r�r�rr�r�r�r�r�r�r�r�rrr"r�r@r)r(r%r�r�r�r�r rr�r�r�r�r+rrr,rr�r�r�r�r;r<r=r�r�r�r�r�rrrr
rrrrr0r1r5r�r?r�rvr��dirrhr}r�r�r�r�r�rHr�r�r�r��_picklerrrrrrr�r�argparse�ArgumentParser�parser�add_argumentZFileType�
parse_argsr�Ztestr�Z
print_help�pprintryr�rrrr�<module>s.

$*
-0






Zerion Mini Shell 1.0