ok

Mini Shell

Direktori : /opt/alt/python35/lib64/python3.5/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/__pycache__/pickle.cpython-35.pyc



L�Map��@s�dZddlmZddlmZddlmZmZmZddlm	Z	ddl
Z
ddl
mZddlm
Z
mZddlZddlZddlZddlZd	d
ddd
ddddg	ZeefZdZdddddddgZdZdZGdd	�d	e�ZGdd
�d
e�ZGdd�de�ZGdd�de�Zydd l m!Z!Wne"k
r�dZ!YnXd!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1d0Z2d1Z3d2Z4d3Z5d4Z6d5Z7d6Z8d7Z9d8Z:d9Z;d:Z<d;Z=d<Z>d=Z?d>Z@d?ZAd@ZBdAZCdBZDdCZEdDZFdEZGdFZHdGZIdHZJdIZKdJZLdKZMdLZNdMZOdNZPdOZQdPZRdQZSdRZTdSZUdTZVdUZWdVZXdWZYeIeSeTeUgZZdXZ[dYZ\dZZ]d[Z^d\Z_d]Z`d^Zad_Zbd`ZcdaZddbZedcZfejgddde�eh�D��Gdfdg�dg�ZiGdhdi�di�Zjdjdk�Zkdldm�Zldndo�Zmdpdq�ZnGdrds�ds�ZoGdtdu�du�Zpddvdwdxdy�Zqddvdwdzd{�Zrdvdwd|d}d~dd�d��Zsdvdwd|d}d~dd�d��ZtyDdd�lumZmZmZmvZvmwZwmxZxmyZymzZzm{Z{WnBe"k
r�eoepf\ZvZweqeresetf\ZxZyZzZ{YnXd�d��Z|e}d�kr�ddl~Z~e~jd�d��Z�e�j�d�d�e~j�d��d�d�d�d��e�j�d�d�d�d�d�d��e�j�d�d�d�d�d��e�j��Z�e�j�rse|�nPe�j�r�e�j��n9ddl�Z�x*e�j�D]Z�eze��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)�isliceN)�maxsize)�pack�unpack�PickleError�
PicklingError�UnpicklingError�Pickler�	Unpickler�dump�dumps�load�loadsz4.0z1.0z1.1z1.2z1.3z2.0z3.0��c@seZdZdZdS)rz6A common base class for the other pickling exceptions.N)�__name__�
__module__�__qualname__�__doc__�rr�+/opt/alt/python35/lib64/python3.5/pickle.pyr?sc@seZdZdZdS)rz]This exception is raised when an unpicklable object is passed to the
    dump() method.

    N)rrrrrrrrrCsc@seZdZdZdS)r
aThis 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)rrrrrrrrr
Jsc@seZdZdd�ZdS)�_StopcCs
||_dS)N)�value)�selfrrrr�__init__Xsz_Stop.__init__N)rrrrrrrrrWsr)�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
s�s�s�s�s�s�s�s�s�s�s�s��B�Cs�s�s�s�s�s�s�s�s�s�cCs(g|]}tjd|�r|�qS)z[A-Z][A-Z0-9_]+$)�re�match)�.0�xrrr�
<listcomp>�s	rPc@sUeZdZdZdd�Zdd�Zdd�Zd	d
d�Zdd
�ZdS)�_Framer�@icCs||_d|_dS)N)�
file_write�
current_frame)rrSrrrr�s	z_Framer.__init__cCstj�|_dS)N)�io�BytesIOrT)rrrr�
start_framing�sz_Framer.start_framingcCs;|jr7|jj�dkr7|jdd�d|_dS)Nr�forceT)rT�tell�commit_frame)rrrr�end_framing�sz_Framer.end_framingFcCs�|jr�|j}|j�|jks-|r�|j��C}t|�}|j}|t�|td|��||�WdQRX|jd�|j	�dS)Nz<Qr)
rTrY�_FRAME_SIZE_TARGET�	getbuffer�lenrS�FRAMEr	�seek�truncate)rrX�f�data�n�writerrrrZ�s			

