AlkantarClanX12

Your IP : 18.119.107.159


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/pickle.cpython-310.opt-2.pyc

o

6��f���@sL	ddlmZddlmZddlmZmZmZddlmZddl	m
Z
ddlZddlmZddl
mZmZddlZddlZddlZddlZgd	�Zzdd
lmZe�d�dZWneycd
ZYnweefZdZgd�ZdZdZ Gdd�de!�Z"Gdd�de"�Z#Gdd�de"�Z$Gdd�de!�Z%zddl&m'Z'Wney�dZ'YnwdZ(dZ)dZ*dZ+dZ,d Z-d!Z.d"Z/d#Z0d$Z1d%Z2d&Z3d'Z4d(Z5d)Z6d*Z7d+Z8d,Z9d-Z:d.Z;d/Z<d0Z=d1Z>d2Z?d3Z@d4ZAd5ZBd6ZCd7ZDd8ZEd9ZFd:ZGd;ZHd<ZId=ZJd>ZKd?ZLd@ZMdAZNdBZOdCZPdDZQdEZRdFZSdGZTdHZUdIZVdJZWdKZXdLZYdMZZdNZ[dOZ\dPZ]dQZ^eNeXeYeZgZ_dRZ`dSZadTZbdUZcdVZddWZedXZfdYZgdZZhd[Zid\Zjd]Zkd^Zld_Zmd`Zne�odadb�ep�D��Gdcdd�dd�ZqGdedf�df�Zrdgdh�Zsdidj�Ztdkdl�Zudmdn�ZvGdodp�dp�ZwGdqdr�dr�Zxd�ddds�dtdu�Zyd�ddds�dvdw�Zzddxdyddz�d{d|�Z{ddxdyddz�d}d~�Z|zdd	lm"Z"m#Z#m$Z$m}Z}m~Z~mZm�Z�m�Z�m�Z�Wne�y�ewexZ}Z~eyeze{e|f\ZZ�Z�Z�Ynwdd��Z�e�d�k�r"ddl�Z�e�j�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��re��dSe�j��se����dSddl�Z�e�j�D]Z�e�e��Z�e���e���qdSdS)��)�FunctionType)�dispatch_table)�_extension_registry�_inverted_registry�_extension_cache)�islice)�partialN)�maxsize)�pack�unpack)	�PickleError�
PicklingError�UnpicklingError�Pickler�	Unpickler�dump�dumps�load�loads)�PickleBufferrTF�4.0)z1.0z1.1z1.2z1.3z2.0z3.0rz5.0��c@�eZdZ	dS)rN��__name__�
__module__�__qualname__�rr�-/opt/alt/python310/lib64/python3.10/pickle.pyrIsrc@r)r
Nrrrrrr
Msr
c@r)rNrrrrrrTsrc@seZdZdd�ZdS)�_StopcCs
||_dS�N)�value��selfr"rrr�__init__bs
z_Stop.__init__N)rrrr%rrrrr as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
�������������������������B�C��������������������������cCsg|]
}t�d|�r|�qS)z[A-Z][A-Z0-9_]+$)�re�match)�.0�xrrr�
<listcomp>�sroc@sFeZdZdZdZdd�Zdd�Zdd�Zdd
d�Zdd
�Z	dd�Z
dS)�_FramerricCs||_d|_dSr!)�
file_write�
current_frame)r$rqrrrr%�s
z_Framer.__init__cCst��|_dSr!)�io�BytesIOrr�r$rrr�
start_framing��z_Framer.start_framingcCs2|jr|j��dkr|jdd�d|_dSdSdS)NrT��force)rr�tell�commit_framerurrr�end_framing�s
�z_Framer.end_framingFcCsn|jr3|j}|��|jks|r5|��}|j}t|�|jkr(|ttdt|���||�t	�
�|_dSdSdS)N�<Q)rrrz�_FRAME_SIZE_TARGET�	getbufferrq�len�_FRAME_SIZE_MIN�FRAMEr
rsrt)r$ry�f�data�writerrrr{�s�z_Framer.commit_framecCs|jr	|j�|�S|�|�Sr!)rrr�rq�r$r�rrrr��s
z
_Framer.writecCs,|j}|jr|jdd�||�||�dS)NTrx)rqrrr{)r$�headerZpayloadr�rrr�write_large_bytes�s
z_Framer.write_large_bytesN)F)rrrr�r~r%rvr|r{r�r�rrrrrp�s
rpc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�	_UnframerNcCs||_||_d|_dSr!)�	file_read�
file_readlinerr)r$r�r�Z	file_tellrrrr%	s
z_Unframer.__init__cCs�|jr1|j�|�}|dkr%t|�dkr%d|_t|�}|�|�|dd�<|S|t|�kr/td��|St|�}|�|�|dd�<|S�Nr�$pickle exhausted before end of frame)rr�readintor�r�r)r$�buf�nrrrr�s�z_Unframer.readintocCsP|jr#|j�|�}|s|dkrd|_|�|�St|�|kr!td��|S|�|�Sr�)rr�readr�r�r�r$r�r�rrrr�s
�
z_Unframer.readcCsB|jr|j��}|sd|_|��S|ddkrtd��|S|��S)N����
r�)rr�readliner�rr�rrrr�,s
�z_Unframer.readlinecCs2|jr|j��dkrtd��t�|�|��|_dS)N�z4beginning of a new frame before end of current frame)rrr�rrsrtr��r$Z
frame_sizerrr�
load_frame9s
�z_Unframer.load_framer!)rrrr%r�r�r�r�rrrrr�s


