f @dZddlmZddlmZddlmZmZmZddlm Z ddl m Z ddl Z ddl m Z dd lmZmZddlZddlZddlZddlZgd Z dd lmZej1d d ZeefZdZgdZdZ dZ!Gdde"Z#Gdde#Z$Gdde#Z%Gdde"Z&dZ'dZ(dZ)dZ*dZ+d Z,d!Z-d"Z.d#Z/d$Z0d%Z1d&Z2d'Z3d(Z4d)Z5d*Z6d+Z7d,Z8d-Z9d.Z:d/Z;d0Zd3Z?d4Z@d5ZAd6ZBd7ZCd8ZDd9ZEd:ZFd;ZGdZJd?ZKd@ZLdAZMdBZNdCZOdDZPdEZQdFZRdGZSdHZTdIZUdJZVdKZWdLZXdMZYdNZZdOZ[dPZ\dQZ]eMeWeXeYgZ^dRZ_dSZ`dTZadUZbdVZcdWZddXZedYZfdZZgd[Zhd\Zid]Zjd^Zkd_Zld`ZmejeoDcgc]}ejda|s|c}GdbdcZqGdddeZrdfZsdgZtdhZudiZvGdjdkZwGdldmZxdd ddndoZydd ddndpZzd dqdrddsdtZ{d dqdrddsduZ| dd lm#Z#m$Z$m%Z%m}Z}m~Z~mZmZmZmZdvZedwk(rddlZej dxyZejdzd{d|}ejd~dddejdddejZejreyejsejyddlZejD]SZedk(ree j j"Zneed5ZeeZdddejeUyy#e$rdZYwxYwcc}w#e$rewexcZ}Z~eyeze{e|f\ZZZZY:wxYw#1swYOxYw)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.0ceZdZdZy)r z6A common base class for the other pickling exceptions.N__name__ __module__ __qualname____doc__/usr/lib/python3.12/pickle.pyr r Is@r!r ceZdZdZy)rz]This exception is raised when an unpicklable object is passed to the dump() method. Nrr r!r"rrMs  r!rceZdZdZy)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. Nrr r!r"rrTs  r!rceZdZdZy)_Stopc||_yN)valueselfr)s r"__init__z_Stop.__init__bs  r!N)rrrr,r r!r"r&r&asr!r&(.012FIJKLMNPQRSTUVXabcd}eghijl]opqrst)uGsI01 sI00 BCz[A-Z][A-Z0-9_]+$c:eZdZdZdZdZdZdZd dZdZ dZ y ) _Framerric ||_d|_yr() file_write current_frame)r+rts r"r,z_Framer.__init__s$!r!c6tj|_yr()ioBytesIOrur+s r" start_framingz_Framer.start_framingsZZ\r!c|jr8|jjdkDr|jdd|_yyy)NrTforce)rutell commit_framerys r" end_framingz_Framer.end_framingsC   $"4"4"9"9";a"?   D  )!%D #@ r!c d|jr|j}|j|jk\s|rx|j}|j}t ||j k\r"|ttdt |z||tj|_yyy)N|jrq|jj|}|dk(r6t|dk7r(d|_t|}|j||dd|S|t|kr t d|St|}|j||dd|SNr$pickle exhausted before end of frame)rureadintorrr)r+bufns r"rz_Unframer.readintos   ""++C0AAv#c(a-%)"H*A3s8|%:<<HCA^^A&CFHr!c|jrU|jj|}|s|dk7rd|_|j|St||kr t d|S|j|Sr)rureadrrrr+rrs r"rz_Unframer.readsp   %%**1-DAF%)"~~a((4y1}%:<<K>>!$ $r!c|jrH|jj}|sd|_|jS|ddk7r td|S|jS)N r)rureadlinerrrs r"rz_Unframer.readline&si   %%..0D%)"))++Bx8#%:<<K%%' 'r!c|jr(|jjdk7r tdtj|j ||_y)Nr!z4beginning of a new frame before end of current frame)rurrrwrxrr+ frame_sizes r" load_framez_Unframer.load_frame3sM   $"4"4"9"9";s"B!FH HZZz(BCr!r()rrrr,rrrrr r!r"rrs" " % (Dr!rc|jdD]1}|dk(rtdj|| |}t||}3|fS#t$rtdj||dwxYw)N.zz&Can't get local attribute {!r} on {!r}z Can't get attribute {!r} on {!r})splitAttributeErrorformatgetattr)objnamesubpathparents r" _getattributer<s::c? ? j  !I"(&s"35 5 ?F#w'C ? ; ? !C"(&s"35:> ? ?s A  &A0ct|dd}||Stjjj D](\}}|dk(s|dk(s| t ||d|ur|cS*y#t $rY7wxYw)z$Find the module an object belong to.rN__main__ __mp_main__r)rsysmodulescopyitemsrr)rr module_namemodules r" whichmodulerIs#|T2K #{{//1779  V : %m+~  VT*1-4""5     sA** A65A6c|dk(ry|jdz dz}|j|dd}|dkr|dkDr|dd k(r|d d zdk7r|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' >>> rr!littleT byteordersignedrN) bit_lengthto_bytes)xnbytesresults r" encode_longr\sp* Avlln!Q &F ZZ(4Z @F1u! ": 6":#4":CR[F Mr!c2tj|ddS)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)rs r" decode_longrzs$ >>$(4> @@r!cveZdZd!ddddZdZdZdZdZd Zd"d Z d Z d Z d#dd dZ iZ dZee ed<dZee e<dZee e<dZee e<dZee e<dZee e<erdZee e<dZee e<dZee e <dZ!e!e e"<dZ#dZ$dZ%e%e e&<dZ'dZ(e(e e)<dZ*e*e e+<d!dZ,d Z-e,e e.<e-e e<y)$_PicklerNT fix_importsbuffer_callbackc|t}|dkrt}n#d|cxkr tksntdtz||dkr td||_ |j|_t|j |_ |jj|_|jj|_ i|_ t||_|dk\|_d|_|xr|dk|_y#t $r tdwxYw) 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 TypeErrorrrframerr_write_large_bytesmemorprotobinfastr)r+fileprotocolrrs r"r,z_Pickler.__init__sF  'H a<'Hh2"22>3J3J!MN N ::? JJutD$**55 6 ::? KK % % ' # 4 !r!c|jryt||jvsJt|j}|j |j |||f|jt|<y)zStore an object in the memo.N)ridrrrput)r+ridxs r"memoizez_Pickler.memoizes[ 99 #wdii'''$))n 488C=! #X "S'r!c|jdk\rtS|jr+|dkrtt d|zSt t d|zSt t|jdzdzS)Nrr?? b#    S" % "e$ @6 IJ J GQ ! !68>!?@ @ 2&S&r!cyr(r rs r"rz_Pickler.persistent_idWsr!c|jr)|j|d|jty |jtt |j dzdzy#t$r tdwxYw)NF)rrr2persistent IDs in protocol 0 must be ASCII strings) rrr BINPERSIDPERSIDrrUnicodeEncodeErrorrr+rs r"rz_Pickler.save_pers[sq 88 IIceI 4 JJy ! J 6CHOOG$< ? JJtd3i..w77&@ Ar!c|jr#|jttd|zy|jtt |j dzdzy)N>drr)rrBINFLOATr FLOATrrrs r" save_floatz_Pickler.save_floatsE 88 JJx$tS/1 2 JJutCy//885@ Ar!cx|jdkrJ|s|jtd|y|jtjt |ddf|yt |}|dkr&|jttd|z|zn|dkDr3|jdk\r$|jttd |z|nb||jjk\r$|jttd |z|n%|jttd |z|z|j|y) Nrr r'latin1rrrrr)rrbytescodecsrrrrSHORT_BINBYTESr r BINBYTES8rrBINBYTESrr+rrs r" save_bytesz_Pickler.save_bytess ::>   4   "%c8"4h!?S!J  H 9 JJ~T1 5; < ^ a  # #IT1 $=s C $++00 0  # #HtD!}$|s|jtd|y|jtt|f|yt |}||j j k\r$|jttd|z|n%|jttd|z|z|j|y)Nrr r'r) rr bytearrayr]rrrr BYTEARRAY8r rrrbs r"save_bytearrayz_Pickler.save_bytearray#s ::>  BC 8   U3ZMs C  H  .. .  # #JdA$> D JJzDqM1C7 8 Sr!c|jdkr td|j5}|js tdd}|jt |j |}|rL|j r |j|jnV|j|jn6|jt|j r|jtdddy#1swYyxYw)Nrz0PickleBuffer can only pickled with protocol >= 5zHPickleBuffer can not be pickled when pointing to a non-contiguous bufferT) rrraw contiguousrboolreadonlyrctobytesrgr NEXT_BUFFERREADONLY_BUFFER)r+rmin_bands r"save_picklebufferz_Pickler.save_picklebuffer3szzA~#%455 4a||')NOO((4"4#8#8#=>Gzz 4++AIIK8JJ{+zz ?3% 4 4 4s CC88Dc,|jr|jdd}t|}|dkr6|jdk\r'|j t t d|z|zn|dkDr3|jdk\r$|jtt d|z|n||jjk\r$|jtt d|z|n|j tt d|z|zn|jd d }|jd d }|jd d}|jdd}|jdd}|j t|jdzdz|j|y)Nutf-8 surrogatepassrrrr\rr\z\u005cz\u0000 z\u000a z\u000dz\u001araw-unicode-escaper)rrrrrSHORT_BINUNICODEr r BINUNICODE8rr BINUNICODEreplaceUNICODEr)r+rrSrtmps r"save_strz_Pickler.save_strMsC 88jj/:GG ADyTZZ1_ +d4m;gEFZDJJ!O'' d4m(CWMdkk444'' T$](BGL :T1 5?@++dI.C++dI.C++dI.C++dI.C++fi0C JJw,@!AAEI J Sr!c>|s?|jr|jty|jttzyt |}|j }|j}|dkr|jdk\r|D] }|| t||vr<|j|t|d}|jt|z|zy|jt||j|y|j}|t|D] }|| t||vrR|j|t|d}|jr|t|zy|t|dzz|zy|t|j|y)Nrrrr)rr EMPTY_TUPLEMARKTUPLErrrrrrr1_tuplesize2coderPOP_MARK)r+rrrrelementrrs r" save_tuplez_Pickler.save_tupledspxx ;'  4%<(  Hyyyy 6djjAo W  #w$hhtBsG}Q/0 37S=)  ?1-. S!   d  G M  c7d?((43=+,Cxxhn% cQqSkC'(  e  Sr!c|jr|jtn|jttz|j ||j |yr()rr EMPTY_LISTrLISTrr2rs r" save_listz_Pickler.save_lists? 88 JJz " JJtd{ # S C r!ic|j}|j}|js|D]}|||tyt |} t t ||j}t|}|dkDr(|t|D] }|| |tn|r||d|t||jkryNrr) rrrAPPENDiterlistr _BATCHSIZErrAPPENDS)r+rrrritrrs r"r2z_Pickler._batch_appendssyy xx Qf    %[vb$//23CCA1ud AGgSV f 4??"r!c|jr|jtn|jttz|j ||j |jyr()rr EMPTY_DICTrDICTrr3rrs r" save_dictz_Pickler.save_dictsE 88 JJz " JJtd{ # S SYY[)r!c|j}|j}|js'|D]!\}}|||||t#yt |} t t ||j}t|}|dkDr3|t|D]\}}|||||tn&|r$|d\}}|||||t||jkryr) rrrSETITEMrrrrrrSETITEMS) r+rrrkvrrrs r"r3z_Pickler._batch_setitemssyy xx 1QQg   %[vb$//23CCA1ud DAqGGh1v1QQg4??"!r!c|j}|j}|jdkr#|jtt |f|y|t |j|t|} t t||j}t|}|dkDr'|t|D] }|| |t||jkrygNrr'r)rrrrsetr EMPTY_SETrrrrrrADDITEMS)r+rrrrbatchritems r"save_setz_Pickler.save_setsyy  ::>   S49,C  8  i S #YDOO45EE A1ud !DJh4??"r!c |j}|j}|jdkr#|jtt |f|y|t |D] }|| t||jvr8|t|j|jt|dzy|t|j|yr) rrrr frozensetrrrrrr FROZENSETr)r+rrrrs r"save_frozensetz_Pickler.save_frozensetsyy  ::>   Yc #  >  d  D J  c7dii  (TXXdii3&8&;<< =  i Sr!c :|j}|j}| t|dd}| |j}t ||} t |dt j|}t||\}}||urtd|d|d||jdk\rxtj||f} | r_| dkDsJ| d kr|t t#d | zy| d kr|t$t#d | zy|t&t#d | zy|j)dd} ||ur| }|jdk\r/|j+||j+||t,n||ur|j/t|| fn|jdk\r-|t0t3|dzdzt3|dzdzns|j4r:t6j8} t6j:} ||f| vr | ||f\}}n || vr| |} |t0t3|dzdzt3|dzdz|j?|y#tttf$rtd|d|d|dwxYw#t<$rtd|||jfzdwxYw)Nrrlevelr z: it's not the same object as rz: it's not found as rrrrIrJrKrrrtrrz?can't pickle global identifier '%s.%s' using pickle protocol %i) rrrrr __import__rrrr ImportErrorKeyErrorrrrrEXT1r EXT2EXT4 rpartitionr STACK_GLOBALrGLOBALr]r_compat_pickleREVERSE_NAME_MAPPINGREVERSE_IMPORT_MAPPINGr%r) r+rrrrrrobj2rcodelastnamer_name_mappingr_import_mappings r"rz_Pickler.save_globals yy <35D <<?Daxx4<$dD!112  V^$dD!112$dD!112??3'* V D ::? IIk " IIdO ,  6 !   Wvx&8 9 ZZ1_ &5g66>g&')./ 0!/!D!D#1#H#H &.8(6 T7J(K%K $44"2;"?K Qfu['::UBD'*+-234 SeX~6 4k4)*/3 4 4Z& Q#),2D$**+EFGLPQ Qs/I ,I4*I14&Jc|tdur|jtd|S|ttur|jttf|S|tdur|jtd|S|j|S)Nr(r'.).)rrrrrs r" save_typez_Pickler.save_typeZs $t* ##D's#; ; D( (##D>*;#E E DI ##D&c#: :$$r!r()T)NNNN)/rrrr,rrrrrrrrrrrArrGrkrTrrYfloatrcr]rgre_HAVE_PICKLE_BUFFERrrrrrrrrrrr2rdictr3rrrrrrrr r!r"rrsi784!%78r "&. ;5D'L J=A15q>BqjH$HT$Z/ HTNB:HSMB !HUO$!HUO )HY 40"3*HSM/b!HUO!HTNJ6*HTN>,HSM*)HY@D%)H\HTNr!rc$eZdZddddddZdZdZd ZiZd Zeee d <d Z e ee d <d Z e ee d <dZeeed <dZeeed <dZeeed <dZeeed <dZeeed <dZeeed <dZeeed <dZeeed <dZeeed <dZ e ee!d <dZ"e"ee#d <dZ$e$ee%d <dZ&e&ee'd <dZ(dZ)e)ee*d <dZ+e+ee,d <dZ-e-ee.d <dZ/e/ee0d <d Z1e1ee2d <d!Z3e3ee4d <d"Z5e5ee6d <d#Z7e7ee8d <d$Z9e9ee:d <d%Z;e;eed <d'Z?e?ee@d <d(ZAeAeeBd <d)ZCeCeeDd <d*ZEeEeeFd <d+ZGeGeeHd <d,ZIeIeeJd <d-ZKeKeeLd <d.ZMeMeeNd <d/ZOeOeePd <d0ZQeQeeRd <d1ZSeSeeTd <d2ZUeUeeVd <d3ZWeWeeXd <d4ZYd5ZZeZee[d <d6Z\e\ee]d <d7Z^e^ee_d <d8Z`e`eead <d9Zbebeecd <d:Zdedeeed <d;Zfefeegd <d<Zheheeid <d=Zjejeekd <d>Zld?Zmd@Zneneeod <dAZpepeeqd <dBZrereesd <dCZteteeud <dDZveveewd <dEZxexeeyd <dFZzezee{d <dGZ|e|ee}d <dHZ~e~eed <dIZeeed <dJZeeed <dKZeeed <dLZeeed <dMZeeed <dNZeeed <dOZeeed <dPZeeed <dQZeeed <dRZeeed <y)S _UnpicklerTASCIIstrictNrencodingerrorsbuffersc| t|nd|_|j|_|j|_i|_||_||_d|_ ||_ y)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) r_buffersr_file_readliner _file_readrrrrr)r+rrrrrs r"r,z_Unpickler.__init__ksRN*1)<W $ "mm))     &r!ct|ds#td|jjdt |j |j |_|jj|_|jj|_ |jj|_ g|_ g|_ |jj|_ d|_|j}|j} |d}|st t#|t$sJ||d|1#t&$r}|j(cYd}~Sd}~wwxYw)zRead a pickled object representation from the open file. Return the reconstituted object hierarchy specified in the file. rz'Unpickler.__init__() was not called by rrrN)rrrrrrr _unframerrrr metastackstackappendrrEOFErrorr bytes_typesr&r))r+rrkeystopinsts r"rz_Unpickler.loadst\*!59^^5L5L#OP P"4??D4G4GHNN'' // //  jj''  yy== "1g"N!#{333 Q &   ">> ! "s/2D!! E* D;5E;Ec|j}|jj|_|jj|_|Sr()rrpoprr+rs r"pop_markz_Unpickler.pop_marks5 ^^'') jj''  r!ctd)Nz%unsupported persistent id encountered)rr&s r"persistent_loadz_Unpickler.persistent_loadsEFFr!cx|jdd}d|cxkr tksntd|z||_y)Nrrzunsupported pickle protocol: %d)rrrr)r+rs r" load_protoz_Unpickler.load_protos9 ! QE--->FG G r!rctd|jd\}|tjkDrt d|z|j j |y)Nrzframe size > sys.maxsize: %d)r rrr rrrrs r"rz_Unpickler.load_framesGT499Q<0  #;jHI I !!*-r!c |jddjd}|j |j |y#t$r tdwxYw)Nrrr")rdecodeUnicodeDecodeErrorrrrr&s r" load_persidz_Unpickler.load_persidsc F--/#2&--g6C D((-." F!DF F Fs "AAcx|jj}|j|j|yr()rrrrr&s r"load_binpersidz_Unpickler.load_binpersids)jjnn D((-.r!c&|jdyr(rrys r" load_nonez_Unpickler.load_none Dr!c&|jdy)NFrrys r" load_falsez_Unpickler.load_falses Er!c&|jdy)NTrrys r" load_truez_Unpickler.load_truerr!c|j}|tddk(rd}n|tddk(rd}n t|d}|j |y)NrFTr)rrFrErr)r+rvals r"load_intz_Unpickler.load_intsJ}} 59 C T!"X CdA,C Cr!c^|jtd|jddy)NrKrrrr rrys r" load_binintz_Unpickler.load_binint" F41.q12r!cJ|j|jddyr)rrrys r" load_binint1z_Unpickler.load_binint1s DIIaLO$r!c^|jtd|jddy)NrJrrrrys r" load_binint2z_Unpickler.load_binint2rr!c~|jdd}|r |ddk(r|dd}|jt|dy)NrLr)rrr)r+rs r" load_longz_Unpickler.load_longs?mmocr" 3r7g%cr(C CQK r!c|jdd}|j|}|jt|yr)rrrrs r" load_long1z_Unpickler.load_long1 s1 IIaLOyy| K%&r!ctd|jd\}|dkr td|j|}|jt |y)NrKrrz#LONG pickle has negative byte count)r rrrrrs r" load_long4z_Unpickler.load_long4sI D$))A, ' q5!"GH Hyy| K%&r!cZ|jt|jddyNr)rrrrys r" load_floatz_Unpickler.load_floats  E$--/#2./0r!c^|jtd|jddy)NrVrrrrys r" load_binfloatz_Unpickler.load_binfloatrr!cp|jdk(r|S|j|j|jS)Nr])rrrr*s r"_decode_stringz_Unpickler._decode_string"s. ==G #L<< t{{; ;r!c|jdd}t|dk\r|d|dk(r |ddvr|dd}n td|j|j t j |dy)Nrrrs"'rz)the STRING opcode argument must be quoted)rrrrr r^ escape_decoders r" load_stringz_Unpickler.load_string+sw}}s# t9>d1gb1d1g6G":D!"MN N D''(<(MdDIIaL) =!#029#:; ; DIIcN#r!c\|jt|jdddy)Nrr{)rrrrys r" load_unicodez_Unpickler.load_unicodeFs# C ,.BCDr!ctd|jd\}|tkDrtdtz|j t |j|ddy)Nrrz4BINUNICODE exceeds system's maximum size of %d bytesrtrur rr rrrrs r"load_binunicodez_Unpickler.load_binunicodeJVdDIIaL) =!#029#:; ; C #ABr!ctd|jd\}|tkDrtdtz|j t |j|ddy)Nrrz5BINUNICODE8 exceeds system's maximum size of %d bytesrtrurrs r"load_binunicode8z_Unpickler.load_binunicode8Rrr!ctd|jd\}|tkDrtdtz|j |j|y)Nrrz3BINBYTES8 exceeds system's maximum size of %d bytesrrs r"load_binbytes8z_Unpickler.load_binbytes8Zrr!ctd|jd\}|tkDrtdtzt |}|j ||j |y)Nrrz4BYTEARRAY8 exceeds system's maximum size of %d bytes)r rr rrerr)r+rbs r"load_bytearray8z_Unpickler.load_bytearray8bsYdDIIaL) =!#029#:; ; cN a Ar!c|j td t|j}|j |y#t$r tdwxYw)NzLpickle stream refers to out-of-band data but no *buffers* argument was givenznot enough out-of-band buffers)rrnext StopIterationr)r+rs r"load_next_bufferz_Unpickler.load_next_bufferlsb == !#HI I Dt}}%C C D!"BC C Ds AAc|jd}t|5}|js|j|jd<dddy#1swYyxYwr)r memoryviewrl toreadonly)r+rrps r"load_readonly_bufferz_Unpickler.load_readonly_bufferwsGjjn _ 0::!" 2 0 0 0s *AAc|jdd}|j|}|j|j|yr)rrr rs r"load_short_binstringz_Unpickler.load_short_binstring~s7iil1oyy~ D''-.r!cl|jdd}|j|j|yr)rrrs r"load_short_binbytesz_Unpickler.load_short_binbytess'iil1o DIIcN#r!c|jdd}|jt|j|ddy)Nrrrtru)rrrrs r"load_short_binunicodez _Unpickler.load_short_binunicodes0iil1o C #ABr!cX|j}|jt|yr()rrrrs r" load_tuplez_Unpickler.load_tuples  E%L!r!c&|jdy)Nr rrys r"load_empty_tuplez_Unpickler.load_empty_tuple  Br!c>|jdf|jd<yrrrys r" load_tuple1z_Unpickler.load_tuple1s**R.* 2r!c\|jd|jdfg|jddy)Nrrr7rys r" load_tuple2z_Unpickler.load_tuple2s) JJrNDJJrN;< 23r!cx|jd|jd|jdfg|jddy)Nrrr7rys r" load_tuple3z_Unpickler.load_tuple3s3 JJrNDJJrNDJJrNKL 23r!c&|jgyr(rrys r"load_empty_listz_Unpickler.load_empty_listr5r!c&|jiyr(rrys r"load_empty_dictionaryz _Unpickler.load_empty_dictionaryr5r!c6|jtyr()rrrys r"load_empty_setz_Unpickler.load_empty_sets CEr!cX|j}|jt|yr()rrrrs r"load_frozensetz_Unpickler.load_frozensets  Ie$%r!cF|j}|j|yr()rrrs r" load_listz_Unpickler.load_lists  Er!c|j}tdt|dDcic]}||||dz}}|j|ycc}w)Nrrr)rrangerr)r+rrds r" load_dictz_Unpickler.load_dictsX As5z1- /1XuQqSz ! / / A /sAc |st|tr t|dr ||}n|j|}|j|y#t$r4}td|jdt ||j d}~wwxYw)N__getinitargs__zin constructor for z: ) rrrrrr __traceback__r+r)r+klassr7r)errs r" _instantiatez_Unpickler._instantiates  5$/ E, - Ot  MM%(E E  O!&S!;r7r=rs r"load_newobj_exz_Unpickler.load_newobj_exsX!zz~~jjnnckk#/// Cr!c|jddjd}|jddjd}|j||}|j|y)Nrrt)rrrSrrTs r" load_globalz_Unpickler.load_globalsX"%,,W5}}s#**73- Er!c|jj}|jj}t|tust|tur t d|j |j ||y)NzSTACK_GLOBAL requires str)rrrrrrrS)r+rrs r"load_stack_globalz_Unpickler.load_stack_globals\zz~~! :S DL$;!"=> > DOOFD12r!cN|jdd}|j|yr)r get_extensionr+rs r" load_ext1z_Unpickler.load_ext1s!yy|A 4 r!c`td|jd\}|j|y)NrJrr rrcrds r" load_ext2z_Unpickler.load_ext2&tTYYq\* 4 r!c`td|jd\}|j|y)NrKrrgrds r" load_ext4z_Unpickler.load_ext4rir!cg}tj||}||ur|j|ytj|}|s|dkr t dt d|z|j |}|t|<|j|y)NrzEXT specifies code <= 0zunregistered extension code %d)rrrrrrrS)r+rnilrrs r"rcz_Unpickler.get_extension s""4- c> KK   $$T*qy%&?@@=DE Edoos#!$ Cr!ctjd|||jdkr^|jrR||ftj vrtj ||f\}}n%|tj vrtj |}t|d|jdk\r ttj||dSttj||S)Nzpickle.find_classrrrr) rauditrrr NAME_MAPPINGIMPORT_MAPPINGrrrr)r+rrs r"rSz_Unpickler.find_classs %vt4 ::>d..~!J >888'66v>6# ::? V!4d;A> >3;;v.5 5r!cV|j}|j}|d}|||d<yrrr)r+rr7r6s r" load_reducez_Unpickler.load_reduce*s, yy{Ry$Kb r!cX|jr|jd=y|jyr)rrrys r"load_popz_Unpickler.load_pop1s :: 2 MMOr!c$|jyr()rrys r" load_pop_markz_Unpickler.load_pop_mark8s  r!c@|j|jdyr)rrrys r"load_dupz_Unpickler.load_dup<s DJJrN#r!ct|jdd} |j|j|y#t$rd|}t |dwxYw)NrMemo value not found at index )rrrrrr)r+rmsgs r"load_getz_Unpickler.load_get@sZ  $ % 1 KK ! % 121#6C!#&D 0 1s =Ac|jdd} |j|j|y#t$r}d|}t |dd}~wwxYw)Nrrr|)rrrrrr+rexcr}s r" load_bingetz_Unpickler.load_bingetIsU IIaLO 1 KK ! % 121#6C!#&D 0 1s5 AAActd|jd\} |j|j|y#t$r}d|}t |dd}~wwxYw)Nrrr|)r rrrrrrs r"load_long_bingetz_Unpickler.load_long_bingetRsZ D$))A, ' 1 KK ! % 121#6C!#&D 0 1s> AAAct|jdd}|dkr td|jd|j|<y)Nrrznegative PUT argument)rrrrrrs r"load_putz_Unpickler.load_put[sA  $ % q545 5zz"~ ! r!c|jdd}|dkr td|jd|j|<y)Nrrznegative BINPUT argumentr)rrrrrs r" load_binputz_Unpickler.load_binputbs; IIaLO q578 8zz"~ ! r!ctd|jd\}|tkDr td|jd|j |<y)Nrrznegative LONG_BINPUT argumentr)r rr rrrrs r"load_long_binputz_Unpickler.load_long_binputis@ D$))A, ' w;<= =zz"~ ! r!cR|j}|jd|t|<yr)rrr)r+rs r" load_memoizez_Unpickler.load_memoizeps yy**R.SYr!ch|j}|j}|d}|j|yr)rrr)r+rr)rs r" load_appendz_Unpickler.load_appendus+  Ry Er!c|j}|jd} |j}||y#t$rYnwxYw|j}|D] }|| yr)rrextendrr)r+rlist_objrrrs r" load_appendsz_Unpickler.load_appends|si ::b> __F 5M      D 4L s 6 AAcp|j}|j}|j}|d}|||<yrrs)r+rr)rrs r" load_setitemz_Unpickler.load_setitems3  iikRyS r!c|j}|jd}tdt|dD]}||dz|||<y)Nrrrr)rrrIr)r+rrrs r" load_setitemsz_Unpickler.load_setitemssK zz"~q#e*a( *A"1q5\DqN *r!c|j}|jd}t|tr|j |y|j }|D] }|| yr)rrrrupdateadd)r+rset_objrrs r" load_additemsz_Unpickler.load_additemssO **R. gs # NN5 !++C D  r!c|j}|j}|d}t|dd}| ||yd}t|trt |dk(r|\}}|rV|j }tj}|jD]'\}} t|tur | |||<#| ||<)|r&|jD]\}} t||| yy)Nr __setstate__r) rrrrrr__dict__rinternrrrsetattr) r+rr8instsetstate slotstate inst_dictrrrs r" load_buildz_Unpickler.load_builds  Ry46   UO  eU #E a$ E9  IZZF  %17c>+,IfQi(#$IaL  % !) $1a# $ r!c|jj|jg|_|jj|_yr()rrrrys r" load_markz_Unpickler.load_marks0 djj) jj'' r!cL|jj}t|r()rrr&r*s r" load_stopz_Unpickler.load_stops  Elr!)rrrr,rrrrrrrrrr$rr#rr@rrDrrCrrQrrNrrLrrMrrRrrOrrPrrXrrWr r STRINGr BINSTRINGrrarrrr~rr}rr`r"rfr&rnr*ror,SHORT_BINSTRINGr.r_r0r|r2rr4rr8TUPLE1r:r5r=TUPLE3r?rrArrCrrErrGrrKrrQrUINSTrXOBJr[r0r]r.r_rrarrerrhrrkrrcrSrtr/rvr1rxrrzDUPr~rrrrrrrrrrrrrrrrrrrrrrrrr4rrrrr r!r"rris,0!(D.'`"> GH $HU1X. $HU1X/&HVAY/,HYq\!HT!W&HXa[$HWQZ HSV3%HVAY%'HWQZ3'HWQZ! "HT!W'$HU1X'$HU1X1#HU1X3)HXa[<H&HVAY/,HYq\$ *HXa[E'HWQZC .HZ]C 0H[^$ ,HYq\.HZ] 0H[^0 $8H_Q  /$8H_Q  $#6H^A C%:H a !"$HU1X/H[^+%HVAY=%HVAYM%HVAY-HZ]3HZ]+HYq\&,HYq\"HT!W "HT!W 2 "HT!W%  HSV &HVAY ,HYq\ &HVAY3 !2H\!_!"HT!W!"HT!W!"HT!W 6 &HVAY  HSV)HXa[$HSV1 HSV1&HVAY1 0H[^&  HSV& &HVAY& 0H[^)(HWQZ &HVAY (HWQZ (HWQZ* *HXa[*HXa[$,$HU1X("HT!W"HT!Wr!rrc@t||||j|yNr)rr)rrrrrs r"_dumprs T8,..2d3ir!ctj}t||||j||j }t |t sJ|Sr)rwrxrrgetvaluerr)rrrrrress r"_dumpsrsG A Qk,..2d3i **,C c; '' ' Jr!rrrc>t|||||jS)Nrrrr)rr)rrrrrs r"_loadrs! d W&v 77;tv>r!ct|tr tdtj|}t |||||j S)Nz%Can't load pickle from unicode stringr)rrrrwrxrr)srrrrrs r"_loadsrsD!S?@@ ::a=D d W' 88<?r!c*ddl}|jSrW)doctesttestmod)rs r"_testrs ?? r!rz$display contents of the pickle files) description pickle_file*zthe pickle file)nargshelpz-tz--test store_truezrun self-test suite)actionrz-vz)run verbosely; only affects self-test run-rbr()rtypesrcopyregrrrr itertoolsr functoolsr rr structr r rerwr^r__all___picklerrrrr]rerformat_versioncompatible_formatsrr Exceptionr rrr&rrr1rrrXrQrNrLrRrMr@r$r#r/rrrrr~rr4rrrrrrrrrrrrrrrrrrrWrErFrr0rrrrr5rrCrDrOrPrrar_r|r}r`rrrr.rrrrfrnrordirmatchrrrrrrrrrrrrrrrrrrrrrargparseArgumentParserparser add_argument parse_argsr7testr print_helppprintfnstdinbufferropenr)rs0r"rs[2"MM   : $ NN>" i   )  K   k  I        7        35DaHBHH-?$CDE<<~6D6Dv &<A.S S p` "` "J848dD $gh> !%wx?<     z $X $ $: