Ńň §ÚęLc@s9ddddgZddkTddkZeei7ZddklZlZddklZdd kl Z ddk Z dd k lZdd klZydd klZWn#ej odd klZnXdefd „ƒYZed„Zedjo5ddklZlZeddeƒZ e ddddƒZ!e!eee!ƒƒjpt"‚deddƒfd„ƒYZ x/e ddƒe dddƒfD] Z!e!GHqŸWdeddƒfd„ƒYZ e dd ƒi#dd!ƒGHed"e i$d&ƒZ%e%i&GHddk'Z'ed$d%ƒZ(e(e'i)ƒŒGHndS('tdequet defaultdictt namedtuplet OrderedDicti˙˙˙˙(t*N(RR(t itemgetter(t iskeyword(timap(teq(t get_identcBseZdZd„Zeid„Zeid„Zd„Zd„Zd„Z d„Z d„Z d „Z d „Z d „Zd „ZeiZeZeƒZed „Zdd„Zed„Zhd„Zd„Zd„Zedd„ƒZd„Zd„Z d„Z!d„Z"d„Z#RS(s)Dictionary that remembers insertion ordercOsˆt|ƒdjotdt|ƒƒ‚ny |iWn9tj o-g|_}||dg|(h|_nX|i||ŽdS(sĹInitialize an ordered dictionary. The signature is the same as regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. is$expected at most 1 arguments, got %dN(tlent TypeErrort_OrderedDict__roottAttributeErrortNonet_OrderedDict__mapt_OrderedDict__update(tselftargstkwdstroot((s#/usr/lib64/python2.6/collections.pyt__init__s  cCsZ||jo=|i}|d}|||g|d<|d<|i| od[i]=yii(R R(Rtkeytvaluet dict_setitemRtlast((s#/usr/lib64/python2.6/collections.pyt __setitem__/s    *cCs@|||ƒ|ii|ƒ\}}}||d<||d del od[y]iiN(Rtpop(RRt dict_delitemt link_prevt link_nextt_((s#/usr/lib64/python2.6/collections.pyt __delitem__9s  ccs?|i}|d}x%||j o|dV|d}qWdS(sod.__iter__() <==> iter(od)iiN(R (RRtcurr((s#/usr/lib64/python2.6/collections.pyt__iter__Bs     ccs?|i}|d}x%||j o|dV|d}qWdS(s#od.__reversed__() <==> reversed(od)iiN(R (RRR!((s#/usr/lib64/python2.6/collections.pyt __reversed__Ks     cCs7|i}||dg|(|iiƒti|ƒdS(s.od.clear() -> None. Remove all items from od.N(R RRtcleartdict(RR((s#/usr/lib64/python2.6/collections.pyR$Ts  cCs t|ƒS(sod.keys() -> list of keys in od(tlist(R((s#/usr/lib64/python2.6/collections.pytkeys]scCs#g}|D]}|||q ~S(s#od.values() -> list of values in od((Rt_[1]R((s#/usr/lib64/python2.6/collections.pytvaluesascCs)g}|D]}||||fq ~S(s.od.items() -> list of (key, value) pairs in od((RR(R((s#/usr/lib64/python2.6/collections.pytitemsescCs t|ƒS(s0od.iterkeys() -> an iterator over the keys in od(titer(R((s#/usr/lib64/python2.6/collections.pytiterkeysisccsx|D]}||VqWdS(s2od.itervalues -> an iterator over the values in odN((Rtk((s#/usr/lib64/python2.6/collections.pyt itervaluesmsccs$x|D]}|||fVqWdS(s=od.iteritems -> an iterator over the (key, value) pairs in odN((RR-((s#/usr/lib64/python2.6/collections.pyt iteritemsrscCsG||jo||}||=|S||ijot|ƒ‚n|S(s˛od.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. (t_OrderedDict__markertKeyError(RRtdefaulttresult((s#/usr/lib64/python2.6/collections.pyR}s  cCs$||jo ||S|||<|S(sDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od((RRR2((s#/usr/lib64/python2.6/collections.pyt setdefault‹s   cCsV|ptdƒ‚nt|o t|ƒn t|ƒƒ}|i|ƒ}||fS(s™od.popitem() -> (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. sdictionary is empty(R1tnexttreversedR+R(RRRR((s#/usr/lib64/python2.6/collections.pytpopitem’s &cCswt|ƒtƒf}||jodSd|| repr(od)s...is%s()s%s(%r)N(tidt _get_identt __class__t__name__R*(Rt _repr_runningtcall_key((s#/usr/lib64/python2.6/collections.pyt__repr__s  cCs’g}|D]}||||gq ~}t|ƒiƒ}x'ttƒƒD]}|i|dƒqMW|o|i|f|fS|i|ffS(s%Return state information for picklingN(tvarstcopyRRRR:(RR(R-R*t inst_dict((s#/usr/lib64/python2.6/collections.pyt __reduce__Şs+cCs |i|ƒS(s!od.copy() -> a shallow copy of od(R:(R((s#/usr/lib64/python2.6/collections.pyR@´scCs(|ƒ}x|D]}||| New ordered dictionary with keys from S. If not specified, the value defaults to None. ((tclstiterableRRR((s#/usr/lib64/python2.6/collections.pytfromkeys¸s  cCsJt|tƒo*ti||ƒottt||ƒƒSti||ƒS(s“od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. (t isinstanceRR%t__eq__tallt_imapt_eq(Rtother((s#/usr/lib64/python2.6/collections.pyRGĂs*cCs ||j S(sod.__ne__(y) <==> od!=y((RRK((s#/usr/lib64/python2.6/collections.pyt__ne__ĚscCs t|ƒS(s@od.viewkeys() -> a set-like object providing a view on od's keys(tKeysView(R((s#/usr/lib64/python2.6/collections.pytviewkeysŇscCs t|ƒS(s<od.viewvalues() -> an object providing a view on od's values(t ValuesView(R((s#/usr/lib64/python2.6/collections.pyt viewvaluesÖscCs t|ƒS(sBod.viewitems() -> a set-like object providing a view on od's items(t ItemsView(R((s#/usr/lib64/python2.6/collections.pyt viewitemsÚsN($R;t __module__t__doc__RR%RR R"R#R$R'R)R*R,R.R/tMutableMappingtupdateRtobjectR0RRR4tTrueR7R>RBR@t classmethodRERGRLRNRPRR(((s#/usr/lib64/python2.6/collections.pyRs:                cBsŠe|eƒo|iddƒiƒ}neee|ƒƒ}x†|f|D]w}ed„|Dƒƒped|ƒ‚ne |ƒoed|ƒ‚n|di ƒoed|ƒ‚qOqOWe ƒ}x`|D]X}|i dƒoed |ƒ‚n||joed |ƒ‚n|i |ƒqÚWe|ƒ}e|ƒid d ƒd d!}did„|Dƒƒ}did„e|ƒDƒƒ}deƒ} x.e|ƒD] \} }| d|| f7} qłW|o | GHnededd|dedeƒ} y | | UWn,ej o } e| id| ƒ‚nX| |} eedƒo%eid ƒiiddƒ| _n| S(s>Returns a new subclass of tuple with named fields. >>> Point = namedtuple('Point', 'x y') >>> Point.__doc__ # docstring for the new class 'Point(x, y)' >>> p = Point(11, y=22) # instantiate with positional args or keywords >>> p[0] + p[1] # indexable like a plain tuple 33 >>> x, y = p # unpack like a regular tuple >>> x, y (11, 22) >>> p.x + p.y # fields also accessable by name 33 >>> d = p._asdict() # convert to a dictionary >>> d['x'] 11 >>> Point(**d) # convert from a dictionary Point(x=11, y=22) >>> p._replace(x=100) # _replace() is like str.replace() but targets named fields Point(x=100, y=22) t,t css,x%|]}|iƒp |djVqWdS(RN(tisalnum(t.0tc((s#/usr/lib64/python2.6/collections.pys ýs sWType names and field names can only contain alphanumeric characters and underscores: %rs2Type names and field names cannot be a keyword: %ris9Type names and field names cannot start with a number: %rRs/Field names cannot start with an underscore: %rs$Encountered duplicate field name: %rt'tii˙˙˙˙s, cssx|]}d|VqWdS(s%s=%%rN((R]tname((s#/usr/lib64/python2.6/collections.pys s css)x"|]\}}d||fVqWdS(s %r: t[%d]N((R]tposRa((s#/usr/lib64/python2.6/collections.pys s sŞclass %(typename)s(tuple): '%(typename)s(%(argtxt)s)' __slots__ = () _fields = %(field_names)r def __new__(_cls, %(argtxt)s): return _tuple.__new__(_cls, (%(argtxt)s)) @classmethod def _make(cls, iterable, new=tuple.__new__, len=len): 'Make a new %(typename)s object from a sequence or iterable' result = new(cls, iterable) if len(result) != %(numfields)d: raise TypeError('Expected %(numfields)d arguments, got %%d' %% len(result)) return result def __repr__(self): return '%(typename)s(%(reprtxt)s)' %% self def _asdict(t): 'Return a new dict which maps field names to their values' return {%(dicttxt)s} def _replace(_self, **kwds): 'Return a new %(typename)s object replacing specified fields with new values' result = _self._make(map(kwds.pop, %(field_names)r, _self)) if kwds: raise ValueError('Got unexpected field names: %%r' %% kwds.keys()) return result def __getnewargs__(self): return tuple(self) s( %s = _property(_itemgetter(%d)) t _itemgetterR;s namedtuple_%st _propertyt_tuples: t _getframet__main__(RFt basestringtreplacetsplitttupletmaptstrRHt ValueErrort _iskeywordtisdigittsett startswithtaddR treprtjoint enumeratetlocalsR%Rctpropertyt SyntaxErrortmessagethasattrt_sysRft f_globalstgetRS(ttypenamet field_namestverboseRat seen_namest numfieldstargtxttreprtxttdicttxtttemplatetit namespaceteR3((s#/usr/lib64/python2.6/collections.pyRßsN         %Rg(tloadstdumpstPointsx, ytxi tyisx ycBs&eZdZed„ƒZd„ZRS(cCs|id|iddS(Nigŕ?(RŽR(R((s#/usr/lib64/python2.6/collections.pythypotPscCsd|i|i|ifS(Ns$Point: x=%6.3f y=%6.3f hypot=%6.3f(RŽRR(R((s#/usr/lib64/python2.6/collections.pyt__str__Ss((R;RSt __slots__RxRR‘(((s#/usr/lib64/python2.6/collections.pyRNsiiiig@cBs/eZdZdZeeiƒZed„Z RS(sHPoint class with optimized _make() and _replace() without error-checkingcKs|i||id|ƒƒS(NRŽR(RŽR(t_makeR~(Rt_mapR((s#/usr/lib64/python2.6/collections.pyt_replace]s(( R;RSRTR’RYRkt__new__R“RlR•(((s#/usr/lib64/python2.6/collections.pyRYsi iidtPoint3Dtzt TestResultssfailed attempted(R˜(*t__all__t_abcollt _collectionsRRtoperatorRRctkeywordRRotsysR|t itertoolsRRIRRJtthreadR R9t ImportErrort dummy_threadR%RtFalseRR;tcPickleR‹RŒRXRtptAssertionErrorR•t_fieldsR—RTtdoctestR™ttestmod(((s#/usr/lib64/python2.6/collections.pyts>    Ě g  #