AlkantarClanX12

Your IP : 3.142.133.210


Current Path : /opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/__pycache__/pickle.cpython-37.opt-2.pyc

B

YI~d���	@sddlmZddlmZddlmZmZmZddlmZddl	m
Z
ddlZddlmZddl
mZmZddlZddlZddlZddlZd	d
ddd
ddddg	ZeefZdZdddddddgZdZdZGdd	�d	e�ZGdd
�d
e�ZGdd�de�ZGdd�de�Z ydd 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-Z0d.Z1d/Z2d0Z3d1Z4d2Z5d3Z6d4Z7d5Z8d6Z9d7Z:d8Z;d9Z<d:Z=d;Z>d<Z?d=Z@d>ZAd?ZBd@ZCdAZDdBZEdCZFdDZGdEZHdFZIdGZJdHZKdIZLdJZMdKZNdLZOdMZPdNZQdOZRdPZSdQZTdRZUdSZVdTZWdUZXdVZYdWZZeJeTeUeVgZ[dXZ\dYZ]dZZ^d[Z_d\Z`d]Zad^Zbd_Zcd`ZddaZedbZfdcZge�hddde�ei�D��Gdfdg�dg�ZjGdhdi�di�Zkdjdk�Zldldm�Zmdndo�Zndpdq�ZoGdrds�ds�ZpGdtdu�du�Zqd�dvdw�dxdy�Zrd�dvdw�dzd{�Zsdvd|d}d~�dd��Ztdvd|d}d~�d�d��Zuy0dd�lvmZmZmZmwZwmxZxmyZymzZzm{Z{m|Z|Wn4e#k
�r^epeqZwZxereseteuf\ZyZzZ{Z|YnXd�d��Z}e~d�k�rddlZej�d�d��Z�e�j�d�e��d��d�d�d��e�j�d�d�d�d�d��e�j�d�d�d�d��e����Z�e�j��r�e}�n>e�j��s�e����n,ddl�Z�x"e�j�D]Z�e{e��Z�e���e���q�WdS)��)�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@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�+/opt/alt/python37/lib64/python3.7/pickle.pyr@sc@seZdZdS)r
N)rrrrrrrr
Dsc@seZdZdS)rN)rrrrrrrrKs	c@seZdZdd�ZdS)�_StopcCs
||_dS)N)�value)�selfrrrr�__init__Ysz_Stop.__init__N)rrrrrrrrrXsr)�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|]}t�d|�r|�qS)z[A-Z][A-Z0-9_]+$)�re�match)�.0�xrrr�
<listcomp>�srfc@sFeZdZdZdZdd�Zdd�Zdd�Zdd
d�Zdd
�Z	dd�Z
dS)�_FramerricCs||_d|_dS)N)�
file_write�
current_frame)rrhrrrr�sz_Framer.__init__cCst��|_dS)N)�io�BytesIOri)rrrr�
start_framing�sz_Framer.start_framingcCs*|jr&|j��dkr&|jdd�d|_dS)NrT)�force)ri�tell�commit_frame)rrrr�end_framing�sz_Framer.end_framingFcCsf|jrb|j}|��|jks|rb|��}|j}t|�|jkrP|ttdt|���||�t	�
�|_dS)Nz<Q)rirn�_FRAME_SIZE_TARGET�	getbufferrh�len�_FRAME_SIZE_MIN�FRAMEr
rjrk)rrm�f�data�writerrrro�sz_Framer.commit_framecCs |jr|j�|�S|�|�SdS)N)rirxrh)rrwrrrrx�sz
_Framer.writecCs,|j}|jr|jdd�||�||�dS)NT)rm)rhriro)r�headerZpayloadrxrrr�write_large_bytes�s
z_Framer.write_large_bytesN)F)rrrrtrqrrlrprorxrzrrrrrg�s
rgc@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)�	_UnframerNcCs||_||_d|_dS)N)�	file_read�
file_readlineri)rr|r}Z	file_tellrrrr�sz_Unframer.__init__cCsT|jrF|j�|�}|s.|dkr.d|_|�|�St|�|krBtd��|S|�|�SdS)Nrz$pickle exhausted before end of frame)ri�readr|rsr)r�nrwrrrr~�s
z_Unframer.readcCsF|jr:|j��}|s"d|_|��S|ddkr6td��|S|��SdS)N����
z$pickle exhausted before end of frame)ri�readliner}r)rrwrrrr�s
z_Unframer.readlinecCs2|jr|j��dkrtd��t�|�|��|_dS)N�z4beginning of a new frame before end of current frame)rir~rrjrkr|)r�
frame_sizerrr�
load_framesz_Unframer.load_frame)N)rrrrr~r�r�rrrrr{�s


r{c	Csnxd|�d�D]V}|dkr(td�||���y|}t||�}Wqtk
r`td�||��d�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�
_getattribute!s
r�c	Cszt|dd�}|dk	r|Sx\ttj���D]J\}}|dks(|dkrBq(yt||�d|krZ|SWq(tk
rpYq(Xq(WdS)Nr�__main__r)r��list�sys�modules�itemsr�r�)r�r��module_name�modulerrr�whichmodule.s
r�cCsh|dkrdS|��d?d}|j|ddd�}|dkrd|dkrd|dd	krd|d
d@dkrd|dd�}|S)Nrr�r��littleT)�	byteorder�signedr������)�
bit_length�to_bytes)re�nbytes�resultrrr�encode_long?sr�cCstj|ddd�S)Nr�T)r�r�)�int�
from_bytes)rwrrr�decode_long]sr�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|kr.tks<ntdt��y|j|_Wntk
rdtd��YnXt|j�|_|jj|_|jj	|_
i|_t|�|_
|dk|_d|_|o�|dk|_dS)Nrzpickle protocol must be <= %dz"file must have a 'write' attributer�r)�DEFAULT_PROTOCOL�HIGHEST_PROTOCOL�
ValueErrorrx�_file_writer��	TypeErrorrg�framerrz�_write_large_bytes�memor��proto�bin�fastr�)r�file�protocolr�rrrrvs$



z_Pickler.__init__cCs|j��dS)N)r��clear)rrrr�
clear_memo�sz_Pickler.clear_memocCsrt|d�std|jjf��|jdkr<|�ttd|j��|jdkrP|j�	�|�
|�|�t�|j��dS)Nr�z2Pickler.__init__() was not called by %s.__init__()�z<Br)
�hasattrr
�	__class__rr�rx�PROTOr
r�rl�save�STOPrp)rr�rrrr�s





z
_Pickler.dumpcCs:|jr
dSt|j�}|�|�|��||f|jt|�<dS)N)r�rsr�rx�put�id)rr��idxrrr�memoize�s

z_Pickler.memoizecCsT|jdkrtS|jr:|dkr*ttd|�Sttd|�Sntt|��d�dSdS)Nr�z<Bz<I�ascii�
)	r��MEMOIZEr��BINPUTr
�LONG_BINPUT�PUT�repr�encode)rr�rrrr��s
z_Pickler.putcCs@|jr*|dkrttd|�Sttd|�Stt|��d�dS)Nr�z<Bz<Ir�r�)r��BINGETr
�LONG_BINGET�GETr�r�)r�irrr�get�s
z_Pickler.getcCs�|j��|�|�}|dk	r.|r.|�|�dS|j�t|��}|dk	r^|�|�|d��dSt|�}|j	�|�}|dk	r�|||�dSt
|dt��|�}|dk	r�||�}n�yt|t�}	Wnt
k
r�d}	YnX|	r�|�|�dSt
|dd�}|dk	�r||j�}n0t
|dd�}|dk	�r&|�}ntd|j|f��t|t��rT|�||�dSt|t��sltd|��t|�}
d|
k�r�d	k�s�ntd
|��|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�ro�
persistent_id�	save_persr�r�r�rx�type�dispatchr�r�
issubclassr��save_globalr�r
r�
isinstance�str�tuplers�save_reduce)rr��save_persistent_id�pidre�trv�reduce�rvZissc�lrrrr��sT








z
_Pickler.savecCsdS)Nr)rr�rrrr�'sz_Pickler.persistent_idcCsb|jr |j|dd�|�t�n>y |�tt|��d�d�Wntk
r\td��YnXdS)NF)r�r�r�z2persistent IDs in protocol 0 must be ASCII strings)	r�r�rx�	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�sntd�	|	���|dk	r�|
|j
k	r�td	�	|	���|jd
kr�||
�||�||�|t�n,t|
j
|
f|�|�}||�|d�|t�n�|jdk�r^|	dk�r^|d
}
t|
d��std��|dk	�r8|
|j
k	�r8td��|dd�}||
�||�|t�n||�||�|t�|dk	�r�t|�|jk�r�|t|�|jt|�d
��n
|�|�|dk	�r�|�|�|dk	�r�|�|�|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 classrr�
__newobj__rz+args[0] from __newobj__ args has no __new__z0args[0] from __newobj__ args has the wrong classr�)r�r�r
�callabler�rxr�r�r�r�r��	NEWOBJ_EXrr��REDUCE�NEWOBJr�r��POPr�r��_batch_appends�_batch_setitems�BUILD)r�func�args�stateZ	listitemsZ	dictitemsr�r�rxZ	func_name�cls�kwargsrrrr�7sd







"





z_Pickler.save_reducecCs|�t�dS)N)rx�NONE)rr�rrr�	save_none�sz_Pickler.save_nonecCs4|jdkr|�|rtnt�n|�|r*tnt�dS)Nr�)r�rx�NEWTRUE�NEWFALSE�TRUE�FALSE)rr�rrr�	save_bool�s
z_Pickler.save_boolcCs.|jr~|dkrN|dkr.|�ttd|��dS|dkrN|�ttd|��dSd|krbdkr~nn|�ttd|��dS|jd	kr�t|�}t|�}|d
kr�|�t	td|�|�n|�t
td|�|�dSd|kr�dk�rnn|�tt|��
d�d�n|�tt|��
d�d
�dS)Nrr�z<Bi��z<Hi�i���z<ir�r�r�r�sL
)r�rx�BININT1r
�BININT2�BININTr�r�rs�LONG1�LONG4�INTr�r��LONG)rr��encodedrrrr�	save_long�s*
z_Pickler.save_longcCs<|jr|�ttd|��n|�tt|��d�d�dS)Nz>dr�r�)r�rx�BINFLOATr
�FLOATr�r�)rr�rrr�
save_float�sz_Pickler.save_floatcCs�|jdkr@|s |jtd|d�n|jtjt|d�df|d�dSt|�}|dkrj|�tt	d|�|�nf|dkr�|jdkr�|�
tt	d	|�|�n<||jj
kr�|�
tt	d
|�|�n|�tt	d
|�|�|�|�dS)Nrr)r��latin1r�z<Bl��rz<Qz<I)r�r��bytes�codecsr�r�rsrx�SHORT_BINBYTESr
r��	BINBYTES8r�rq�BINBYTESr�)rr�rrrr�
save_bytes�s
z_Pickler.save_bytescCs|jr�|�dd�}t|�}|dkrF|jdkrF|�ttd|�|�nf|dkrp|jdkrp|�ttd|�|�n<||j	j
kr�|�ttd|�|�n|�ttd|�|�nT|�d	d
�}|�dd�}|�d
d�}|�dd�}|�dd�}|�t
|�d�d�|�|�dS)Nzutf-8�
surrogatepassr�rz<Bl��z<Qz<I�\z\u005c�z\u0000�
z\u000a�
z\u000d�z\u001azraw-unicode-escaper�)r�r�rsr�rx�SHORT_BINUNICODEr
r��BINUNICODE8r�rq�
BINUNICODE�replace�UNICODEr�)rr�rrrrr�save_str�s$z_Pickler.save_strcCsB|s(|jr|�t�n|�tt�dSt|�}|j}|j}|dkr�|jdkr�x|D]}||�qTWt	|�|kr�|�
|t	|�d�}|�t||�n|�t|�|�
|�dS|j}|t�x|D]}||�q�Wt	|�|k�r,|�
|t	|�d�}|j�r|t|�n|t|d|�dS|t�|�
|�dS)Nrr�rr�)r�rx�EMPTY_TUPLE�MARK�TUPLErsr�r�r�r�r�r��_tuplesize2coder��POP_MARK)rr�rr�r�Zelementr�rxrrr�
save_tuple�s:


z_Pickler.save_tuplecCs8|jr|�t�n|�tt�|�|�|�|�dS)N)r�rx�
EMPTY_LISTr�LISTr�r�)rr�rrr�	save_list,s

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�rxr��APPEND�iterr�r�
_BATCHSIZErsr�APPENDS)rr�r�rxre�it�tmprrrrr�9s*



z_Pickler._batch_appendscCs<|jr|�t�n|�tt�|�|�|�|���dS)N)r�rx�
EMPTY_DICTr�DICTr�r�r�)rr�rrr�	save_dictTs

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�rxr��SETITEMr&r�rr'rsr�SETITEMS)	rr�r�rx�k�vr)r*rrrrr�as2

z_Pickler._batch_setitemscCs�|j}|j}|jdkr0|jtt|�f|d�dS|t�|�|�t|�}xXtt	||j
��}t|�}|dkr�|t�x|D]}||�qzW|t
�||j
krLdSqLWdS)Nr)r�r)r�rxr�r��setr��	EMPTY_SETr�r&rr'rsr�ADDITEMS)rr�r�rxr)Zbatchr�itemrrr�save_set�s$


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

 z_Pickler.save_frozensetc

CsX|j}|j}|dkr t|dd�}|dkr.|j}t||�}y(t|dd�tj|}t||�\}}Wn.t	t
tfk
r�td|||f�d�YnX||k	r�td|||f��|j
dk�rt�||f�}	|	�r|	dkr�|ttd|	��n0|	d	k�r|ttd
|	��n|ttd|	��dS|�d�d}
||k�r6|
}|j
d
k�r`|�|�|�|�|t�n�||k	�r||�t||
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
�rHtd|||j
f�d�YnX|�|�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) rxr�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�rxr�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|�|�S)N)N)r�.).)r�r��NotImplementedr�)rr�rrr�	save_type�sz_Pickler.save_type)N)T)NNNN)N)+rrrrr�rr�r�r�r�r�r�r�r�r�r�r��boolrr�r�floatrr
rr�r!r�r$r�r'r�r-�dictr r�r6r2r9r7r�rGrrrrrr�tsV*
	
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)Nr)	r��_file_readliner~�
_file_readr�rNrOr�r�)rr�r�rNrOrrrrsz_Unpickler.__init__c
Cs�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}~XYnXdS)NrQz4Unpickler.__init__() was not called by %s.__init__()rr�)r�rr�rr{rQrP�	_unframerr~r��	metastack�stack�appendr�r��EOFErrorrr)rr~r��keyZstopinstrrrr's(



z_Unpickler.loadcCs |j}|j��|_|jj|_|S)N)rTrS�poprU)rr�rrr�pop_markEs
z_Unpickler.pop_markcCstd��dS)Nz%unsupported persistent id encountered)r)rr�rrr�persistent_loadKsz_Unpickler.persistent_loadcCs:|�d�d}d|kr"tks0ntd|��||_dS)Nr�rzunsupported pickle protocol: %d)r~r�r�r�)rr�rrr�
load_protoPsz_Unpickler.load_protorcCs8td|�d��\}|tjkr(td|��|j�|�dS)Nz<Q�zframe size > sys.maxsize: %d)rr~r�r	r�rRr�)rr�rrrr�Ws
z_Unpickler.load_framecCsLy|��dd��d�}Wntk
r6td��YnX|�|�|��dS)Nr�r�z2persistent IDs in protocol 0 must be ASCII strings)r��decode�UnicodeDecodeErrorrrUrZ)rr�rrr�load_persid^sz_Unpickler.load_persidcCs|j��}|�|�|��dS)N)rTrXrUrZ)rr�rrr�load_binpersidgs
z_Unpickler.load_binpersidcCs|�d�dS)N)rU)rrrr�	load_nonelsz_Unpickler.load_nonecCs|�d�dS)NF)rU)rrrr�
load_falsepsz_Unpickler.load_falsecCs|�d�dS)NT)rU)rrrr�	load_truetsz_Unpickler.load_truecCsL|��}|tdd�krd}n |tdd�kr4d}n
t|d�}|�|�dS)Nr�FTr)r�r�r�r�rU)rrw�valrrr�load_intxs
z_Unpickler.load_intcCs|�td|�d��d�dS)Nz<irr)rUrr~)rrrr�load_binint�sz_Unpickler.load_binintcCs|�|�d�d�dS)Nr�r)rUr~)rrrr�load_binint1�sz_Unpickler.load_binint1cCs|�td|�d��d�dS)Nz<Hr�r)rUrr~)rrrr�load_binint2�sz_Unpickler.load_binint2cCs@|��dd�}|r,|ddkr,|dd�}|�t|d��dS)Nr��Lr)r�rUr�)rrdrrr�	load_long�sz_Unpickler.load_longcCs*|�d�d}|�|�}|�t|��dS)Nr�r)r~rUr�)rrrwrrr�
load_long1�s
z_Unpickler.load_long1cCs>td|�d��\}|dkr"td��|�|�}|�t|��dS)Nz<irrz#LONG pickle has negative byte count)rr~rrUr�)rrrwrrr�
load_long4�s