r�c	Csb|�d�D]'}|dkrtd�||���z	|}t||�}Wqty,td�||��d�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�
_getattributeBs ����r�c	Cs�	t|dd�}|dur
|Stj����D]*\}}|dks$|dks$|dur%qzt||�d|ur4|WSWqty>YqwdS)Nr�__main__Z__mp_main__r)r��sys�modules�copy�itemsr�r�)r�r��module_name�modulerrr�whichmoduleOs"
��r�cCsj	|dkrdS|��d?d}|j|ddd�}|dkr3|dkr3|dd	kr3|d
d@dkr3|dd�}|S)Nrr����littleT��	byteorderZsignedr������)�
bit_length�to_bytes)rn�nbytes�resultrrr�encode_longbsr�cCs	tj|ddd�S)Nr�Tr�)�int�
from_bytes)r�rrr�decode_long�sr�c@s�eZdZd<ddd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zd=dd�Z	dd�Z
dd�Z		d>dd�dd�ZiZ
dd�Zee
ed�<dd�Zee
e<dd�Zee
e<dd �Zee
e<d!d"�Zee
e<d#d$�Zee
e<ervd%d&�Zee
e<d'd(�Zee
e<d)d*�Zee
e <d+d,�Z!e!e
e"<d-Z#d.d/�Z$d0d1�Z%e%e
e&<e'dur�e%e
e'<d2d3�Z(d4d5�Z)e)e
e*<d6d7�Z+e+e
e,<d<d8d9�Z-d:d;�Z.e-e
e/<e.e
e<dS)?�_PicklerNT��fix_imports�buffer_callbackcCs�	|durt}|dkrt}nd|krtksntdt��|dur+|dkr+td��||_z|j|_Wnty?td��wt|j�|_	|j	j|_|j	j
|_i|_t
|�|_|dk|_d|_|oe|dk|_dS)Nrzpickle protocol must be <= %drz#buffer_callback needs protocol >= 5z"file must have a 'write' attributer�r�)�DEFAULT_PROTOCOL�HIGHEST_PROTOCOL�
ValueError�_buffer_callbackr��_file_writer��	TypeErrorrp�framerr��_write_large_bytes�memor��proto�bin�fastr�)r$�file�protocolr�r�rrrr%�s.!�



z_Pickler.__init__cCs	|j��dSr!)r��clearrurrr�
clear_memo�sz_Pickler.clear_memocCst	t|d�std|jjf��|jdkr|�ttd|j��|jdkr)|j�	�|�
|�|�t�|j��dS)Nr�z2Pickler.__init__() was not called by %s.__init__()��<Br)
�hasattrr
�	__class__rr�r��PROTOr
r�rv�save�STOPr|�r$r�rrrr�s
�




z
_Pickler.dumpcCs<	|jrdSt|j�}|�|�|��||f|jt|�<dSr!)r�r�r�r��put�id)r$r��idxrrr�memoize�s
z_Pickler.memoizecCsN|jdkrtS|jr|dkrttd|�Sttd|�Stt|��d�dS)Nr�r��<I�ascii�
)	r��MEMOIZEr��BINPUTr
�LONG_BINPUT�PUT�repr�encode)r$r�rrrr�s
z_Pickler.putcCs@|jr|dkrttd|�Sttd|�Stt|��d�dS)Nr�r�r�r�r�)r��BINGETr
�LONG_BINGET�GETr�r��r$�irrr�gets
z_Pickler.getc
Cs�|j��|�|�}|dur|r|�|�dS|j�t|��}|dur/|�|�|d��dSt}t	|dd�}|dur?||�}|tur�t
|�}|j�|�}|durX|||�dSt	|dt��|�}|durj||�}n3t
|t
�rv|�|�dSt	|dd�}|dur�||j�}nt	|dd�}|dur�|�}n	td|j|f��t|t�r�|�||�dSt|t�s�td|��t|�}	d|	kr�d	ks�ntd
|��|j|d|i�dS)NrZreducer_overrider�
__reduce_ex__�
__reduce__zCan't pickle %r object: %rz%s must return string or tupler��z2Tuple returned by %s must have two to six elementsr�)r�r{�
persistent_id�	save_persr�r�r�r��NotImplementedr��type�dispatchr�
issubclass�save_globalr�r
r�
isinstance�str�tupler��save_reduce)
r$r��save_persistent_id�pidrnZrv�reduce�tr��lrrrr�sZ