z_Framer.commit_framecCs*|jr|jj|�S|j|�SdS)N)rTrerS)rrcrrrre�s	z
_Framer.writeNi)	rrrr\rrWr[rZrerrrrrQ�s
rQc@sCeZdZddd�Zdd�Zdd�Zdd	�ZdS)
�	_UnframerNcCs||_||_d|_dS)N)�	file_read�
file_readlinerT)rrgrhZ	file_tellrrrr�s		z_Unframer.__init__cCsw|jrf|jj|�}|rD|dkrDd|_|j|�St|�|krbtd��|S|j|�SdS)Nrz$pickle exhausted before end of frame)rT�readrgr^r
)rrdrcrrrri�s		
	z_Unframer.readcCs_|jrQ|jj�}|s1d|_|j�S|ddkrMtd��|S|j�SdS)N�s
rz$pickle exhausted before end of frame����
)rT�readlinerhr
)rrcrrrrm�s		
	z_Unframer.readlinecCsI|jr*|jj�dkr*td��tj|j|��|_dS)N�z4beginning of a new frame before end of current frame)rTrir
rUrVrg)r�
frame_sizerrr�
load_frame�s	z_Unframer.load_frame)rrrrrirmrprrrrrf�s

rfcCs�x�|jd�D]p}|dkr:tdj||���y|}t||�}Wqtk
rtdj||���YqXqW||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	
	rycCs�t|dd�}|dk	r"|Sxtttjj��D]]\}}|dks8|dkr_q8y!t||�d|kr|SWq8tk
r�Yq8Xq8WdS)z$Find the module an object belong to.rN�__main__r)ru�list�sys�modules�itemsryrs)rvrw�module_name�modulerrr�whichmodules"
	r�cCs�|dkrdS|j�d?d}|j|dddd�}|dkr�|dkr�|d
d	kr�|dd@dkr�|dd�}|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'
    >>>
    rrnrrj�	byteorder�little�signedT���Nrk���rk)�
bit_length�to_bytes)rO�nbytes�resultrrr�encode_long#s$r�cCstj|dddd�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�r�r�T)�int�
from_bytes)rcrrr�decode_longAsr�c@seZdZddddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zddd�Z	dd�Z
dd�Zdddddd�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	r�e e
e"<d-d.�Z#d/d0�Z$e$e
e%<d1d2�Z&e&e
e'<dd3d4�Z(d5d6�Z)e(e
e*<e)e
e<dS)7�_PicklerN�fix_importsTcCs�|dkrt}|dkr't}n,d|ko>tknsStdt��y|j|_Wntk
r�td��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' attributerjr)�DEFAULT_PROTOCOL�HIGHEST_PROTOCOL�
ValueErrorre�_file_writers�	TypeErrorrQ�framer�memor��proto�bin�fastr�)r�file�protocolr�rrrrZs"	
		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_memocCs�t|d�s(td|jjf��|jdkrT|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�re�PROTOr	r�rW�save�STOPr[)rrvrrrr�s


z
_Pickler.dumpcCsj|jr
dSt|�|jks(t�t|j�}|j|j|��||f|jt|�<dS)zStore an object in the memo.N)r��idr��AssertionErrorr^re�put)rrv�idxrrr�memoize�s	z_Pickler.memoizecCsl|jdkrtS|jrM|dkr9ttd|�Sttd|�Sntt|�jd�dSdS)Nr�z<Bz<I�asciis
)	r��MEMOIZEr��BINPUTr	�LONG_BINPUT�PUT�repr�encode)rr�rrrr��s	z_Pickler.putcCsR|jr7|dkr&ttd|�Sttd|�Stt|�jd�dS)Nr�z<Bz<Ir�s
)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
rd}	YnX|	r7|j|�dSt
|dd�}|dk	rg||j�}nCt
|dd�}|dk	r�|�}ntd|j|f��t|t�r�|j||�dSt|t�s�td|��t|�}
d|
kod	kns$td
|��|j|d|�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 elementsrv)r�rZ�
persistent_id�	save_persr�r�r�re�type�dispatchrur�
issubclassr��save_globalr�rr�
isinstance�str�tupler^�save_reduce)rrv�save_persistent_id�pidrO�trb�reduce�rvZissc�lrrrr��sT