z_Unpickler.load_long4cCs|�t|��dd���dS)Nr�)rUrIr�)rrrr�
load_float�sz_Unpickler.load_floatcCs|�td|�d��d�dS)Nz>dr\r)rUrr~)rrrr�
load_binfloat�sz_Unpickler.load_binfloatcCs"|jdkr|S|�|j|j�SdS)Nr
)rNr]rO)rrrrr�_decode_string�s
z_Unpickler._decode_stringcCsl|��dd�}t|�dkrF|d|dkrF|ddkrF|dd�}ntd��|�|�t�|�d��dS)Nr�r�rs"'r�z)the STRING opcode argument must be quoted)r�rsrrUror�
escape_decode)rrwrrr�load_string�s
(z_Unpickler.load_stringcCs@td|�d��\}|dkr"td��|�|�}|�|�|��dS)Nz<irrz(BINSTRING pickle has negative byte count)rr~rrUro)rrsrwrrr�load_binstring�s

z_Unpickler.load_binstringcCs:td|�d��\}|tkr&tdt��|�|�|��dS)Nz<Irz2BINBYTES exceeds system's maximum size of %d bytes)rr~r	rrU)rrsrrr�
load_binbytes�s
z_Unpickler.load_binbytescCs |�t|��dd�d��dS)Nr�zraw-unicode-escape)rUr�r�)rrrr�load_unicode�sz_Unpickler.load_unicodecCsBtd|�d��\}|tkr&tdt��|�t|�|�dd��dS)Nz<Irz4BINUNICODE exceeds system's maximum size of %d byteszutf-8r)rr~r	rrUr�)rrsrrr�load_binunicode�s
z_Unpickler.load_binunicodecCsBtd|�d��\}|tkr&tdt��|�t|�|�dd��dS)Nz<Qr\z5BINUNICODE8 exceeds system's maximum size of %d byteszutf-8r)rr~r	rrUr�)rrsrrr�load_binunicode8�s
z_Unpickler.load_binunicode8cCs:td|�d��\}|tkr&tdt��|�|�|��dS)Nz<Qr\z3BINBYTES8 exceeds system's maximum size of %d bytes)rr~r	rrU)rrsrrr�load_binbytes8�s
z_Unpickler.load_binbytes8cCs,|�d�d}|�|�}|�|�|��dS)Nr�r)r~rUro)rrsrwrrr�load_short_binstring�s
z_Unpickler.load_short_binstringcCs"|�d�d}|�|�|��dS)Nr�r)r~rU)rrsrrr�load_short_binbytes�sz_Unpickler.load_short_binbytescCs*|�d�d}|�t|�|�dd��dS)Nr�rzutf-8r)r~rUr�)rrsrrr�load_short_binunicode�sz _Unpickler.load_short_binunicodecCs|��}|�t|��dS)N)rYrUr�)rr�rrr�
load_tuple�sz_Unpickler.load_tuplecCs|�d�dS)Nr)rU)rrrr�load_empty_tuplesz_Unpickler.load_empty_tuplecCs|jdf|jd<dS)Nr�)rT)rrrr�load_tuple1sz_Unpickler.load_tuple1cCs$|jd|jdfg|jdd�<dS)Nr�r�)rT)rrrr�load_tuple2
sz_Unpickler.load_tuple2cCs,|jd|jd|jdfg|jdd�<dS)N���r�r�)rT)rrrr�load_tuple3sz_Unpickler.load_tuple3cCs|�g�dS)N)rU)rrrr�load_empty_listsz_Unpickler.load_empty_listcCs|�i�dS)N)rU)rrrr�load_empty_dictionarysz _Unpickler.load_empty_dictionarycCs|�t��dS)N)rUr2)rrrr�load_empty_setsz_Unpickler.load_empty_setcCs|��}|�t|��dS)N)rYrUr7)rr�rrr�load_frozensetsz_Unpickler.load_frozensetcCs|��}|�|�dS)N)rYrU)rr�rrr�	load_list#sz_Unpickler.load_listcs4|����fdd�tdt��d�D�}|�|�dS)Ncsi|]}�|d�|�qS)r�r)rdr�)r�rr�
<dictcomp>*sz(_Unpickler.load_dict.<locals>.<dictcomp>rr�)rY�rangersrU)r�dr)r�r�	load_dict(s
z_Unpickler.load_dictc
Cs�|st|t�rt|d�rjy||�}Wqttk
rf}z$td|jt|�ft��d��Wdd}~XYqtXn
|�|�}|�	|�dS)NZ__getinitargs__zin constructor for %s: %sr�)
r�r�r�r�rr�r��exc_infor�rU)r�klassr�r�errrrr�_instantiate4s
0
z_Unpickler._instantiatecCsL|��dd��d�}|��dd��d�}|�||�}|�||���dS)Nr�r�)r�r]�
find_classr�rY)rr�r�r�rrr�	load_inst@sz_Unpickler.load_instcCs"|��}|�d�}|�||�dS)Nr)rYrXr�)rr�r�rrr�load_objGs
z_Unpickler.load_objcCs2|j��}|j��}|j|f|��}|�|�dS)N)rTrXr�rU)rr�r�r�rrr�load_newobjNs