�

�z
_Pickler.savecCsdSr!rr�rrrr�]sz_Pickler.persistent_idcCs\|jr|j|dd�|�t�dSz|�tt|��d�d�WdSty-td��w)NF)r�r�r��2persistent IDs in protocol 0 must be ASCII strings)	r�r�r��	BINPERSID�PERSIDr�r��UnicodeEncodeErrorr
�r$r�rrrr�as"��z_Pickler.save_pers�r�c
Cs6t|t�s	td��t|�std��|j}|j}	t|dd�}
|jdkrw|
dkrw|\}}}t|d�s7td�	|
���|durG||j
urGtd	�	|
���|jd
kr]||�||�||�|	t�n\t|j
|g|�Ri|��}||�|d�|	t�nB|jdkr�|
dkr�|d
}t|d�s�td��|dur�||j
ur�td��|dd�}||�||�|	t�n||�||�|	t�|dur�t|�|jvr�|	t|�|jt|�d
��n|�|�|dur�|�|�|dur�|�|�|du�r|dur�||�|	t�dS||�||�||�|	t�|	t�|	t�dSdS)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�r�r�r�r�r�r��	NEWOBJ_EXrr�REDUCE�NEWOBJr�r��POPr�r��_batch_appends�_batch_setitems�BUILD�TUPLE2)
r$�func�args�stateZ	listitemsZ	dictitemsZstate_setterr�r�r�Z	func_name�cls�kwargsrrrr�ms|


��



��
"



�z_Pickler.save_reducecCs|�t�dSr!)r��NONEr�rrr�	save_none�rwz_Pickler.save_nonecCs<|jdkr|�|rt�dSt�dS|�|rtnt�dS)Nr�)r�r��NEWTRUE�NEWFALSE�TRUE�FALSEr�rrr�	save_bool�s
z_Pickler.save_boolcCs0|jr?|dkr'|dkr|�ttd|��dS|dkr'|�ttd|��dSd|kr1dkr?nn|�ttd|��dS|jd	krlt|�}t|�}|d
kr^|�t	td|�|�dS|�t
td|�|�dSd|krvdkr�nn|�tt|��
d�d�dS|�tt|��
d�d
�dS)Nrr�r���<Hi�i����<ir�r�r�r�sL
)r�r��BININT1r
�BININT2�BININTr�r�r��LONG1�LONG4�INTr�r��LONG�r$r�Zencodedr�rrr�	save_long�s,
�  z_Pickler.save_longcCs>|jr|�ttd|��dS|�tt|��d�d�dS)N�>dr�r�)r�r��BINFLOATr
�FLOATr�r�r�rrr�
save_floats z_Pickler.save_floatcCs�|jdkr!|s|jtd|d�dS|jtjt|d�df|d�dSt|�}|dkr6|�tt	d|�|�n3|dkrK|jdkrK|�
tt	d	|�|�n||jj
kr]|�
tt	d
|�|�n|�tt	d
|�|�|�|�dS)Nr�rr�latin1r�r����rr}r�)r�r��bytes�codecsr�r�r�r��SHORT_BINBYTESr
r��	BINBYTES8r�r~�BINBYTESr��r$r�r�rrr�
save_bytess"
��z_Pickler.save_bytescCs�|jdkr|s|jtd|d�dS|jtt|�f|d�dSt|�}||jjkr4|�tt	d|�|�n|�
tt	d|�|�|�|�dS)Nrrrr})r�r��	bytearrayr.r�r�r~r��
BYTEARRAY8r
r�r�r3rrr�save_bytearray)s
�z_Pickler.save_bytearraycCs�|jdkr	td��|���X}|jstd��d}|jdur#t|�|��}|r8|jr0|�|���n-|�	|���n|�
t�|jrM|�
t�Wd�dSWd�dSWd�dSWd�dS1shwYdS)Nrz0PickleBuffer can only pickled with protocol >= 5zHPickleBuffer can not be pickled when pointing to a non-contiguous bufferT)
r�r
�raw�
contiguousr��bool�readonlyr4�tobytesr7r��NEXT_BUFFER�READONLY_BUFFER)r$r��mZin_bandrrr�save_picklebuffer9s,



��
�"�z_Pickler.save_picklebuffercCs|jrW|�dd�}t|�}|dkr#|jdkr#|�ttd|�|�n^|dkr8|jdkr8|�ttd|�|�nI||j	j
krJ|�ttd|�|�n7|�ttd|�|�n*|�d	d
�}|�dd�}|�d
d�}|�dd�}|�dd�}|�t
|�d�d�|�|�dS)N�utf-8�
surrogatepassr�rr�r-r}r��\z\u005c�z\u0000�
z\u000a�
z\u000d�z\u001a�raw-unicode-escaper�)r�r�r�r�r��SHORT_BINUNICODEr
r��BINUNICODE8r�r~�
BINUNICODE�replace�UNICODEr�r&rrr�save_strSs&�z_Pickler.save_strcCs<|s|jr|�t�dS|�tt�dSt|�}|j}|j}|dkr[|jdkr[|D]}||�q*t	|�|vrM|�
|t	|�d�}|�t||�dS|�t|�|�
|�dS|j}|t�|D]}||�qdt	|�|vr�|�
|t	|�d�}|jr�|t|�dS|t|d|�dS|t�|�
|�dS)Nr�r�rr�)r�r��EMPTY_TUPLE�MARK�TUPLEr�r�r�r�r�r�r�_tuplesize2coder��POP_MARK)r$r�r�r�r�Zelementr�r�rrr�
save_tuplejs@
�
�

�z_Pickler.save_tuplecCs8|jr	|�t�n|�tt�|�|�|�|�dSr!)r�r��
EMPTY_LISTrP�LISTr�rr�rrr�	save_list�s

z_Pickler.save_listi�cCs�|j}|j}|js|D]
}||�|t�qdSt|�}	tt||j��}t|�}|dkr?|t	�|D]}||�q3|t
�n|rK||d�|t�||jkrRdSq�NTr�r)r�r�r��APPEND�iter�listr�
_BATCHSIZEr�rP�APPENDS)r$r�r�r�rn�it�tmpr�rrrr�s,



�z_Pickler._batch_appendscCs<|jr	|�t�n|�tt�|�|�|�|���dSr!)r�r��
EMPTY_DICTrP�DICTr�r
r�r�rrr�	save_dict�s

z_Pickler.save_dictc	Cs�|j}|j}|js|D]\}}||�||�|t�qdSt|�}	tt||j��}t|�}|dkrK|t	�|D]\}}||�||�q9|t
�n|r_|d\}}||�||�|t�||jkrfdSq#rX)r�r�r��SETITEMrZr[rr\r�rP�SETITEMS)	r$r�r�r��k�vr^r_r�rrrr
�s4



�z_Pickler._batch_setitemscCs�|j}|j}|jdkr|jtt|�f|d�dS|t�|�|�t|�}	tt	||j
��}t|�}|dkrG|t�|D]}||�q<|t
�||j
krNdSq&)NrrTr)r�r�r�r��setr[�	EMPTY_SETr�rZrr\r�rP�ADDITEMS)r$r�r�r�r^Zbatchr��itemrrr�save_set�s&



�z_Pickler.save_setcCs�|j}|j}|jdkr|jtt|�f|d�dS|t�|D]}||�qt|�|jvr>|t	|�
|jt|�d��dS|t�|�|�dS)Nrrr)
r�r�r�r��	frozensetr[rPr�r�rSr��	FROZENSETr�)r$r�r�r�rjrrr�save_frozenset	s

 z_Pickler.save_frozensetc

Cs<|j}|j}|durt|dd�}|dur|j}t||�}zt|dd�tj|}t||�\}}Wnt	t
tfyDtd|||f�d�w||urRtd|||f��|j
dkr�t�||f�}	|	r�|	dkro|ttd|	��dS|	d	kr~|ttd
|	��dS|ttd|	��dS|�d�d}
||ur�|
}|j
d
kr�|�|�|�|�|t�nm||ur�|�t||
f�n`|j
dkr�|tt|d�dt|d�d�nH|jr�tj}tj}||f|vr�|||f\}}n||vr�||}z|tt|d�dt|d�d�Wnt�ytd|||j
f�d�w|�|�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�r�rrrr�rr�rAr�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_MAPPINGrr�)
r$r�r�r�r�r�r�Zobj2r��codeZlastnameZr_name_mappingZr_import_mappingrrrr� s�

������
��




���
�
����z_Pickler.save_globalcCs`|td�ur|jtd|d�S|tt�ur|jttf|d�S|td�ur+|jtd|d�S|�|�S)Nr!r.).)r�r�r�r�r�rrr�	save_typebs
z_Pickler.save_typer!)T)NNNN)0rrrr%r�rr�r�r�r�r�r�r�r�rr�rr:r'r�r+�floatr4r.r7r5�_HAVE_PICKLE_BUFFERr@rrNr�rTr�rWr[r\rrb�dictr&r
rkrgrnrlr�r|rrrrrr��sl�9

	F��u