z
_Pickler.savecCsdS)Nr)rrvrrrr�
sz_Pickler.persistent_idcCsy|jr,|j|dd�|jt�nIy(|jtt|�jd�d�Wntk
rttd��YnXdS)Nr�Fr�s
z2persistent IDs in protocol 0 must be ASCII strings)	r�r�re�	BINPERSID�PERSIDr�r��UnicodeEncodeErrorr)rr�rrrr�s	(
z_Pickler.save_perscCset|t�std��t|�s3td��|j}|j}t|dd�}	|jdkr|	dkr|\}
}}t|
d�s�tdj	|	���|dk	r�|
|j
k	r�td	j	|	���||
�||�||�|t�n�|jd
kr�|	dkr�|d}
t|
d�s@td
��|dk	rg|
|j
k	rgtd��|dd�}||
�||�|t�n||�||�|t
�|dk	rt|�|jkr|t|j|jt|�d��n
|j|�|dk	r(|j|�|dk	rA|j|�|dk	ra||�|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 classrj)r�r�r�callabler�rerur�r�rtr��	NEWOBJ_EX�NEWOBJ�REDUCEr�r��POPr�r��_batch_appends�_batch_setitems�BUILD)r�func�args�stateZ	listitemsZ	dictitemsrvr�reZ	func_name�cls�kwargsrrrr�sZ				




		





+



z_Pickler.save_reducecCs|jt�dS)N)re�NONE)rrvrrr�	save_nonezsz_Pickler.save_nonecCsH|jdkr+|j|r!tnt�n|j|r=tnt�dS)Nr�)r�re�NEWTRUE�NEWFALSE�TRUE�FALSE)rrvrrr�	save_bool~sz_Pickler.save_boolcCsA|jr�|dkri|dkr?|jttd|��dS|dkri|jttd|��dSd
|ko�dknr�|jttd|��dS|jd	krt|�}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�re�BININT1r	�BININT2�BININTr�r�r^�LONG1�LONG4�LONGr�r�)rrv�encodedrdrrr�	save_long�s&	!z_Pickler.save_longcCsN|jr&|jttd|��n$|jtt|�jd�d�dS)Nz>dr�s
)r�re�BINFLOATr	�FLOATr�r�)rrvrrr�
save_float�s	z_Pickler.save_floatcCs�|jdkrZ|s.|jtfd|�n(|jtjt|d�dfd|�dSt|�}|dkr�|jtt	d|�|�nZ|dkr�|jdkr�|jt
t	d|�|�n|jtt	d	|�|�|j|�dS)
Nrrv�latin1r�z<Bl��rz<Qz<I)
r�r��bytes�codecsr�r�r^re�SHORT_BINBYTESr	�	BINBYTES8�BINBYTESr�)rrvrdrrr�
save_bytes�s!!z_Pickler.save_bytescCs|jr�|jdd�}t|�}|dkrc|jdkrc|jttd|�|�q|dkr�|jdkr�|jttd|�|�q|jttd|�|�nB|j	d	d
�}|j	dd�}|jt
|jd
�d�|j|�dS)Nzutf-8�
surrogatepassr�rz<Bl��z<Qz<I�\z\u005c�
z\u000azraw-unicode-escapes
)r�r�r^r�re�SHORT_BINUNICODEr	�BINUNICODE8�
BINUNICODE�replace�UNICODEr�)rrvr�rdrrr�save_str�s	!!!z_Pickler.save_strcCs�|s4|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]}||�qWt	|�|kr�|j
|t	|�d�}|jrh|t|�n|t|d|�dS|t�|j
|�dS)Nrr�rrj)r�re�EMPTY_TUPLE�MARK�TUPLEr^r�r�r�r�r�r��_tuplesize2coder��POP_MARK)rrvrdr�r��elementr�rerrr�
save_tuple�s:			

	

	
z_Pickler.save_tuplecCsH|jr|jt�n|jtt�|j|�|j|�dS)N)r�re�
EMPTY_LISTr�LISTr�r�)rrvrrr�	save_list�s
	
z_Pickler.save_listi�cCs�|j}|j}|jsDx"|D]}||�|t�q"WdSt|�}x�tt||j��}t|�}|dkr�|t	�x|D]}||�q�W|t
�n|r�||d�|t�||jkrSdSqSWdS)Nrjr)r�rer��APPEND�iterr{r�
_BATCHSIZEr^r�APPENDS)rr~r�rerO�it�tmprdrrrr�s*			





z_Pickler._batch_appendscCsN|jr|jt�n|jtt�|j|�|j|j��dS)N)r�re�
EMPTY_DICTr�DICTr�r�r~)rrvrrr�	save_dict's
	