z_Unpickler.load_newobjcCs>|j��}|j��}|j��}|j|f|�|�}|�|�dS)N)rTrXr�rU)rr�r�r�r�rrr�load_newobj_exUs



z_Unpickler.load_newobj_excCsF|��dd��d�}|��dd��d�}|�||�}|�|�dS)Nr�zutf-8)r�r]r�rU)rr�r�r�rrr�load_global]sz_Unpickler.load_globalcCsJ|j��}|j��}t|�tk	s,t|�tk	r4td��|�|�||��dS)NzSTACK_GLOBAL requires str)rTrXr�r�rrUr�)rr�r�rrr�load_stack_globalds


z_Unpickler.load_stack_globalcCs|�d�d}|�|�dS)Nr�r)r~�
get_extension)rrErrr�	load_ext1lsz_Unpickler.load_ext1cCs td|�d��\}|�|�dS)Nz<Hr�)rr~r�)rrErrr�	load_ext2qsz_Unpickler.load_ext2cCs td|�d��\}|�|�dS)Nz<ir)rr~r�)rrErrr�	load_ext4vsz_Unpickler.load_ext4cCspg}t�||�}||k	r&|�|�dSt�|�}|sP|dkrDtd��td|��|j|�}|t|<|�|�dS)NrzEXT specifies code <= 0zunregistered extension code %d)rr�rUrrr�r�)rrEZnilr�rWrrrr�{s


z_Unpickler.get_extensioncCs�|jdkrF|jrF||ftjkr2tj||f\}}n|tjkrFtj|}t|dd�|jdkrpttj||�dSt	tj||�SdS)Nrr)r:r)
r�r�rDZNAME_MAPPINGZIMPORT_MAPPINGr;r�r�r�r�)rr�r�rrrr��s