1		
B	r�c@s�eZdZddddd�dd�Zdd	�Zd
d�Zdd
�ZiZdd�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/d0�Z(d1d2�Z)e)ee*d<d3d4�Z+e+ee,d<d5d6�Z-e-ee.d<d7d8�Z/e/ee0d<d9d:�Z1e1ee2d<d;d<�Z3e3ee4d<d=d>�Z5e5ee6d<d?d@�Z7e7ee8d<dAdB�Z9e9ee:d<dCdD�Z;e;ee<d<dEdF�Z=e=ee>d<dGdH�Z?e?ee@d<dIdJ�ZAeAeeBd<dKdL�ZCeCeeDd<dMdN�ZEeEeeFd<dOdP�ZGeGeeHd<dQdR�ZIeIeeJd<dSdT�ZKeKeeLd<dUdV�ZMeMeeNd<dWdX�ZOeOeePd<dYdZ�ZQeQeeRd<d[d\�ZSeSeeTd<d]d^�ZUeUeeVd<d_d`�ZWeWeeXd<dadb�ZYdcdd�ZZeZee[d<dedf�Z\e\ee]d<dgdh�Z^e^ee_d<didj�Z`e`eead<dkdl�Zbebeecd<dmdn�Zdedeeed<dodp�Zfefeegd<dqdr�Zheheeid<dsdt�Zjejeekd<dudv�Zldwdx�Zmdydz�Zneneeod<d{d|�Zpepeeqd<d}d~�Zrereesd<dd��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�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<dS)��
_UnpicklerT�ASCII�strictN�r��encoding�errors�bufferscCsJ	|dur	t|�nd|_|j|_|j|_i|_||_||_d|_	||_
dS�Nr)rZ�_buffersr��_file_readliner��
_file_readr�r�r�r�r�)r$r�r�r�r�r�rrrr%ss%
z_Unpickler.__init__c
Cs�	t|d�std|jjf��t|j|j�|_|jj|_|jj	|_	|jj
|_
g|_g|_|jj
|_
d|_|j}|j}z	|d�}|sDt�||d|�q<tya}z	|jWYd}~Sd}~ww)Nr�z4Unpickler.__init__() was not called by %s.__init__()rTr�)r�rr�rr�r�r��	_unframerr�r�r��	metastack�stack�appendr�r��EOFErrorr r")r$r�r��keyZstopinstrrrr�s4
�



���z_Unpickler.loadcCs |j}|j��|_|jj|_|Sr!)r�r��popr��r$r�rrr�pop_mark�s
z_Unpickler.pop_markcCstd��)Nz%unsupported persistent id encountered)rrrrr�persistent_load�sz_Unpickler.persistent_loadcCs:|�d�d}d|krtksntd|��||_dS)Nr�rzunsupported pickle protocol: %d)r�r�r�r�)r$r�rrr�
load_proto�s
z_Unpickler.load_protorcCs8td|�d��\}|tjkrtd|��|j�|�dS)Nr}�zframe size > sys.maxsize: %d)rr�r�r	r�r�r�r�rrrr��s
z_Unpickler.load_framecCsFz
|��dd��d�}Wntytd��w|�|�|��dS)Nr�r�r�)r��decode�UnicodeDecodeErrorrr�r�rrrr�load_persid�s��z_Unpickler.load_persidcCs|j��}|�|�|��dSr!)r�r�r�r�rrrr�load_binpersid�s
z_Unpickler.load_binpersidcCs|�d�dSr!�r�rurrr�	load_none�rwz_Unpickler.load_nonecC�|�d�dS)NFr�rurrr�
load_false�rwz_Unpickler.load_falsecCr�)NTr�rurrr�	load_true�rwz_Unpickler.load_truecCsL|��}|tdd�krd}n|tdd�krd}nt|d�}|�|�dS)Nr�FTr)r�rrr�r�)r$r��valrrr�load_int�s
z_Unpickler.load_intcC�|�td|�d��d�dS)Nrrr�r�rr�rurrr�load_binint�z_Unpickler.load_binintcCs|�|�d�d�dS�Nr�r)r�r�rurrr�load_binint1sz_Unpickler.load_binint1cCr�)Nrr�rr�rurrr�load_binint2r�z_Unpickler.load_binint2cCs@|��dd�}|r|ddkr|dd�}|�t|d��dS)Nr��Lr)r�r�r�)r$r�rrr�	load_longsz_Unpickler.load_longcCs*|�d�d}|�|�}|�t|��dSr�)r�r�r�r�rrr�
load_long1s
z_Unpickler.load_long1cCs>td|�d��\}|dkrtd��|�|�}|�t|��dS)Nrrrz#LONG pickle has negative byte count)rr�rr�r�r�rrr�
load_long4s

z_Unpickler.load_long4cCs|�t|��dd���dS�Nr�)r�r}r�rurrr�
load_float"r�z_Unpickler.load_floatcCr�)Nr(r�rr�rurrr�
load_binfloat&r�z_Unpickler.load_binfloatcCs|jdkr|S|�|j|j�S)Nr.)r�r�r�r#rrr�_decode_string*s
z_Unpickler._decode_stringcCsl|��dd�}t|�dkr#|d|dkr#|ddvr#|dd�}ntd��|�|�t�|�d��dS)Nr�r�rs"'r�z)the STRING opcode argument must be quoted)r�r�rr�r�r/�
escape_decoder�rrr�load_string3s
(z_Unpickler.load_stringcCs@td|�d��\}|dkrtd��|�|�}|�|�|��dS)Nrrrz(BINSTRING pickle has negative byte count)rr�rr�r��r$r�r�rrr�load_binstring=s

z_Unpickler.load_binstringcC�:td|�d��\}|tkrtdt��|�|�|��dS)Nr�rz2BINBYTES exceeds system's maximum size of %d bytes�rr�r	rr��r$r�rrr�
load_binbytesF��z_Unpickler.load_binbytescCs |�t|��dd�d��dS)Nr�rH)r�r�r�rurrr�load_unicodeNs z_Unpickler.load_unicodecC�Btd|�d��\}|tkrtdt��|�t|�|�dd��dS)Nr�rz4BINUNICODE exceeds system's maximum size of %d bytesrArB�rr�r	rr�r�r�rrr�load_binunicodeR��z_Unpickler.load_binunicodecCr�)Nr}r�z5BINUNICODE8 exceeds system's maximum size of %d bytesrArBr�r�rrr�load_binunicode8Zr�z_Unpickler.load_binunicode8cCr�)Nr}r�z3BINBYTES8 exceeds system's maximum size of %d bytesr�r�rrr�load_binbytes8br�z_Unpickler.load_binbytes8cCsFtd|�d��\}|tkrtdt��t|�}|�|�|�|�dS)Nr}r�z4BYTEARRAY8 exceeds system's maximum size of %d bytes)rr�r	rr5r�r�)r$r��brrr�load_bytearray8js�
z_Unpickler.load_bytearray8cCsF|jdur	td��zt|j�}Wntytd��w|�|�dS)NzLpickle stream refers to out-of-band data but no *buffers* argument was givenznot enough out-of-band buffers)r�r�next�
StopIterationr�)r$r�rrr�load_next_bufferts
�z_Unpickler.load_next_buffercCs\|jd}t|��}|js|��|jd<Wd�dSWd�dS1s'wYdSr�)r��
memoryviewr;�
toreadonly)r$r�r?rrr�load_readonly_buffers

�"�z_Unpickler.load_readonly_buffercCs,|�d�d}|�|�}|�|�|��dSr�)r�r�r�r�rrr�load_short_binstring�s
z_Unpickler.load_short_binstringcCs"|�d�d}|�|�|��dSr�)r�r�r�rrr�load_short_binbytes�sz_Unpickler.load_short_binbytescCs*|�d�d}|�t|�|�dd��dS)Nr�rrArB)r�r�r�r�rrr�load_short_binunicode�sz _Unpickler.load_short_binunicodecC�|��}|�t|��dSr!)r�r�r�r�rrr�
load_tuple��z_Unpickler.load_tuplecCr�)Nrr�rurrr�load_empty_tuple�rwz_Unpickler.load_empty_tuplecCs|jdf|jd<dSr��r�rurrr�load_tuple1�sz_Unpickler.load_tuple1cCs$|jd|jdfg|jdd�<dS)Nr�r�r�rurrr�load_tuple2�s$z_Unpickler.load_tuple2cCs,|jd|jd|jdfg|jdd�<dS)N���r�r�r�rurrr�load_tuple3�s,z_Unpickler.load_tuple3cCs|�g�dSr!r�rurrr�load_empty_list�rwz_Unpickler.load_empty_listcCs|�i�dSr!r�rurrr�load_empty_dictionary�rwz _Unpickler.load_empty_dictionarycCs|�t��dSr!)r�rgrurrr�load_empty_set�sz_Unpickler.load_empty_setcCr�r!)r�r�rlr�rrr�load_frozenset�r�z_Unpickler.load_frozensetcCs|��}|�|�dSr!)r�r�r�rrr�	load_list�sz_Unpickler.load_listcs4|����fdd�tdt��d�D�}|�|�dS)Ncsi|]}�|�|d�qS)r�r)rmr��r�rr�
<dictcomp>�s�z(_Unpickler.load_dict.<locals>.<dictcomp>rr�)r��ranger�r�)r$�drr�r�	load_dict�s

�z_Unpickler.load_dictc
Csv|st|t�rt|d�r/z||�}Wn!ty.}ztd|jt|�ft��d��d}~ww|�|�}|�	|�dS)NZ__getinitargs__zin constructor for %s: %sr�)
r�r�r�r�rr�r��exc_inforr�)r$�klassrr"�errrrr�_instantiate�s��
���
z_Unpickler._instantiatecCsL|��dd��d�}|��dd��d�}|�||�}|�||���dS)Nr�r�)r�r��
find_classr�r��r$r�r�r�rrr�	load_inst�sz_Unpickler.load_instcCs"|��}|�d�}|�||�dSr�)r�r�r�)r$rrrrr�load_obj�s
z_Unpickler.load_objcCs4|j��}|j��}|j|g|�R�}|�|�dSr!�r�r�rr�)r$rrr�rrr�load_newobj�s

z_Unpickler.load_newobjcCsD|j��}|j��}|j��}|j|g|�Ri|��}|�|�dSr!r�)r$rrrr�rrr�load_newobj_ex�s



z_Unpickler.load_newobj_excCsF|��dd��d�}|��dd��d�}|�||�}|�|�dS)Nr�rA)r�r�r�r�r�rrr�load_global�sz_Unpickler.load_globalcCsJ|j��}|j��}t|�tust|�turtd��|�|�||��dS)NzSTACK_GLOBAL requires str)r�r�r�r�rr�r�)r$r�r�rrr�load_stack_global�s


z_Unpickler.load_stack_globalcCs|�d�d}|�|�dSr�)r��
get_extension�r$r{rrr�	load_ext1sz_Unpickler.load_ext1cC� td|�d��\}|�|�dS)Nrr��rr�r�r�rrr�	load_ext2
�z_Unpickler.load_ext2cCr�)Nrrr�r�rrr�	load_ext4r�z_Unpickler.load_ext4cCspg}t�||�}||ur|�|�dSt�|�}|s(|dkr"td��td|��|j|�}|t|<|�|�dS)NrzEXT specifies code <= 0zunregistered extension code %d)rr�r�rrr�r�)r$r{Znilr�r�rrrr�s


z_Unpickler.get_extensioncCs�t�d||�|jdkr*|jr*||ftjvr tj||f\}}n
|tjvr*tj|}t|dd�|jdkr?ttj	||�dSt
tj	||�S)Nzpickle.find_classr�rror)r��auditr�r�rzZNAME_MAPPINGZIMPORT_MAPPINGrqr�r�r�)r$r�r�rrrr�$s


z_Unpickler.find_classcCs&|j}|��}|d}||�|d<dSr��r�r�)r$r�rrrrr�load_reduce2sz_Unpickler.load_reducecCs|jr	|jd=dS|��dSr�)r�r�rurrr�load_pop9sz_Unpickler.load_popcCs|��dSr!)r�rurrr�
load_pop_mark@sz_Unpickler.load_pop_markcCs|�|jd�dSr�)r�r�rurrr�load_dupDsz_Unpickler.load_dupcCsNt|��dd��}z|�|j|�WdSty&d|��}t|�d�w)Nr��Memo value not found at index )r�r�r�r�rsr)r$r��msgrrr�load_getHs

�z_Unpickler.load_getc
CsR|�d�d}z|�|j|�WdSty(}z
d|��}t|�d�d}~ww)Nr�rr�)r�r�r�rsr�r$r��excr�rrr�load_bingetQs

��z_Unpickler.load_bingetc
CsVtd|�d��\}z|�|j|�WdSty*}z
d|��}t|�d�d}~ww)Nr�rr�)rr�r�r�rsrr�rrr�load_long_bingetZs

��z_Unpickler.load_long_bingetcCs8t|��dd��}|dkrtd��|jd|j|<dS)Nr�rznegative PUT argument)r�r�r�r�r�r�rrr�load_putcsz_Unpickler.load_putcCs2|�d�d}|dkrtd��|jd|j|<dS)Nr�rznegative BINPUT argumentr�)r�r�r�r�r�rrr�load_binputjsz_Unpickler.load_binputcCs6td|�d��\}|tkrtd��|jd|j|<dS)Nr�rznegative LONG_BINPUT argumentr�)rr�r	r�r�r�r�rrr�load_long_binputqsz_Unpickler.load_long_binputcCs|j}|jd|t|�<dSr�)r�r�r�)r$r�rrr�load_memoizexsz_Unpickler.load_memoizecCs$|j}|��}|d}|�|�dSr�)r�r�r�)r$r�r"r[rrr�load_append}sz_Unpickler.load_appendcCsX|��}|jd}z|j}Wn	tyYnw||�dS|j}|D]}||�q#dSr�)r�r��extendr�r�)r$r�Zlist_objrr�rjrrr�load_appends�s

�
�z_Unpickler.load_appendscCs*|j}|��}|��}|d}|||<dSr�r�)r$r�r"r�rrrr�load_setitem�s
z_Unpickler.load_setitemcCs@|��}|jd}tdt|�d�D]}||d|||<qdS)Nr�rr�r�)r�r�r�r�)r$r�rr�rrr�
load_setitems�s

�z_Unpickler.load_setitemscCsF|��}|jd}t|t�r|�|�dS|j}|D]}||�qdSr�)r�r�r�rg�update�add)r$r�Zset_objrrjrrr�
load_additems�s


�z_Unpickler.load_additemsc
Cs�|j}|��}|d}t|dd�}|dur||�dSd}t|t�r,t|�dkr,|\}}|rN|j}tj}|�	�D]\}}	t
|�turI|	|||�<q8|	||<q8|r_|�	�D]\}}	t|||	�qTdSdS)Nr��__setstate__r�)
r�r�r�r�r�r��__dict__r��internr�r�r��setattr)
r$r�r�inst�setstateZ	slotstateZ	inst_dictrrerfrrr�
load_build�s,
�z_Unpickler.load_buildcCs"|j�|j�g|_|jj|_dSr!)r�r�r�rurrr�	load_mark�sz_Unpickler.load_markcCs|j��}t|��r!)r�r�r r#rrr�	load_stop�s
z_Unpickler.load_stop)�rrrr%rr�r�r�r�r�r�r�r�r�r�r�r�rr�rr�rr�r$r�r!r�rr�r r�r%r�r"r�r#r�r*r�r)r�r��STRINGr��	BINSTRINGr�r2r�rMr�rKr�rJr�r1r�r6r�r=r�r>r��SHORT_BINSTRINGr�r0r�rIr�rQr�rOr��TUPLE1r�rr��TUPLE3r�rUr�r`r�rhr�rmr�rVr�rar�r��INSTr��OBJr�r
r�rr�ryr�rxr�rtr�rur�rvr�r�r�r	r�rr�rSr��DUPr�r�r�r�rr�rr�rr�rr�rr�rrYrr]rrcr	rdrrirrrrPrr�rrrrr�qs(�0				r�r�cCst||||d��|�dS�Nr�)r�r)r�r�r�r�r�rrr�_dump�s�rcCs*t��}t||||d��|�|��}|Sr)rsrtr�r�getvalue)r�r�r�r�r��resrrr�_dumps�s�r"r�r�r�cCst|||||d���S)N�r�r�r�r�)r�r)r�r�r�r�r�rrr�_load�s
��r$cCs2t|t�r	td��t�|�}t|||||d���S)Nz%Can't load pickle from unicode stringr#)r�r�r�rsrtr�r)�sr�r�r�r�r�rrr�_loads�s

��r&cCsddl}|��Sr�)�doctestZtestmod)r'rrr�_testsr(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 runr!)��typesr�copyregrrrr�	itertoolsr�	functoolsrr�r	Zstructr
rrkrsr/rz�__all__�_picklerr�r~rrr.r5Zbytes_typesZformat_versionZcompatible_formatsr�r��	Exceptionrr
rr Zorg.python.corer&rPr�rrSrr*r$r!rr%r rr�r�r	rrrrMrKrYrryrar`r]r�r�rr�rVrUrr�r�r�rcrQrOrdr)rrr�r
rtrurvrrrrrr"r#rRr2r0rIrJr1rhrirmrrxr�r�r6r=r>r�dirrpr�r�r�r�r�r�r�rr"r$r&rrrrrrr(r�argparse�ArgumentParser�parser�add_argumentZFileType�
parse_argsr�testr*Z
print_helpZpprintr�r�rrrr�<module>sN
�
�?;
_i��	0
�
�
���

