ó zfc@s”dZddlmZmZddlZdddddd d d d d ddddddgZd„Zdd%d„ƒYZdd&d„ƒYZej e ƒdefd„ƒYZ dd'd„ƒYZ dd(d„ƒYZ d d)d„ƒYZd e ee fd„ƒYZej eƒd efd„ƒYZej eƒd e ee fd„ƒYZde fd„ƒYZdeefd„ƒYZej eijƒƒƒdeefd „ƒYZej eijƒƒƒdefd!„ƒYZej eijƒƒƒd efd"„ƒYZej eƒde ee fd#„ƒYZej eƒej e ƒej e!ƒej e"ƒdefd$„ƒYZ#e#j e$ƒdS(*sAbstract Base Classes (ABCs) for collections, according to PEP 3119. DON'T USE THIS MODULE DIRECTLY! The classes here should be imported via collections; they are defined here only to alleviate certain bootstrapping issues. Unit tests are in test_collections. iÿÿÿÿ(tABCMetatabstractmethodNtHashabletIterabletIteratortSizedt ContainertCallabletSett MutableSettMappingtMutableMappingt MappingViewtKeysViewt ItemsViewt ValuesViewtSequencetMutableSequencecsCy!t‡fd†|jDƒƒSWntk r>t|ˆƒSXdS(Nc3s|]}ˆ|jkVqdS(N(t__dict__(t.0tB(tattr(s/usr/lib64/python2.7/_abcoll.pys s(tanyt__mro__tAttributeErrorthasattr(tCR((Rs/usr/lib64/python2.7/_abcoll.pyt_hasattrs! cBs,eZeZed„ƒZed„ƒZRS(cCsdS(Ni((tself((s/usr/lib64/python2.7/_abcoll.pyt__hash__#scCsy|tkruy<x5|jD]*}d|jkr|jdr?tSPqqWWqutk rqt|ddƒrrtSquXntS(NR(RRRtTrueRtgetattrtNonetNotImplemented(tclsRR((s/usr/lib64/python2.7/_abcoll.pyt__subclasshook__'s     (t__name__t __module__Rt __metaclass__RRt classmethodR#(((s/usr/lib64/python2.7/_abcoll.pyR scBs,eZeZed„ƒZed„ƒZRS(ccsxtrdVqWdS(N(tFalseR (R((s/usr/lib64/python2.7/_abcoll.pyt__iter__:s cCs&|tkr"t|dƒr"tSntS(NR)(RRRR!(R"R((s/usr/lib64/python2.7/_abcoll.pyR#?s (R$R%RR&RR)R'R#(((s/usr/lib64/python2.7/_abcoll.pyR7scBs/eZed„ƒZd„Zed„ƒZRS(cCs t‚dS(sKReturn the next item from the iterator. When exhausted, raise StopIterationN(t StopIteration(R((s/usr/lib64/python2.7/_abcoll.pytnextKscCs|S(N((R((s/usr/lib64/python2.7/_abcoll.pyR)PscCs5|tkr1t|dƒr1t|dƒr1tSntS(NR+R)(RRRR!(R"R((s/usr/lib64/python2.7/_abcoll.pyR#Ss (R$R%RR+R)R'R#(((s/usr/lib64/python2.7/_abcoll.pyRIs cBs,eZeZed„ƒZed„ƒZRS(cCsdS(Ni((R((s/usr/lib64/python2.7/_abcoll.pyt__len__^scCs&|tkr"t|dƒr"tSntS(NR,(RRRR!(R"R((s/usr/lib64/python2.7/_abcoll.pyR#bs (R$R%RR&RR,R'R#(((s/usr/lib64/python2.7/_abcoll.pyR[scBs,eZeZed„ƒZed„ƒZRS(cCstS(N(R((Rtx((s/usr/lib64/python2.7/_abcoll.pyt __contains__mscCs&|tkr"t|dƒr"tSntS(NR.(RRRR!(R"R((s/usr/lib64/python2.7/_abcoll.pyR#qs (R$R%RR&RR.R'R#(((s/usr/lib64/python2.7/_abcoll.pyRjscBs,eZeZed„ƒZed„ƒZRS(cOstS(N(R((Rtargstkwds((s/usr/lib64/python2.7/_abcoll.pyt__call__|scCs&|tkr"t|dƒr"tSntS(NR1(RRRR!(R"R((s/usr/lib64/python2.7/_abcoll.pyR#€s (R$R%RR&RR1R'R#(((s/usr/lib64/python2.7/_abcoll.pyRyscBsªeZdZd„Zd„Zd„Zd„Zd„Zd„Ze d„ƒZ d„Z e Z d „Z d „ZeZd „Zd „Zd „ZeZdZd„ZRS(sZA set is a finite, iterable container. This class provides concrete generic implementations of all methods except for __contains__, __iter__ and __len__. To override the comparisons (presumably for speed, as the semantics are fixed), redefine __le__ and __ge__, then the other operations will automatically follow suit. cCsTt|tƒstSt|ƒt|ƒkr/tSx|D]}||kr6tSq6WtS(N(t isinstanceRR!tlenR(R(Rtothertelem((s/usr/lib64/python2.7/_abcoll.pyt__le__–s  cCs8t|tƒstSt|ƒt|ƒko7|j|ƒS(N(R2RR!R3R6(RR4((s/usr/lib64/python2.7/_abcoll.pyt__lt__ scCs8t|tƒstSt|ƒt|ƒko7|j|ƒS(N(R2RR!R3t__ge__(RR4((s/usr/lib64/python2.7/_abcoll.pyt__gt__¥scCsTt|tƒstSt|ƒt|ƒkr/tSx|D]}||kr6tSq6WtS(N(R2RR!R3R(R(RR4R5((s/usr/lib64/python2.7/_abcoll.pyR8ªs  cCs8t|tƒstSt|ƒt|ƒko7|j|ƒS(N(R2RR!R3R6(RR4((s/usr/lib64/python2.7/_abcoll.pyt__eq__´scCs ||k S(N((RR4((s/usr/lib64/python2.7/_abcoll.pyt__ne__¹scCs ||ƒS(s¼Construct an instance of the class from any iterable input. Must override this method if the class constructor signature does not accept an iterable for an input. ((R"tit((s/usr/lib64/python2.7/_abcoll.pyt_from_iterable¼scs0t|tƒstSˆj‡fd†|DƒƒS(Nc3s!|]}|ˆkr|VqdS(N((Rtvalue(R(s/usr/lib64/python2.7/_abcoll.pys Ès(R2RR!R=(RR4((Rs/usr/lib64/python2.7/_abcoll.pyt__and__ÅscCs%x|D]}||krtSqWtS(s1Return True if two sets have a null intersection.(R(R(RR4R>((s/usr/lib64/python2.7/_abcoll.pyt isdisjointÌs  cCs6t|tƒstSd„||fDƒ}|j|ƒS(Ncss"|]}|D] }|Vq qdS(N((Rtste((s/usr/lib64/python2.7/_abcoll.pys Ös(R2RR!R=(RR4tchain((s/usr/lib64/python2.7/_abcoll.pyt__or__ÓscsQtˆtƒs4tˆtƒs"tS|jˆƒ‰n|j‡fd†|DƒƒS(Nc3s!|]}|ˆkr|VqdS(N((RR>(R4(s/usr/lib64/python2.7/_abcoll.pys às(R2RRR!R=(RR4((R4s/usr/lib64/python2.7/_abcoll.pyt__sub__Ûs csQt|tƒs4t|tƒs"tSˆj|ƒ}nˆj‡fd†|DƒƒS(Nc3s!|]}|ˆkr|VqdS(N((RR>(R(s/usr/lib64/python2.7/_abcoll.pys ès(R2RRR!R=(RR4((Rs/usr/lib64/python2.7/_abcoll.pyt__rsub__ãs cCsDt|tƒs4t|tƒs"tS|j|ƒ}n||||BS(N(R2RRR!R=(RR4((s/usr/lib64/python2.7/_abcoll.pyt__xor__ës cCsÊtj}d|d}t|ƒ}d|d}||M}x>|D]6}t|ƒ}|||d>AdAdN}||M}qBW|dd}||M}||kr±||d8}n|d krÆd }n|S( s+Compute the hash value of a set. Note that we don't define __hash__: not all sets are hashable. But if you define a hashable set type, its __hash__ should call this function. This must be compatible __eq__. All sets ought to compare equal if they contain the same elements, regardless of how they are implemented, and regardless of the order of the elements; so there's not much freedom for __eq__ or __hash__. We match the algorithm used by the built-in frozenset type. iiiMïèrii³M[I×4?ÙiÍ iãÃ6iÿÿÿÿiÁÇ8#(tsystmaxintR3thash(RtMAXtMASKtnthR-thx((s/usr/lib64/python2.7/_abcoll.pyt_hash÷s          N(R$R%t__doc__R6R7R9R8R:R;R'R=R?t__rand__R@RDt__ror__RERFRGt__rxor__R RRP(((s/usr/lib64/python2.7/_abcoll.pyR‹s&           cBskeZdZed„ƒZed„ƒZd„Zd„Zd„Zd„Z d„Z d„Z d „Z RS( s‡A mutable set is a finite, iterable container. This class provides concrete generic implementations of all methods except for __contains__, __iter__, __len__, add(), and discard(). To override the comparisons (presumably for speed, as the semantics are fixed), all you have to do is redefine __le__ and then the other operations will automatically follow suit. cCs t‚dS(sAdd an element.N(tNotImplementedError(RR>((s/usr/lib64/python2.7/_abcoll.pytadd&scCs t‚dS(s8Remove an element. Do not raise an exception if absent.N(RU(RR>((s/usr/lib64/python2.7/_abcoll.pytdiscard+scCs,||krt|ƒ‚n|j|ƒdS(s5Remove an element. If not a member, raise a KeyError.N(tKeyErrorRW(RR>((s/usr/lib64/python2.7/_abcoll.pytremove0s cCsGt|ƒ}yt|ƒ}Wntk r5t‚nX|j|ƒ|S(s2Return the popped value. Raise KeyError if empty.(titerR+R*RXRW(RR<R>((s/usr/lib64/python2.7/_abcoll.pytpop6s    cCs3yxtr|jƒqWWntk r.nXdS(s6This is slow (creates N new iterators!) but effective.N(RR[RX(R((s/usr/lib64/python2.7/_abcoll.pytclear@s   cCs"x|D]}|j|ƒqW|S(N(RV(RR<R>((s/usr/lib64/python2.7/_abcoll.pyt__ior__Hs cCs&x||D]}|j|ƒq W|S(N(RW(RR<R>((s/usr/lib64/python2.7/_abcoll.pyt__iand__MscCsx||kr|jƒn[t|tƒs:|j|ƒ}nx7|D]/}||krc|j|ƒqA|j|ƒqAW|S(N(R\R2RR=RWRV(RR<R>((s/usr/lib64/python2.7/_abcoll.pyt__ixor__Rs    cCs;||kr|jƒnx|D]}|j|ƒq W|S(N(R\RW(RR<R>((s/usr/lib64/python2.7/_abcoll.pyt__isub___s    ( R$R%RQRRVRWRYR[R\R]R^R_R`(((s/usr/lib64/python2.7/_abcoll.pyR s      cBs€eZdZed„ƒZd d„Zd„Zd„Zd„Z d„Z d„Z d„Z d „Z d Zd „Zd „ZRS( sÇA Mapping is a generic container for associating key/value pairs. This class provides concrete generic implementations of all methods except for __getitem__, __iter__, and __len__. cCs t‚dS(N(RX(Rtkey((s/usr/lib64/python2.7/_abcoll.pyt __getitem__wscCs%y ||SWntk r |SXdS(s<D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.N(RX(RRatdefault((s/usr/lib64/python2.7/_abcoll.pytget{s  cCs)y ||Wntk r tSXtSdS(N(RXR(R(RRa((s/usr/lib64/python2.7/_abcoll.pyR.‚s   cCs t|ƒS(s.D.iterkeys() -> an iterator over the keys of D(RZ(R((s/usr/lib64/python2.7/_abcoll.pytiterkeysŠsccsx|D]}||VqWdS(s2D.itervalues() -> an iterator over the values of DN((RRa((s/usr/lib64/python2.7/_abcoll.pyt itervaluesŽs ccs$x|D]}|||fVqWdS(s=D.iteritems() -> an iterator over the (key, value) items of DN((RRa((s/usr/lib64/python2.7/_abcoll.pyt iteritems“s cCs t|ƒS(sD.keys() -> list of D's keys(tlist(R((s/usr/lib64/python2.7/_abcoll.pytkeys˜scCs!g|D]}|||f^qS(s8D.items() -> list of D's (key, value) pairs, as 2-tuples((RRa((s/usr/lib64/python2.7/_abcoll.pytitemsœscCsg|D]}||^qS(s D.values() -> list of D's values((RRa((s/usr/lib64/python2.7/_abcoll.pytvalues scCs5t|tƒstSt|jƒƒt|jƒƒkS(N(R2R R!tdictRj(RR4((s/usr/lib64/python2.7/_abcoll.pyR:§scCs ||k S(N((RR4((s/usr/lib64/python2.7/_abcoll.pyR;¬sN(R$R%RQRRbR RdR.ReRfRgRiRjRkRR:R;(((s/usr/lib64/python2.7/_abcoll.pyR ms         cBs#eZd„Zd„Zd„ZRS(cCs ||_dS(N(t_mapping(Rtmapping((s/usr/lib64/python2.7/_abcoll.pyt__init__±scCs t|jƒS(N(R3Rm(R((s/usr/lib64/python2.7/_abcoll.pyR,´scCs dj|ƒS(Ns&{0.__class__.__name__}({0._mapping!r})(tformat(R((s/usr/lib64/python2.7/_abcoll.pyt__repr__·s(R$R%RoR,Rq(((s/usr/lib64/python2.7/_abcoll.pyR ¯s  cBs)eZed„ƒZd„Zd„ZRS(cCs t|ƒS(N(tset(RR<((s/usr/lib64/python2.7/_abcoll.pyR=½scCs ||jkS(N(Rm(RRa((s/usr/lib64/python2.7/_abcoll.pyR.Ásccsx|jD] }|Vq WdS(N(Rm(RRa((s/usr/lib64/python2.7/_abcoll.pyR)Äs(R$R%R'R=R.R)(((s/usr/lib64/python2.7/_abcoll.pyR »s cBs)eZed„ƒZd„Zd„ZRS(cCs t|ƒS(N(Rr(RR<((s/usr/lib64/python2.7/_abcoll.pyR=ÌscCs@|\}}y|j|}Wntk r1tSX||kSdS(N(RmRXR((RtitemRaR>tv((s/usr/lib64/python2.7/_abcoll.pyR.Ðs   ccs*x#|jD]}||j|fVq WdS(N(Rm(RRa((s/usr/lib64/python2.7/_abcoll.pyR)Ùs(R$R%R'R=R.R)(((s/usr/lib64/python2.7/_abcoll.pyRÊs cBseZd„Zd„ZRS(cCs/x(|jD]}||j|kr tSq WtS(N(RmRR((RR>Ra((s/usr/lib64/python2.7/_abcoll.pyR.ásccs$x|jD]}|j|Vq WdS(N(Rm(RRa((s/usr/lib64/python2.7/_abcoll.pyR)çs(R$R%R.R)(((s/usr/lib64/python2.7/_abcoll.pyRßs cBsheZdZed„ƒZed„ƒZeƒZed„Zd„Z d„Z d„Z dd„Z RS( sìA MutableMapping is a generic container for associating key/value pairs. This class provides concrete generic implementations of all methods except for __getitem__, __setitem__, __delitem__, __iter__, and __len__. cCs t‚dS(N(RX(RRaR>((s/usr/lib64/python2.7/_abcoll.pyt __setitem__øscCs t‚dS(N(RX(RRa((s/usr/lib64/python2.7/_abcoll.pyt __delitem__üscCsGy||}Wn'tk r7||jkr3‚n|SX||=|SdS(s©D.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. N(RXt_MutableMapping__marker(RRaRcR>((s/usr/lib64/python2.7/_abcoll.pyR[s cCsKytt|ƒƒ}Wntk r/t‚nX||}||=||fS(sƒD.popitem() -> (k, v), remove and return some (key, value) pair as a 2-tuple; but raise KeyError if D is empty. (R+RZR*RX(RRaR>((s/usr/lib64/python2.7/_abcoll.pytpopitems   cCs3yxtr|jƒqWWntk r.nXdS(s,D.clear() -> None. Remove all items from D.N(RRxRX(R((s/usr/lib64/python2.7/_abcoll.pyR\s   cOs|stdƒ‚n|d}|d}t|ƒdkrTtdt|ƒƒ‚n|rð|d}t|tƒr•xw|D]}|||| None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v s@descriptor 'update' of 'MutableMapping' object needs an argumentiis+update expected at most 1 arguments, got %dRiN(t TypeErrorR3R2R RRiRj(R/R0RR4RaR>((s/usr/lib64/python2.7/_abcoll.pytupdate$s&    cCs.y ||SWntk r)||| D.get(k,d), also set D[k]=d if k not in D(RX(RRaRc((s/usr/lib64/python2.7/_abcoll.pyt setdefault@s   N(R$R%RQRRuRvtobjectRwR[RxR\RzR R{(((s/usr/lib64/python2.7/_abcoll.pyR ís     cBsJeZdZed„ƒZd„Zd„Zd„Zd„Zd„Z RS(sŠAll the operations on a read-only sequence. Concrete subclasses must override __new__ or __init__, __getitem__, and __len__. cCs t‚dS(N(t IndexError(Rtindex((s/usr/lib64/python2.7/_abcoll.pyRbUsccsId}y*x#tr.||}|V|d7}q WWntk rDdSXdS(Nii(RR}(RtiRt((s/usr/lib64/python2.7/_abcoll.pyR)Ys   cCs%x|D]}||krtSqWtS(N(RR((RR>Rt((s/usr/lib64/python2.7/_abcoll.pyR.cs  ccs0x)ttt|ƒƒƒD]}||VqWdS(N(treversedtrangeR3(RR((s/usr/lib64/python2.7/_abcoll.pyt __reversed__iscCs7x*t|ƒD]\}}||kr |Sq Wt‚dS(s|S.index(value) -> integer -- return first index of value. Raises ValueError if the value is not present. N(t enumeratet ValueError(RR>RRt((s/usr/lib64/python2.7/_abcoll.pyR~ms cst‡fd†|DƒƒS(sBS.count(value) -> integer -- return number of occurrences of valuec3s!|]}|ˆkrdVqdS(iN((RRt(R>(s/usr/lib64/python2.7/_abcoll.pys xs(tsum(RR>((R>s/usr/lib64/python2.7/_abcoll.pytcountvs( R$R%RQRRbR)R.R‚R~R†(((s/usr/lib64/python2.7/_abcoll.pyRNs   cBsteZdZed„ƒZed„ƒZed„ƒZd„Zd„Zd„Z dd„Z d „Z d „Z RS( s®All the operations on a read-only sequence. Concrete subclasses must provide __new__ or __init__, __getitem__, __setitem__, __delitem__, __len__, and insert(). cCs t‚dS(N(R}(RR~R>((s/usr/lib64/python2.7/_abcoll.pyRu‰scCs t‚dS(N(R}(RR~((s/usr/lib64/python2.7/_abcoll.pyRvscCs t‚dS(s5S.insert(index, object) -- insert object before indexN(R}(RR~R>((s/usr/lib64/python2.7/_abcoll.pytinsert‘scCs|jt|ƒ|ƒdS(s<S.append(object) -- append object to the end of the sequenceN(R‡R3(RR>((s/usr/lib64/python2.7/_abcoll.pytappend–scCsXt|ƒ}xEt|dƒD]3}|||d||||<|||d item -- remove and return item at index (default last). Raise IndexError if list is empty or index is out of range. ((RR~Rt((s/usr/lib64/python2.7/_abcoll.pyR[¥s cCs||j|ƒ=dS(svS.remove(value) -- remove first occurrence of value. Raise ValueError if the value is not present. N(R~(RR>((s/usr/lib64/python2.7/_abcoll.pyRY­scCs|j|ƒ|S(N(RŠ(RRk((s/usr/lib64/python2.7/_abcoll.pyt__iadd__³s ( R$R%RQRRuRvR‡RˆR‰RŠR[RYR‹(((s/usr/lib64/python2.7/_abcoll.pyR€s     ((((((%RQtabcRRRHt__all__RRRtregistertstrRRRRRt frozensetR RrR R R ttypetviewkeysRt viewitemsRt viewvaluesR RlRttuplet basestringtbuffertxrangeRRh(((s/usr/lib64/python2.7/_abcoll.pyt sJ       Œ M B   [ ,    7