z_Unpickler.find_classcCs&|j}|��}|d}||�|d<dS)Nr�)rTrX)rrTr�r�rrr�load_reduce�sz_Unpickler.load_reducecCs|jr|jd=n|��dS)Nr�)rTrY)rrrr�load_pop�s
z_Unpickler.load_popcCs|��dS)N)rY)rrrr�
load_pop_mark�sz_Unpickler.load_pop_markcCs|�|jd�dS)Nr�)rUrT)rrrr�load_dup�sz_Unpickler.load_dupcCs(t|��dd��}|�|j|�dS)Nr�)r�r�rUr�)rr�rrr�load_get�sz_Unpickler.load_getcCs"|�d�d}|�|j|�dS)Nr�r)r~rUr�)rr�rrr�load_binget�sz_Unpickler.load_bingetcCs&td|�d��\}|�|j|�dS)Nz<Ir)rr~rUr�)rr�rrr�load_long_binget�sz_Unpickler.load_long_bingetcCs8t|��dd��}|dkr$td��|jd|j|<dS)Nr�rznegative PUT argument)r�r�r�rTr�)rr�rrr�load_put�sz_Unpickler.load_putcCs2|�d�d}|dkrtd��|jd|j|<dS)Nr�rznegative BINPUT argumentr�)r~r�rTr�)rr�rrr�load_binput�sz_Unpickler.load_binputcCs6td|�d��\}|tkr"td��|jd|j|<dS)Nz<Irznegative LONG_BINPUT argumentr�)rr~r	r�rTr�)rr�rrr�load_long_binput�sz_Unpickler.load_long_binputcCs|j}|jd|t|�<dS)Nr�)r�rTrs)rr�rrr�load_memoize�sz_Unpickler.load_memoizecCs$|j}|��}|d}|�|�dS)Nr�)rTrXrU)rrTrr�rrr�load_append�sz_Unpickler.load_appendcCs^|��}|jd}y
|j}Wntk
r0YnX||�dS|j}x|D]}||�qJWdS)Nr�)rYrT�extendr�rU)rr�Zlist_objr�rUr5rrr�load_appends�s


