o w[e@sNdZddlmZddlmZddlmZmZmZddlm Z ddl m Z ddl Z ddl m Z dd lmZmZddlZddlZddlZddlZgd Zzdd lmZed d ZWn eyddZYnweefZdZgdZdZ dZ!Gddde"Z#Gddde#Z$Gddde#Z%Gddde"Z&zddl'm(Z(Wn eydZ(YnwdZ)dZ*dZ+dZ,d Z-d!Z.d"Z/d#Z0d$Z1d%Z2d&Z3d'Z4d(Z5d)Z6d*Z7d+Z8d,Z9d-Z:d.Z;d/Zd2Z?d3Z@d4ZAd5ZBd6ZCd7ZDd8ZEd9ZFd:ZGd;ZHdZKd?ZLd@ZMdAZNdBZOdCZPdDZQdEZRdFZSdGZTdHZUdIZVdJZWdKZXdLZYdMZZdNZ[dOZ\dPZ]dQZ^dRZ_eOeYeZe[gZ`dSZadTZbdUZcdVZddWZedXZfdYZgdZZhd[Zid\Zjd]Zkd^Zld_Zmd`ZndaZoepdbdceqDGdddedeZrGdfdgdgZsdhdiZtdjdkZudldmZvdndoZwGdpdqdqZxGdrdsdsZydd ddtdudvZzdd ddtdwdxZ{d dydzdd{d|d}Z|d dydzdd{d~dZ}zdd lm#Z#m$Z$m%Z%m~Z~mZmZmZmZmZWneyexeyZ~Zeze{e|e}f\ZZZZYnwddZedkr#ddlZejddZejdeddddejdddddejddddeZejredSejsedSddlZejD]ZeeZeeqdSdS)aCreate 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(bytes) -> object Misc variables: __version__ format_version compatible_formats ) FunctionType)dispatch_table)_extension_registry_inverted_registry_extension_cache)islice)partialN)maxsize)packunpack) PickleError PicklingErrorUnpicklingErrorPickler Unpicklerdumpdumpsloadloads) PickleBufferrTF4.0)z1.0z1.1z1.2z1.3z2.0z3.0rz5.0c@eZdZdZdS)r z6A common base class for the other pickling exceptions.N__name__ __module__ __qualname____doc__rr/usr/lib/python3.10/pickle.pyr Isr c@r)r z]This exception is raised when an unpicklable object is passed to the dump() method. Nrrrrr r Msr c@r)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. Nrrrrr rTsrc@seZdZddZdS)_StopcCs ||_dSN)valueselfr#rrr __init__bs z_Stop.__init__N)rrrr&rrrr r!as r!) PyStringMap(.012FIJKLMNPQRSTUVXabcd}eghijl]opqrst)uGsI01 sI00 BCcCsg|] }td|r|qS)z[A-Z][A-Z0-9_]+$)rematch).0xrrr srpc@sFeZdZdZdZddZddZddZdd d Zd d Z ddZ dS)_FramerricCs||_d|_dSr") file_write current_frame)r%rrrrr r&s z_Framer.__init__cCst|_dSr")ioBytesIOrsr%rrr start_framingz_Framer.start_framingcCs2|jr|jdkr|jddd|_dSdSdS)NrTforce)rstell commit_framervrrr end_framings  z_Framer.end_framingFcCsn|jr3|j}||jks|r5|}|j}t||jkr(|ttdt|||t |_dSdSdS)Nz&Can't get local attribute {!r} on {!r}z Can't get attribute {!r} on {!r})splitAttributeErrorformatgetattr)objnamesubpathparentrrr _getattributeBs  rc Cst|dd}|dur |StjD]*\}}|dks#|dks#|dur$qzt||d|ur3|WSWqty=YqwdS)z$Find the module an object belong to.rN__main__ __mp_main__r)rsysmodulescopyitemsrr)rr module_namemodulerrr whichmoduleOs   rcCsh|dkrdS|d?d}|j|ddd}|dkr2|dkr2|dd kr2|d d @dkr2|d d}|S) aEncode 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' >>> rrlittleT byteordersignedrN) bit_lengthto_bytes)ronbytesresultrrr encode_longbs rcCstj|dddS)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 rTr)int from_bytes)rrrr decode_longsrc@seZdZdddddZ iZ ddZee ed<ddZee e<ddZee 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$d0d1Z%e%e e&<e'dure%e e'<d2d3Z(d4d5Z)e)e e*<d6d7Z+e+e e,<dtdwt|j|_ |j j|_|j j |_ i|_ t ||_|dk|_d|_|od|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, 4 and 5. The default protocol is 4. It was introduced in Python 3.4, and is incompatible with previous versions. 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. If *buffer_callback* is None (the default), buffer views are serialized into *file* as part of the pickle stream. If *buffer_callback* is not None, then it can be called any number of times with a buffer view. If the callback returns a false value (such as None), the given buffer is out-of-band; otherwise the buffer is serialized in-band, i.e. inside the pickle stream. It is an error if *buffer_callback* is not None and *protocol* is None or smaller than 5. Nrzpickle protocol must be <= %drz#buffer_callback needs protocol >= 5z"file must have a 'write' attributerr)DEFAULT_PROTOCOLHIGHEST_PROTOCOL ValueError_buffer_callbackr _file_writer TypeErrorrqframerr_write_large_bytesmemorprotobinfastr)r%fileprotocolrrrrr r&s,#        z_Pickler.__init__cCs|jdS)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)rclearrvrrr clear_memosz_Pickler.clear_memocCsrt|dstd|jjf|jdkr|ttd|j|jdkr(|j | ||t |j dS)z7Write a pickled representation of obj to the open file.rz2Pickler.__init__() was not called by %s.__init__()|jr|ttd|dS|tt|dddS)N>drr)rrBINFLOATr FLOATrrrrrr save_floats z_Pickler.save_floatcCs|jdkr!|s|jtd|ddS|jtjt|ddf|ddSt|}|dkr6|tt d||n3|dkrK|jdkrK| t t d ||n||j j kr]| tt d ||n |tt d ||||dS) Nrrr latin1rrrr~r)rrbytescodecsrrrrSHORT_BINBYTESr r BINBYTES8rrBINBYTESrr%rrrrr save_bytess"  z_Pickler.save_bytescCs|jdkr|s|jtd|ddS|jtt|f|ddSt|}||jjkr4|tt d||n | tt d||| |dS)Nrrr r~) rr bytearrayr<rrrr BYTEARRAY8r rrrArrr save_bytearray)s  z_Pickler.save_bytearraycCs|jdkr td|X}|jstdd}|jdur#t||}|r8|jr0||n-| |n| t |jrM| t WddSWddSWddSWddS1shwYdS)Nrz0PickleBuffer can only pickled with protocol >= 5zHPickleBuffer can not be pickled when pointing to a non-contiguous bufferT) rr raw contiguousrboolreadonlyrBtobytesrEr NEXT_BUFFERREADONLY_BUFFER)r%rmin_bandrrr save_picklebuffer9s,       "z_Pickler.save_picklebuffercCs|jrW|dd}t|}|dkr#|jdkr#|ttd||n^|dkr8|jdkr8|ttd||nI||j j krJ|t td||n7|t td||n*| d d }| d d }| d d}| dd}| dd}|t |dd||dS)Nutf-8 surrogatepassrrrr;r~r\z\u005cz\u0000 z\u000a z\u000dz\u001araw-unicode-escaper)rrrrrSHORT_BINUNICODEr r BINUNICODE8rr BINUNICODEreplaceUNICODErr3rrr save_strSs&       z_Pickler.save_strcCs<|s|jr |tdS|ttdSt|}|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)Nrrrr)rr EMPTY_TUPLEMARKTUPLErrrrrrr_tuplesize2coderPOP_MARK)r%rrrrelementrrrrr save_tuplejs@       z_Pickler.save_tuplecCs8|jr |tn|tt||||dSr")rr EMPTY_LISTr_LISTrrrrrr save_lists   z_Pickler.save_listicCs|j}|j}|js|D] }|||tq dSt|} tt||j}t|}|dkr?|t |D]}||q3|t n |rK||d|t||jkrRdSqNTrr) rrrAPPENDiterlistr _BATCHSIZErr_APPENDS)r%rrrroittmprrrr rs,     z_Pickler._batch_appendscCs<|jr |tn|tt||||dSr")rr EMPTY_DICTr_DICTrrrrrrr save_dicts   z_Pickler.save_dictc Cs|j}|j}|js|D]\}}|||||tq dSt|} tt||j}t|}|dkrK|t |D] \}}||||q9|t n|r_|d\}}|||||t||jkrfdSq#rh) rrrSETITEMrjrkrrlrr_SETITEMS) r%rrrkvrnrorrrr rs4       z_Pickler._batch_setitemscCs|j}|j}|jdkr|jtt|f|ddS|t||t|} tt ||j }t |}|dkrG|t |D]}||q<|t ||j krNdSq&)Nrr Tr)rrrrsetrk EMPTY_SETrrjrrlrr_ADDITEMS)r%rrrrnbatchritemrrr save_sets&    z_Pickler.save_setcCs|j}|j}|jdkr|jtt|f|ddS|t|D]}||qt||jvr>|t | |jt|ddS|t | |dS)Nrr r) rrrr frozensetrkr_rrrbr FROZENSETr)r%rrrr{rrr save_frozenset s   z_Pickler.save_frozensetc CsH|j}|j}|durt|dd}|dur|j}t||}zt|ddtj|}t||\}}Wnt t t fyDt d|||fdw||urRt d|||f|j dkrt||f} | r| dksfJ| dkru|ttd| dS| d kr|ttd | dS|ttd | dS|d d} ||ur| }|j d kr|||||tnm||ur|t|| fn`|j dkr|tt|ddt|ddnH|jrtj} tj} ||f| vr| ||f\}}n|| vr| |}z|tt|ddt|ddWntyt d|||j fdw||dS)Nrrlevelz(Can't pickle %r: it's not found as %s.%sz2Can't pickle %r: it's not the same object as %s.%srrrr)r*r+rrrrPrrz?can't pickle global identifier '%s.%s' using pickle protocol %i) rrrrr __import__rrr ImportErrorKeyErrorrr rrrEXT1r EXT2EXT4 rpartitionr STACK_GLOBALrGLOBALr<r_compat_pickleREVERSE_NAME_MAPPINGREVERSE_IMPORT_MAPPINGr r) r%rrrrrrobj2rcodelastnamer_name_mappingr_import_mappingrrr r s              z_Pickler.save_globalcCs`|tdur|jtd|dS|ttur|jttf|dS|tdur+|jtd|dS||S)Nr"r .).)rrrrrrrr save_typebs    z_Pickler.save_typer")T)NNNN)0rrrr&rrrrrrrrrrr#rr(rHr5rr9floatrBr<rErC_HAVE_PICKLE_BUFFERrOrr]rrdrrgrkrlrrrdictr'rr|rwrr}rrrrrrr rsl 9  F  u  1   B rc@seZdZdddddddZdd Zd d Zd d ZiZddZeee d<ddZ e ee d<ddZ e ee d<ddZeeed<ddZeeed<ddZeeed<ddZeeed<ddZeeed<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/d0Z(d1d2Z)e)ee*d<d3d4Z+e+ee,d<d5d6Z-e-ee.d<d7d8Z/e/ee0d<d9d:Z1e1ee2d<d;d<Z3e3ee4d<d=d>Z5e5ee6d<d?d@Z7e7ee8d<dAdBZ9e9ee:d<dCdDZ;e;eed<dGdHZ?e?ee@d<dIdJZAeAeeBd<dKdLZCeCeeDd<dMdNZEeEeeFd<dOdPZGeGeeHd<dQdRZIeIeeJd<dSdTZKeKeeLd<dUdVZMeMeeNd<dWdXZOeOeePd<dYdZZQeQeeRd<d[d\ZSeSeeTd<d]d^ZUeUeeVd<d_d`ZWeWeeXd<dadbZYdcddZZeZee[d<dedfZ\e\ee]d<dgdhZ^e^ee_d<didjZ`e`eead<dkdlZbebeecd<dmdnZdedeeed<dodpZfefeegd<dqdrZheheeid<dsdtZjejeekd<dudvZldwdxZmdydzZneneeod<d{d|Zpepeeqd<d}d~Zrereesd<ddZteteeud<ddZveveewd<ddZxexeeyd<ddZzezee{d<ddZ|e|ee}d<ddZ~e~eed<ddZeeed<ddZeeed<ddZeeed<ddZeeed<ddZeeed<ddZeeed<ddZeeed<ddZeeed<ddZeeed<ddZeeed<dS) _UnpicklerTASCIIstrictNrencodingerrorsbufferscCsH|durt|nd|_|j|_|j|_i|_||_||_d|_ ||_ dS)aThis 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. If *buffers* is not None, it should be an iterable of buffer-enabled objects that is consumed each time the pickle stream references an out-of-band buffer view. Such buffers have been given in order to the *buffer_callback* of a Pickler object. If *buffers* is None (the default), then the buffers are taken from the pickle stream, assuming they are serialized there. It is an error for *buffers* to be None if the pickle stream was produced with a non-None *buffer_callback*. Other optional 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 these 8-bit string instances as bytes objects. Nr) rj_buffersr_file_readliner _file_readrrrrr)r%rrrrrrrr r&ss' z_Unpickler.__init__c Cst|dstd|jjft|j|j|_|jj|_|jj |_ |jj |_ g|_ g|_ |j j |_ d|_|j}|j}z |d}|sCtt|tsJJ||d|q;tyg}z |jWYd}~Sd}~ww)zRead a pickled object representation from the open file. Return the reconstituted object hierarchy specified in the file. rz4Unpickler.__init__() was not called by %s.__init__()rTrN)rrrrrrr _unframerrrr metastackstackappendrrEOFErrorr bytes_typesr!r#)r%rrkeystopinstrrr rs4     z_Unpickler.loadcCs |j}|j|_|jj|_|Sr")rrpoprr%rrrr pop_marks  z_Unpickler.pop_markcCstd)Nz%unsupported persistent id encountered)rr rrr persistent_loadsz_Unpickler.persistent_loadcCs:|dd}d|krtksntd|||_dS)Nrrzunsupported pickle protocol: %d)rrrr)r%rrrr load_protos  z_Unpickler.load_protorcCs8td|d\}|tjkrtd||j|dS)Nr~zframe size > sys.maxsize: %d)r rrr rrrrrrr rs  z_Unpickler.load_framecCsFz |ddd}Wn tytdw|||dS)Nrrr)rdecodeUnicodeDecodeErrorrrrr rrr load_persids z_Unpickler.load_persidcCs|j}|||dSr")rrrrr rrr load_binpersids z_Unpickler.load_binpersidcCs|ddSr"rrvrrr load_nonerxz_Unpickler.load_nonecC|ddS)NFrrvrrr load_falserxz_Unpickler.load_falsecCr)NTrrvrrr load_truerxz_Unpickler.load_truecCsL|}|tddkrd}n|tddkrd}nt|d}||dS)NrFTr)rr'r&rr)r%rvalrrr load_ints z_Unpickler.load_intcC|td|dddS)Nr+rrrr rrvrrr load_binintz_Unpickler.load_binintcCs||dddSNrr)rrrvrrr load_binint1sz_Unpickler.load_binint1cCr)Nr*rrrrvrrr load_binint2rz_Unpickler.load_binint2cCs@|dd}|r|ddkr|dd}|t|ddS)NrLr)rrr)r%rrrr load_long s z_Unpickler.load_longcCs*|dd}||}|t|dSr)rrrrrrr load_long1s z_Unpickler.load_long1cCs>td|d\}|dkrtd||}|t|dS)Nr+rrz#LONG pickle has negative byte count)r rrrrrrrr load_long4s  z_Unpickler.load_long4cCs|t|dddSNr)rrrrvrrr load_float"rz_Unpickler.load_floatcCr)Nr6rrrrvrrr load_binfloat&rz_Unpickler.load_binfloatcCs|jdkr|S||j|jS)Nr<)rrrr$rrr _decode_string*s z_Unpickler._decode_stringcCsl|dd}t|dkr#|d|dkr#|ddvr#|dd}ntd||t|ddS)Nrrrs"'rz)the STRING opcode argument must be quoted)rrrrrr= escape_decoderrrr load_string3s (z_Unpickler.load_stringcCs@td|d\}|dkrtd||}|||dS)Nr+rrz(BINSTRING pickle has negative byte count)r rrrrr%rrrrr load_binstring=s  z_Unpickler.load_binstringcC:td|d\}|tkrtdt|||dS)Nrrz2BINBYTES exceeds system's maximum size of %d bytesr rr rrr%rrrr load_binbytesF z_Unpickler.load_binbytescCs |t|ddddS)NrrW)rrrrvrrr load_unicodeNs z_Unpickler.load_unicodecCBtd|d\}|tkrtdt|t||dddS)Nrrz4BINUNICODE exceeds system's maximum size of %d bytesrPrQr rr rrrrrrr load_binunicodeR z_Unpickler.load_binunicodecCr)Nr~rz5BINUNICODE8 exceeds system's maximum size of %d bytesrPrQrrrrr load_binunicode8Zrz_Unpickler.load_binunicode8cCr)Nr~rz3BINBYTES8 exceeds system's maximum size of %d bytesrrrrr load_binbytes8brz_Unpickler.load_binbytes8cCsFtd|d\}|tkrtdtt|}||||dS)Nr~rz4BYTEARRAY8 exceeds system's maximum size of %d bytes)r rr rrCrr)r%rbrrr load_bytearray8js z_Unpickler.load_bytearray8cCsF|jdur tdzt|j}Wn tytdw||dS)NzLpickle stream refers to out-of-band data but no *buffers* argument was givenznot enough out-of-band buffers)rrnext StopIterationr)r%rrrr load_next_bufferts  z_Unpickler.load_next_buffercCs\|jd}t|}|js||jd<WddSWddS1s'wYdSr)r memoryviewrI toreadonly)r%rrMrrr load_readonly_buffers  "z_Unpickler.load_readonly_buffercCs,|dd}||}|||dSr)rrrrrrr load_short_binstrings z_Unpickler.load_short_binstringcCs"|dd}|||dSr)rrrrrr load_short_binbytessz_Unpickler.load_short_binbytescCs*|dd}|t||dddS)NrrrPrQ)rrrrrrr load_short_binunicodesz _Unpickler.load_short_binunicodecC|}|t|dSr")rrrrrrr load_tuplez_Unpickler.load_tuplecCr)Nrrrvrrr load_empty_tuplerxz_Unpickler.load_empty_tuplecCs|jdf|jd<dSrrrvrrr load_tuple1sz_Unpickler.load_tuple1cCs$|jd|jdfg|jdd<dS)Nrrrrvrrr load_tuple2s$z_Unpickler.load_tuple2cCs,|jd|jd|jdfg|jdd<dS)Nrrrrvrrr load_tuple3s,z_Unpickler.load_tuple3cCs|gdSr"rrvrrr load_empty_listrxz_Unpickler.load_empty_listcCs|idSr"rrvrrr load_empty_dictionaryrxz _Unpickler.load_empty_dictionarycCs|tdSr")rrwrvrrr load_empty_setsz_Unpickler.load_empty_setcCrr")rrr}rrrr load_frozensetrz_Unpickler.load_frozensetcCs|}||dSr")rrrrrr load_listsz_Unpickler.load_listcs4|fddtdtdD}||dS)Ncsi|] }||dqS)rr)rnrrrr sz(_Unpickler.load_dict..rr)rrangerr)r%drrr load_dicts  z_Unpickler.load_dictc Csv|s t|tr t|dr/z||}Wn!ty.}ztd|jt|ftdd}~ww||}| |dS)N__getinitargs__zin constructor for %s: %sr) rrrrrrrexc_inforr)r%klassrr#errrrr _instantiates    z_Unpickler._instantiatecCsL|ddd}|ddd}|||}|||dS)Nrr)rr find_classrrr%rrrrrr load_insts z_Unpickler.load_instcCs"|}|d}|||dSNr)rrr)r%rr rrr load_objs z_Unpickler.load_objcCs4|j}|j}|j|g|R}||dSr"rrrr)r%rr rrrr load_newobjs  z_Unpickler.load_newobjcCsD|j}|j}|j}|j|g|Ri|}||dSr"r)r%r!rr rrrr load_newobj_exs   z_Unpickler.load_newobj_excCsF|ddd}|ddd}|||}||dS)NrrP)rrrrrrrr load_globals z_Unpickler.load_globalcCsJ|j}|j}t|tust|turtd||||dS)NzSTACK_GLOBAL requires str)rrrrrrr)r%rrrrr load_stack_globals  z_Unpickler.load_stack_globalcCs|dd}||dSr)r get_extensionr%rrrr load_ext1sz_Unpickler.load_ext1cC td|d\}||dS)Nr*rr rrrrrr load_ext2 z_Unpickler.load_ext2cCr )Nr+rr rrrr load_ext4r z_Unpickler.load_ext4cCspg}t||}||ur||dSt|}|s(|dkr"tdtd||j|}|t|<||dS)NrzEXT specifies code <= 0zunregistered extension code %d)rrrrrrr)r%rnilrrrrr rs     z_Unpickler.get_extensioncCstd|||jdkr*|jr*||ftjvr tj||f\}}n |tjvr*tj|}t|dd|jdkr?ttj ||dSt tj ||S)Nzpickle.find_classrrrr) rauditrrr NAME_MAPPINGIMPORT_MAPPINGrrrr)r%rrrrr r$s    z_Unpickler.find_classcCs&|j}|}|d}|||d<dSrrr)r%rrrrrr load_reduce2sz_Unpickler.load_reducecCs|jr |jd=dS|dSr)rrrvrrr load_pop9s  z_Unpickler.load_popcCs |dSr")rrvrrr load_pop_mark@s z_Unpickler.load_pop_markcCs||jddSr)rrrvrrr load_dupDsz_Unpickler.load_dupcCsNt|dd}z ||j|WdSty&d|}t|dw)NrMemo value not found at index )rrrrrr)r%rmsgrrr load_getHs   z_Unpickler.load_getc CsR|dd}z ||j|WdSty(}z d|}t|dd}~ww)Nrrr)rrrrrr%rexcrrrr load_bingetQs  z_Unpickler.load_bingetc CsVtd|d\}z ||j|WdSty*}z d|}t|dd}~ww)Nrrr)r rrrrrrrrr load_long_bingetZs  z_Unpickler.load_long_bingetcCs8t|dd}|dkrtd|jd|j|<dS)Nrrznegative PUT argument)rrrrrrrrr load_putcsz_Unpickler.load_putcCs2|dd}|dkrtd|jd|j|<dS)Nrrznegative BINPUT argumentr)rrrrrrrr load_binputjsz_Unpickler.load_binputcCs6td|d\}|tkrtd|jd|j|<dS)Nrrznegative LONG_BINPUT argumentr)r rr rrrrrrr load_long_binputqsz_Unpickler.load_long_binputcCs|j}|jd|t|<dSr)rrr)r%rrrr load_memoizexsz_Unpickler.load_memoizecCs$|j}|}|d}||dSr)rrr)r%rr#rkrrr load_append}sz_Unpickler.load_appendcCsX|}|jd}z|j}Wn tyYnw||dS|j}|D]}||q#dSr)rrextendrr)r%rlist_objr#rr{rrr load_appendss    z_Unpickler.load_appendscCs*|j}|}|}|d}|||<dSrr)r%rr#rrrrr load_setitems  z_Unpickler.load_setitemcCs@|}|jd}tdt|dD] }||d|||<qdS)Nrrrr)rrrr)r%rrrrrr load_setitemss  z_Unpickler.load_setitemscCsF|}|jd}t|tr||dS|j}|D]}||qdSr)rrrrwupdateadd)r%rset_objr)r{rrr load_additemss   z_Unpickler.load_additemsc Cs|j}|}|d}t|dd}|dur||dSd}t|tr,t|dkr,|\}}|rN|j}tj}| D]\}} t |t urI| |||<q8| ||<q8|r_| D] \}} t ||| qTdSdS)Nr __setstate__r) rrrrrr__dict__rinternrrrsetattr) r%rrinstsetstate slotstate inst_dictr.rurvrrr load_builds,   z_Unpickler.load_buildcCs"|j|jg|_|jj|_dSr")rrrrvrrr load_marksz_Unpickler.load_markcCs|j}t|r")rrr!r$rrr load_stops z_Unpickler.load_stop)rrrr&rrrrrrrrrrrrrr"rr%rr$rr1rr.rr,rr-rr2rr/rr0rr8rr7rrSTRINGr BINSTRINGrr@rr\rrZrrYrr?rrDrrKrrLrSHORT_BINSTRINGrr>rrXrr`rr^rTUPLE1rrrTUPLE3rrerrprrxrr~rrfrrqrrINSTrOBJrrrrrrrrrrr rr rrrrrrrrrbrDUPrrrrrrrrrrr rr!rr"rir%rmr&rsr'rtr+ryr4rr5r_r6rrrrr rqs( 0                                                                   rrcCst||||d|dSNr)rr)rrrrrrrr _dumps r@cCs8t}t||||d||}t|tsJ|Sr?)rtrurrgetvaluerr)rrrrrresrrr _dumpssrCrrrcCst|||||dS)Nrrrr)rr)rrrrrrrr _loads rEcCs2t|tr tdt|}t|||||dS)Nz%Can't load pickle from unicode stringrD)rrrrtrurr)srrrrrrrr _loadss  rGcCsddl}|Sr)doctesttestmod)rHrrr _testsrJrz$display contents of the pickle files) description pickle_filebr*zthe pickle file)rnargshelpz-tz--test store_truezrun self-test suite)actionrPz-vz)run verbosely; only affects self-test runr")rtypesrcopyregrrrr itertoolsr functoolsrrr structr r rlrtr=r__all___picklerrrrr<rCrformat_versioncompatible_formatsrr Exceptionr r rr!org.python.corer'r_rrrbr>r8r1r.r,r2r-r"rrrr7r8r9r\rZrirrrqrprmrrr<rrfrer=rrrrsr`r^rtr7r&r'rrrrrr:rr;r$r%r/r0rar@r>rXrYr?rxryr~rrrrrDrKrLr#dirrqrrrrrrrr@rCrErGrrrrrrrJrargparseArgumentParserparser add_argumentFileType parse_argsrtestrL print_helppprintrrrrrr sN            ?; _i   0