z_Pickler.save_dictc	Cs$|j}|j}|jsTx2|D]*\}}||�||�|t�q"WdSt|�}x�tt||j��}t|�}|dkr�|t	�x(|D] \}}||�||�q�W|t
�n4|r	|d\}}||�||�|t�||jkrcdSqcWdS)Nrjr)r�rer��SETITEMrr{rr
r^r�SETITEMS)	rr~r�re�k�vrrrdrrrr�4s2			







z_Pickler._batch_setitemscCs�|j}|j}|jdkrD|jtt|�fd|�dS|t�|j|�t|�}xvtt	||j
��}t|�}|dkr�|t�x|D]}||�q�W|t
�||j
krjdSqjWdS)Nrrvr)r�rer�r��setr{�	EMPTY_SETr�rrr
r^r�ADDITEMS)rrvr�rerZbatchrd�itemrrr�save_setSs$		




z_Pickler.save_setcCs�|j}|j}|jdkrD|jtt|�fd|�dS|t�x|D]}||�qUWt|�|jkr�|t	|j
|jt|�d��dS|t�|j|�dS)Nrrvr)
r�rer�r��	frozensetr{rr�r�rr��	FROZENSETr�)rrvr�rerrrr�save_frozensetks		

(
z_Pickler.save_frozensetc
Cs|j}|j}|dkr0t|dd�}|dkrE|j}t||�}y6t|dd�tj|}t||�\}}Wn4t	t
tfk
r�td|||f��Yn&X||k	r�td|||f��|j
dkr�tj||f�}	|	r�|	dks"t�|	dkrH|ttd|	��n=|	d	krn|ttd
|	��n|ttd|	��dS|jd�d}
||kr�|
}|j
d
kr�|j|�|j|�|t�n ||k	r	|jt||
f�n�|j
dkrG|tt|d�dt|d�d�n�|jr�tj}tj}||f|kr�|||f\}}n||kr�||}y0|tt|d�dt|d�d�Wn.tk
rtd|||j
f��YnX|j |�dS)Nr�levelrz(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<irqrrzutf-8s
r�z?can't pickle global identifier '%s.%s' using pickle protocol %i)!rer�rurr��
__import__r|r}ry�ImportError�KeyErrorrsrr�rr�r��EXT1r	�EXT2�EXT4�
rpartitionr��STACK_GLOBALr��GLOBALr�r��_compat_pickleZREVERSE_NAME_MAPPINGZREVERSE_IMPORT_MAPPINGr�r�)
rrvrwrer�rr�Zobj2rx�codeZlastnameZr_name_mappingZr_import_mappingrrrr��sp			



,			
-
z_Pickler.save_globalcCs�|td�kr(|jtdd|�S|tt�krS|jttfd|�S|td�kr{|jtdd|�S|j|�S)Nrv.)N).)r�r��NotImplementedr�)rrvrrr�	save_type�sz_Pickler.save_type)+rrrrr�rr�r�r�r�r�r�r�r�r�r�r��boolr�r�r��floatr�r�rr�rr�r
r{r
r�r�dictr r�rrrrr�r-rrrrrr�XsV)
	B]




1
	
	