z_Unpickler.load_appendscCs*|j}|��}|��}|d}|||<dS)Nr�)rTrX)rrTrrWrJrrr�load_setitem�s
z_Unpickler.load_setitemcCsD|��}|jd}x,tdt|�d�D]}||d|||<q$WdS)Nr�rr�r�)rYrTr�rs)rr�rJr�rrr�
load_setitems�s
z_Unpickler.load_setitemscCsH|��}|jd}t|t�r(|�|�n|j}x|D]}||�q4WdS)Nr�)rYrTr�r2�update�add)rr�Zset_objr�r5rrr�
load_additems�s


z_Unpickler.load_additemsc
Cs�|j}|��}|d}t|dd�}|dk	r6||�dSd}t|t�rXt|�dkrX|\}}|r�|j}tj}x6|�	�D]*\}}	t
|�tkr�|	|||�<qr|	||<qrW|r�x |�	�D]\}}	t|||	�q�WdS)Nr��__setstate__r�)
rTrXr�r�r�rs�__dict__r��internr�r�r��setattr)
rrTr��inst�setstateZ	slotstateZ	inst_dictr�r0r1rrr�
load_build
s(z_Unpickler.load_buildcCs"|j�|j�g|_|jj|_dS)N)rSrUrT)rrrr�	load_mark"sz_Unpickler.load_markcCs|j��}t|��dS)N)rTrXr)rrrrr�	load_stop(s
z_Unpickler.load_stopN)�rrrrrrYrZr�r[r�r�rur_r�r`r�rar�rbr�rcr�rerrfr�rgr�rhr�rjrrkrrlrrmrrnrrorq�STRINGrr�	BINSTRINGrsrrtrrurrvrrwr
rx�SHORT_BINSTRINGryrrzrr{rr|rr}�TUPLE1r~�TUPLE2r��TUPLE3r�r"r�r+r�r3r�r8r�r#r�r,r�r��INSTr��OBJr�r�r�r�r�rCr�rBr�r>r�r?r�r@r�r�r�r�r�r�r�r r��DUPr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r%r�r(r�r.r�r/r�r4r�r�r�rr�r�rrrrrKs$		
	rKT)r�cCst|||d��|�dS)N)r�)r�r)r�r�r�r�rrr�_dump0sr�cCs(t��}t|||d��|�|��}|S)N)r�)rjrkr�r�getvalue)r�r�r�rvZresrrr�_dumps3sr�rLrM)r�rNrOcCst||||d���S)N)r�rNrO)rKr)r�r�rNrOrrr�_load:sr�cCs0t|t�rtd��t�|�}t||||d���S)Nz%Can't load pickle from unicode string)r�rNrO)r�r�r�rjrkrKr)�sr�rNrOr�rrr�_loads>s


r�)	rr
rrrrrrrcCsddl}|��S)Nr)�doctestZtestmod)r�rrr�_testWsr�r�z$display contents of the pickle files)�description�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)��typesr�copyregrrrr�	itertoolsr�	functoolsrr�r	�structr
rrbrjrrD�__all__r
�	bytearrayZbytes_typesZformat_versionZcompatible_formatsr�r��	Exceptionrr
rrZorg.python.corer r<rr�r�r r�rrr�r�rr�r�r�r�r�r�r�r�rrr%r�rCr,r+r(r�r�r�r�r#r"r�r�r�r�r.rrr/rr�r�r�r�r>r?r@r�r�r�r�r�rrrrrrrr
r3r4r8r�rBr�rur��dirrgr{r�r�r�r�r�rKr�r�r�r��_picklerrrrrrr�r�argparse�ArgumentParser�parser�add_argument�FileType�
parse_argsr�Ztestr��
print_helpZpprintrvr�rrrr�<module>s,

?*
40