m %UIc @sdZdZdkTdklZdklZlZlZdkZdk Z dk Z dk Z dk Z dddd d d d d dg Z dZdddddgZdZeiZdefdYZdefdYZdefdYZdefdYZydklZWnej o eZnXyeWnej o eZnXdZdZdZ dZ!dZ"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,Z/d-Z0d.Z1d/Z2d0Z3d1Z4d2Z5d3Z6d4Z7d5Z8d6Z9d7Z:d8Z;d9Z<d:Z=d;Z>d<Z?d=Z@d>ZAd?ZBd@ZCdAZDdBZEdCZFdDZGdEZHdFZIdGZJdHZKdIZLdJZMdKZNdLZOdMZPdNZQdOZRdPZSdQZTeDeNeOePgZUe iVgZWeXD]$ZYe iZdReYo eWeYnq[W[Yd fdSYZ[dTZ\hZ]dUZ^d fdVYZ_dWfdXYZ`dkaZbdYZcdZZdyd[kelfZfWn ej od[kflfZfnXeed\Zgeed]Zhd^Zid_Zd`Zjekdajo ejndS(bsCreate portable serialized representations of Python objects. See module cPickle for a (much) faster implementation. See module copy_reg 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 s$Revision: 36861 $(t*(sdispatch_table(s_extension_registrys_inverted_registrys_extension_cacheNt PickleErrort PicklingErrortUnpicklingErrortPicklert Unpicklertdumptdumpstloadtloadss2.0s1.0s1.1s1.2s1.3icBstZdZRS(s6A common base class for the other pickling exceptions.(t__name__t __module__t__doc__(((t#/data/zmath/lib/python2.4/pickle.pyR;s cBstZdZRS(s]This exception is raised when an unpicklable object is passed to the dump() method. (R R R (((R R?s cBstZdZRS(sThis 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. (R R R (((R RFs t_StopcBstZdZRS(NcCs ||_dS(N(tvaluetself(RR((R t__init__Ts(R R R(((R RSs(s PyStringMapt(t.t0t1t2tFtItJtKtLtMtNtPtQtRtStTtUtVtXtatbtctdt}tetgthtitjtlt]totptqtrtsttt)tutGsI01 sI00 sssssssssssss[A-Z][A-Z0-9_]+$cBstZdddZdZdZdZeidZ eidZ dZ dZ d Z ddddd ZhZd Zeeet|d|Sntt|dS(Nist|d|Sntt|dS(Nis      )            cCs|itdS(N(RRDtNONE(RRN((R t save_nonescCsN|idjo|i|otptn|i|otptdS(Ni(RRGRDRNtNEWTRUEtNEWFALSEtTRUEtFALSE(RRN((R t save_boolscCs|io|djog|djo|itt|dSn|djo*|idt|d@|d?fdSq~n|d?}|djp |djo"|it|d|dSqn|it t |d dS( Niiis%c%c%ciiisds (RR=RDtBINFLOATRXRNtFLOATRZ(RRNRX((R t save_floats cCs|ioZt|}|djo|itt||q|it|d||n|it t |d|i |dS(NisNcCs%|i|_|i|_h|_dS(sThis takes a file-like object for reading a pickle data stream. The protocol version of the pickle is detected automatically, so no proto argument is needed. 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 a string. Thus file-like object can be a file object opened for reading, a StringIO object, or any other custom object that meets this interface. N(RCtreadlineRtreadRE(RRC((R RKs   cCst|_g|_|ii|_|i}|i}y&x|d}|||q<WWntj o}|i SnXdS(sRead a pickled object representation from the open file. Return the reconstituted object hierarchy specified in the file. iN( tobjectRtmarktstackRRRftkeyRtstopinstR(RRRfRR((R R[s     cCsI|i}|i}t|d}x |||j o|d}q%W|S(Ni(RRRRRR(RRRR((R tmarkerts  cCs tdS(N(tEOFError(R((R tload_eof}sRwcCsHt|id}d|jo djnptd|ndS(Niiisunsupported pickle protocol: %d(tordRRRGR>(RRG((R t load_protoscCs*|id }|i|i|dS(Ni(RRRbRtpersistent_load(RRb((R t load_persidscCs)|ii}|i|i|dS(N(RRtpopRbRR(RRb((R tload_binpersidscCs|iddS(N(RRR<(R((R t load_nonescCs|itdS(N(RRtFalse(R((R t load_falsescCs|itdS(N(RRtTrue(R((R t load_truescCs|i}|tdjo t}nN|tdjo t}n3yt|}Wnt j ot |}nX|i |dS(Ni( RRtdataRRtvalRR RFR>tlongR(RR R ((R tload_ints   cCs$|itd|iddS(NR.i(RRtmloadsR(R((R t load_binintscCs |it|iddS(Ni(RRRR(R((R t load_binint1scCs(|itd|idddS(NR.it(RRRR(R((R t load_binint2scCs$|it|id ddS(Nii(RRR R(R((R t load_longscCs;t|id}|i|}|it|dS(Ni(RRRRRRt decode_long(RRR((R t load_long1scCs?td|id}|i|}|it|dS(NR.i(RRRRRRR(RRR((R t load_long4scCs!|it|id dS(Ni(RRtfloatR(R((R t load_floatscCs'|i|d|idddS(Ns>dii(RRtunpackR(RR((R t load_binfloatscCs|id }xcdD]R}|i|o<|i|p tdn|t|t| !}PqqWtd|i|i ddS(Nis"'sinsecure string pickles string-escape( RRtrepR4t startswithtendswithR>RRRtdecode(RR4R((R t load_strings   cCs3td|id}|i|i|dS(NR.i(RRRRRR(RRR((R tload_binstringscCs$|it|id ddS(Nisraw-unicode-escape(RRRR(R((R t load_unicodescCs<td|id}|it|i|ddS(NR.isutf-8(RRRRRRR(RRR((R tload_binunicodescCs/t|id}|i|i|dS(Ni(RRRRRR(RRR((R tload_short_binstringscCs1|i}t|i|dg|i|)dS(Ni(RRRttupleR(RR((R t load_tuples cCs|iifdS(N(RRR(R((R tload_empty_tuplescCs|idf|idR6(RRRNR?R((R R;cs   cCs*t|ti|}t||}|S(N(RRRRRRpRR(RRRRR((R R6ps  cCsf|i}|i}|d}|djo tidt|i }n ||}||dRR;R6RCRRDRRERRFtDUPRGR]RHR[RIR\RJRYRKRVRLRWRNRRPRRRRRSRRZRR[RR\RO(((R RIs                                                                                                           R1cBstZRS(N(R R (((R R1scCs9|djodSn|djot|}|idptd|id}t||}|d@od|d}qt |ddd jod |d}qnt| }|idptd|id}t||}|d@o|d7}n|d }|d |>7}|djptt|}d|id}t||}||jodd |||d}nt |ddd jod|d}n|ido|dd!}n |d}t|d@djpt||ft i |}|dddS(sEncode a long to a two's complement little-endian binary string. Note that 0L is a special case, returning an empty string, to save a byte in the LONG1 pickling context. >>> encode_long(0L) '' >>> encode_long(255L) '\xff\x00' >>> encode_long(32767L) '\xff\x7f' >>> encode_long(-256L) '\x00\xff' >>> encode_long(-32768L) '\x00\x80' >>> encode_long(-128L) '\x80' >>> encode_long(127L) '\x7f' >>> iRwt0xiRit0x0iit0x00ilRt0xffiN(RdthextashexRRQRt njunkcharsRRtnibblesRFtnbitst newnibblest _binasciit unhexlifytbinary(RdRmRiRhRgRjRf((R RsD          'cCswt|}|djodSnti|ddd}t|d}|ddjo|d|d>8}n|S( s\Decode a long from a two's complement little-endian binary string. >>> decode_long('') 0L >>> decode_long("\xff\x00") 255L >>> decode_long("\xff\x7f") 32767L >>> decode_long("\x00\xff") -256L >>> decode_long("\x00\x80") -32768L >>> decode_long("\x80") -128L >>> decode_long("\x7f") 127L ilNiisli(RRR tnbytesRkthexlifyRfR R(R RRnRf((R RBs  (sStringIOcCst|||i|dS(N(RRCR;R=RRN(RNRCR;R=((R RescCs,t}t|||i||iS(N(tStringIORCRR;R=RRNtgetvalue(RNR;R=RC((R Rhs cCst|iS(N(RRCR(RC((R RmscCst|}t|iS(N(RpRvRCRR(RvRC((R R ps cCsdk}|iS(N(tdoctestttestmod(Rr((R t_testvs R(lR t __version__ttypestcopy_regRmRRAR@tmarshalRRtreR?t__all__tformat_versiontcompatible_formatsRBR Rt ExceptionRRRRtorg.python.coreRRR<Rt NameErrorRRORRR`RRRRRRRRuRtRRRRRRRRRRRRR]R[RR\RRRRYRVRWRRRRRRRRKRRRRR]R^R_RRRRRROt_[1]tdirRdtmatchRRRRRR1tbinasciiRkRRt cStringIORpRRRRtR (^RRRRRRRRRR1RRRRRRRdR RR{RR]R^R_RmRtRRzR]RVRRyRkRR[RKRRRRpRR@RRRuRRBRtRRORRRRRRRRRR\RRRRR`RRRRRRRYRRARRRRWRRRuRR?RRRRRRxRRRRR|((R t?s      !     Bm    B