B	
r�c@s"eZdZdddddddd�Zd	d
�Zdd�Zd
d�ZiZdd�Zeee	d<dd�Z
e
eed<dd�Zeee
d<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<d d!�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<d0d1�Z(d2d3�Z)e)ee*d<d4d5�Z+e+ee,d<d6d7�Z-e-ee.d<d8d9�Z/e/ee0d<d:d;�Z1e1ee2d<d<d=�Z3e3ee4d<d>d?�Z5e5ee6d<d@dA�Z7e7ee8d<dBdC�Z9e9ee:d<dDdE�Z;e;ee<d<dFdG�Z=e=ee>d<dHdI�Z?e?ee@d<dJdK�ZAeAeeBd<dLdM�ZCeCeeDd<dNdO�ZEeEeeFd<dPdQ�ZGeGeeHd<dRdS�ZIeIeeJd<dTdU�ZKeKeeLd<dVdW�ZMeMeeNd<dXdY�ZOeOeePd<dZd[�ZQeQeeRd<d\d]�ZSd^d_�ZTeTeeUd<d`da�ZVeVeeWd<dbdc�ZXeXeeYd<ddde�ZZeZee[d<dfdg�Z\e\ee]d<dhdi�Z^e^ee_d<djdk�Z`e`eead<dldm�Zbebeecd<dndo�Zdedeeed<dpdq�Zfdrds�Zgdtdu�Zheheeid<dvdw�Zjejeekd<dxdy�Zleleemd<dzd{�Zneneeod<d|d}�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)��
_Unpicklerr�T�encoding�ASCII�errors�strictcCsI|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)	rm�_file_readlineri�
_file_readr�r2r4r�r�)rr�r�r2r4rrrr�s				z_Unpickler.__init__cCst|d�s(td|jjf��t|j|j�|_|jj|_|jj	|_	t
�|_g|_|jj
|_
d|_|j}|j}yJxC|d�}|s�t�t|t�s�t�||d|�q�WWn,tk
r}z|jSWYdd}~XnXdS)z�Read a pickled object representation from the open file.

        Return the reconstituted object hierarchy specified in the file.
        r7z4Unpickler.__init__() was not called by %s.__init__()rrjN)r�r
r�rrfr7r6�	_unframerrirm�object�mark�stack�appendr�r��EOFErrorr��bytes_typesr�rr)rrir��keyZstopinstrrrr�s*				z_Unpickler.loadcCsG|j}|j}t|�d}x|||k	rB|d}q%W|S)Nrj)r;r:r^)rr;r:rrrr�markers		z_Unpickler.markercCstd��dS)Nz%unsupported persistent id encountered)r
)rr�rrr�persistent_load&sz_Unpickler.persistent_loadcCsL|jd�d}d|ko*tkns?td|��||_dS)Nrjrzunsupported pickle protocol: %d)rir�r�r�)rr�rrr�
load_proto+sz_Unpickler.load_protorcCsNtd|jd��\}|tjkr:td|��|jj|�dS)Nz<Q�zframe size > sys.maxsize: %d)r
rir|rr�r8rp)rrorrrrp2sz_Unpickler.load_framecCs^y#|j�dd�jd�}Wntk
rCtd��YnX|j|j|��dS)Nrjr�z2persistent IDs in protocol 0 must be ASCII stringsrk)rm�decode�UnicodeDecodeErrorr
r<rA)rr�rrr�load_persid9s#
z_Unpickler.load_persidcCs)|jj�}|j|j|��dS)N)r;�popr<rA)rr�rrr�load_binpersidBsz_Unpickler.load_binpersidcCs|jd�dS)N)r<)rrrr�	load_noneGsz_Unpickler.load_nonecCs|jd�dS)NF)r<)rrrr�
load_falseKsz_Unpickler.load_falsecCs|jd�dS)NT)r<)rrrr�	load_trueOsz_Unpickler.load_truecCsj|j�}|tdd�kr+d}n.|tdd�krJd}nt|d�}|j|�dS)NrjFTr)rmr�r�r�r<)rrc�valrrr�load_intSs		z_Unpickler.load_intcCs'|jtd|jd��d�dS)Nz<irr)r<r
ri)rrrr�load_binint^sz_Unpickler.load_binintcCs|j|jd�d�dS)Nrjr)r<ri)rrrr�load_binint1bsz_Unpickler.load_binint1cCs'|jtd|jd��d�dS)Nz<Hr�r)r<r
ri)rrrr�load_binint2fsz_Unpickler.load_binint2cCsV|j�dd�}|r<|ddkr<|dd�}|jt|d��dS)Nrjr*rrkrk�Lrk)rmr<r�)rrLrrr�	load_longjsz_Unpickler.load_longcCs9|jd�d}|j|�}|jt|��dS)Nrjr)rir<r�)rrdrcrrr�
load_long1qsz_Unpickler.load_long1cCsYtd|jd��\}|dkr3td��|j|�}|jt|��dS)Nz<irrz#LONG pickle has negative byte count)r
rir
r<r�)rrdrcrrr�
load_long4ws
z_Unpickler.load_long4cCs'|jt|j�dd���dS)Nrjrk)r<r/rm)rrrr�
load_float�sz_Unpickler.load_floatcCs'|jtd|jd��d�dS)Nz>drCr)r<r
ri)rrrr�
load_binfloat�sz_Unpickler.load_binfloatcCs-|jdkr|S|j|j|j�SdS)Nr�)r2rDr4)rrrrr�_decode_string�sz_Unpickler._decode_stringcCs�|j�dd�}t|�dkr_|d|dkr_|ddkr_|dd�}ntd��|j|jtj|�d��dS)	Nrjr�rs"'z)the STRING opcode argument must be quotedrkrkrk)rmr^r
r<rWr��
escape_decode)rrcrrr�load_string�s
6z_Unpickler.load_stringcCs\td|jd��\}|dkr3td��|j|�}|j|j|��dS)Nz<irrz(BINSTRING pickle has negative byte count)r
rir
r<rW)rr^rcrrr�load_binstring�s
z_Unpickler.load_binstringcCsQtd|jd��\}|tkr7tdt��|j|j|��dS)Nz<Irz2BINBYTES exceeds system's maximum size of %d bytes)r
rirr
r<)rr^rrr�
load_binbytes�s

z_Unpickler.load_binbytescCs*|jt|j�dd�d��dS)Nrjzraw-unicode-escaperk)r<r�rm)rrrr�load_unicode�sz_Unpickler.load_unicodecCs]td|jd��\}|tkr7tdt��|jt|j|�dd��dS)Nz<Irz4BINUNICODE exceeds system's maximum size of %d byteszutf-8r�)r
rirr
r<r�)rr^rrr�load_binunicode�s

z_Unpickler.load_binunicodecCs]td|jd��\}|tkr7tdt��|jt|j|�dd��dS)Nz<QrCz5BINUNICODE8 exceeds system's maximum size of %d byteszutf-8r�)r
rirr
r<r�)rr^rrr�load_binunicode8�s

z_Unpickler.load_binunicode8cCsQtd|jd��\}|tkr7tdt��|j|j|��dS)Nz<QrCz3BINBYTES8 exceeds system's maximum size of %d bytes)r
rirr
r<)rr^rrr�load_binbytes8�s

z_Unpickler.load_binbytes8cCs<|jd�d}|j|�}|j|j|��dS)Nrjr)rir<rW)rr^rcrrr�load_short_binstring�sz_Unpickler.load_short_binstringcCs-|jd�d}|j|j|��dS)Nrjr)rir<)rr^rrr�load_short_binbytes�sz_Unpickler.load_short_binbytescCs9|jd�d}|jt|j|�dd��dS)Nrjrzutf-8r�)rir<r�)rr^rrr�load_short_binunicode�sz _Unpickler.load_short_binunicodecCs=|j�}t|j|dd��g|j|d�<dS)Nrj)r@r�r;)rrrrr�
load_tuple�sz_Unpickler.load_tuplecCs|jf�dS)N)r<)rrrr�load_empty_tuple�sz_Unpickler.load_empty_tuplecCs|jdf|jd<dS)Nrjrkrk)r;)rrrr�load_tuple1�sz_Unpickler.load_tuple1cCs.|jd|jdfg|jdd�<dS)Nr�rjr�rkr�)r;)rrrr�load_tuple2�sz_Unpickler.load_tuple2cCs8|jd|jd|jdfg|jdd�<dS)Nrr�rj���r�rkrg)r;)rrrr�load_tuple3�sz_Unpickler.load_tuple3cCs|jg�dS)N)r<)rrrr�load_empty_list�sz_Unpickler.load_empty_listcCs|ji�dS)N)r<)rrrr�load_empty_dictionary�sz _Unpickler.load_empty_dictionarycCs|jt��dS)N)r<r)rrrr�load_empty_set�sz_Unpickler.load_empty_setcCs=|j�}t|j|dd��g|j|d�<dS)Nrj)r@rr;)rrrrr�load_frozenset�sz_Unpickler.load_frozensetcCs7|j�}|j|dd�g|j|d�<dS)Nrj)r@r;)rrrrr�	load_list�sz_Unpickler.load_listcsh|j�}|j|dd���fdd�tdt��d�D�}|g|j|d�<dS)Nrjcs%i|]}�|d�|�qS)rjr)rNr�)r~rr�
<dictcomp>s	z(_Unpickler.load_dict.<locals>.<dictcomp>rr�)r@r;�ranger^)rr�dr)r~r�	load_dicts
z_Unpickler.load_dictcCs�t|j|dd��}|j|d�=|sRt|t�sRt|d�r�y||�}Wq�tk
r�}z1td|jt|�ftj	�d��WYdd}~Xq�Xn|j
|�}|j|�dS)NrjZ__getinitargs__zin constructor for %s: %sr�)r�r;r�r�r�r�rr�r|�exc_infor�r<)r�klassrr�r�errrrr�_instantiates<z_Unpickler._instantiatecCsj|j�dd�jd�}|j�dd�jd�}|j||�}|j||j��dS)Nrjr�rkrk)rmrD�
find_classrur@)rr�rwrsrrr�	load_instsz_Unpickler.load_instcCs6|j�}|jj|d�}|j||�dS)Nrj)r@r;rGru)rrrsrrr�load_obj%sz_Unpickler.load_objcCsA|jj�}|jj�}|j||�}|j|�dS)N)r;rGr�r<)rr�r�rvrrr�load_newobj,sz_Unpickler.load_newobjcCsS|jj�}|jj�}|jj�}|j|||�}|j|�dS)N)r;rGr�r<)rr�r�r�rvrrr�load_newobj_ex3s
z_Unpickler.load_newobj_excCsa|j�dd�jd�}|j�dd�jd�}|j||�}|j|�dS)Nrjzutf-8rkrk)rmrDrvr<)rr�rwrsrrr�load_global;sz_Unpickler.load_globalcCsk|jj�}|jj�}t|�tk	sBt|�tk	rNtd��|j|j||��dS)NzSTACK_GLOBAL requires str)r;rGr�r�r
r<rv)rrwr�rrr�load_stack_globalBs
$z_Unpickler.load_stack_globalcCs$|jd�d}|j|�dS)Nrjr)ri�
get_extension)rr+rrr�	load_ext1Jsz_Unpickler.load_ext1cCs,td|jd��\}|j|�dS)Nz<Hr�)r
rir})rr+rrr�	load_ext2Osz_Unpickler.load_ext2cCs,td|jd��\}|j|�dS)Nz<ir)r
rir})rr+rrr�	load_ext4Tsz_Unpickler.load_ext4cCs�g}tj||�}||k	r5|j|�dStj|�}|sr|dkrbtd��td|��|j|�}|t|<|j|�dS)NrzEXT specifies code <= 0zunregistered extension code %d)rr�r<rr
r�rv)rr+Znilrvr?rrrr}Ys

z_Unpickler.get_extensioncCs�|jdkre|jre||ftjkrItj||f\}}n|tjkretj|}t|dd�|jdkr�ttj||�dSt	tj||�SdS)Nrr rr)
r�r�r*ZNAME_MAPPINGZIMPORT_MAPPINGr!ryr|r}ru)rr�rwrrrrvis
z_Unpickler.find_classcCs3|j}|j�}|d}||�|d<dS)Nrjrkrk)r;rG)rr;r�r�rrr�load_reducevs	
z_Unpickler.load_reducecCs|jd=dS)Nrjrk)r;)rrrr�load_pop}sz_Unpickler.load_popcCs |j�}|j|d�=dS)N)r@r;)rrrrr�
load_pop_mark�sz_Unpickler.load_pop_markcCs|j|jd�dS)Nrjrk)r<r;)rrrr�load_dup�sz_Unpickler.load_dupcCs4t|j�dd��}|j|j|�dS)Nrjrk)r�rmr<r�)rr�rrr�load_get�sz_Unpickler.load_getcCs+|jd�d}|j|j|�dS)Nrjr)rir<r�)rr�rrr�load_binget�sz_Unpickler.load_bingetcCs3td|jd��\}|j|j|�dS)Nz<Ir)r
rir<r�)rr�rrr�load_long_binget�sz_Unpickler.load_long_bingetcCsLt|j�dd��}|dkr4td��|jd|j|<dS)Nrjrznegative PUT argumentrkrk)r�rmr�r;r�)rr�rrr�load_put�sz_Unpickler.load_putcCsC|jd�d}|dkr+td��|jd|j|<dS)Nrjrznegative BINPUT argumentrk)rir�r;r�)rr�rrr�load_binput�sz_Unpickler.load_binputcCsKtd|jd��\}|tkr3td��|jd|j|<dS)Nz<Irznegative LONG_BINPUT argumentrjrk)r
rirr�r;r�)rr�rrr�load_long_binput�sz_Unpickler.load_long_binputcCs$|j}|jd|t|�<dS)Nrjrk)r�r;r^)rr�rrr�load_memoize�s	z_Unpickler.load_memoizecCs0|j}|j�}|d}|j|�dS)Nrjrk)r;rGr<)rr;rr{rrr�load_append�s	
z_Unpickler.load_appendcCs�|j}|j�}||d}||dd�}t|t�rV|j|�n$|j}x|D]}||�qfW||d�=dS)Nrj)r;r@r�r{�extendr<)rr;r:Zlist_objr~r<rrrr�load_appends�s		
z_Unpickler.load_appendscCs9|j}|j�}|j�}|d}|||<dS)Nrjrk)r;rG)rr;rr?r0rrr�load_setitem�s
	
z_Unpickler.load_setitemcCsq|j}|j�}||d}x:t|dt|�d�D]}||d|||<q@W||d�=dS)Nrjr�)r;r@ror^)rr;r:r0r�rrr�
load_setitems�s	#z_Unpickler.load_setitemscCs�|j}|j�}||d}||dd�}t|t�rV|j|�n$|j}x|D]}||�qfW||d�=dS)Nrj)r;r@r�r�update�add)rr;r:Zset_objr~r�rrrr�
load_additems�s		
z_Unpickler.load_additemsc
Cs|j}|j�}|d}t|dd�}|dk	rK||�dSd}t|t�r~t|�dkr~|\}}|r�|j}tj}xI|j	�D];\}}	t
|�tkr�|	|||�<q�|	||<q�W|rx*|j	�D]\}}	t|||	�q�WdS)Nrj�__setstate__r�rk)
r;rGrur�r�r^�__dict__r|�internr~r�r��setattr)
rr;r�Zinst�setstateZ	slotstateZ	inst_dictr�rrrrr�
load_build�s(	

!		z_Unpickler.load_buildcCs|j|j�dS)N)r<r:)rrrr�	load_marksz_Unpickler.load_markcCs|jj�}t|��dS)N)r;rGr)rrrrr�	load_stopsz_Unpickler.load_stopN)�rrrrrr@rAr�rBr�rpr_rFr�rHr�rIr�rJr�rKr�rM�INTrNr�rOr�rPr�rRr�rSr�rTr�rUr�rVr�rWrY�STRINGrZ�	BINSTRINGr[r�r\r�r]r�r^r�r_r�r`�SHORT_BINSTRINGrar�rbr�rcrrdrre�TUPLE1rf�TUPLE2rh�TUPLE3rirrjrrkrrlrrmr	rqrrurw�INSTrx�OBJryr�rzr�r{r)r|r(r~r$rr%r�r&r}rvr�r�r�r�r�rr��DUPr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�rr�rr�rr�rr�r�r�rr�r�rrrrr1�s	$%		
r1r�TcCs t||d|�j|�dS)Nr�)r�r)rvr�r�r�rrr�_dumpsr�cCsMtj�}t||d|�j|�|j�}t|t�sIt�|S)Nr�)rUrVr�r�getvaluer�r>r�)rvr�r�rb�resrrr�_dumpss
r�r2r3r4r5cCs"t|d|d|d|�j�S)Nr�r2r4)r1r)r�r�r2r4rrr�_loadsr�cCsLt|t�rtd��tj|�}t|d|d|d|�j�S)Nz%Can't load pickle from unicode stringr�r2r4)r�r�r�rUrVr1r)�sr�r2r4r�rrr�_loadss
r�)	rrr
rrrrrrcCsddl}|j�S)Nr)�doctestZtestmod)r�rrr�_test3sr�rzZdescriptionz$display contents of the pickle files�pickle_filer�Zbr�nargs�*�helpzthe pickle filez-tz--test�action�
store_truezrun self-test suitez-vz)run verbosely; only affects self-test run)�r�typesr�copyregrrrr�	itertoolsrr|rZstructr	r
rLrUr�r*�__all__r��	bytearrayr>Zformat_versionZcompatible_formatsr�r��	Exceptionrrr
rZorg.python.corer r"rr�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r)rrrr�r�r�r�r	rr�r�r�r�rrrrr�r�r�r�r�r$r%r&r�r�r�r�r�r�r�rr�r�r�r�r�rrrr�r(r�r_r��dirrQrfryr�r�r�r�r1r�r�r�r��_picklerrrrrrr�r�argparse�ArgumentParser�parser�add_argumentZFileType�
parse_argsr�Ztestr�Z
print_help�pprintrbrvrrrr�<module>s"	

$*
��}��;D
#		
	




Zerion Mini Shell 1.0