�`^c@sIdZddlmZmZddlZdddddd d
ddd
ddddddgZd�Zdd%d��YZdd&d��YZej e
�defd��YZdd'd��YZdd(d��YZ
d d)d��YZd
eee
fd��YZej e�defd��YZej e�deee
fd��YZdefd��YZdeefd��YZdeefd ��YZdefd!��YZd
efd"��YZej e�deee
fd#��YZej e�ej e�ej e�ej e�defd$��YZej 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
MutableSettMappingtMutableMappingtMappingViewtKeysViewt ItemsViewt
ValuesViewtSequencetMutableSequencecsCy!t�fd�|jD��SWntk
r>t|��SXdS(Nc3s|]}�|jkVqdS(N(t__dict__(t.0tB(tattr(s/sys/lib/python2.7/_abcoll.pys <genexpr>s(tanyt__mro__tAttributeErrorthasattr(tCR((Rs/sys/lib/python2.7/_abcoll.pyt_hasattrs!
cBs,eZeZed��Zed��ZRS(cCsdS(Ni((tself((s/sys/lib/python2.7/_abcoll.pyt__hash__#scCsy|tkruy<x5|jD]*}d|jkr|jdr?tSPqqWWqutk
rqt|dd�rrtSquXntS(NR(RRRtTrueRtgetattrtNonetNotImplemented(tclsRR((s/sys/lib/python2.7/_abcoll.pyt__subclasshook__'s
(t__name__t
__module__Rt
__metaclass__RRtclassmethodR#(((s/sys/lib/python2.7/_abcoll.pyR scBs,eZeZed��Zed��ZRS(ccsxtrdVqWdS(N(tFalseR (R((s/sys/lib/python2.7/_abcoll.pyt__iter__:s cCs&|tkr"t|d�r"tSntS(NR)(RRRR!(R"R((s/sys/lib/python2.7/_abcoll.pyR#?s(R$R%RR&RR)R'R#(((s/sys/lib/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/sys/lib/python2.7/_abcoll.pytnextKscCs|S(N((R((s/sys/lib/python2.7/_abcoll.pyR)PscCs5|tkr1t|d�r1t|d�r1tSntS(NR+R)(RRRR!(R"R((s/sys/lib/python2.7/_abcoll.pyR#Ss(R$R%RR+R)R'R#(((s/sys/lib/python2.7/_abcoll.pyRIs cBs,eZeZed��Zed��ZRS(cCsdS(Ni((R((s/sys/lib/python2.7/_abcoll.pyt__len__^scCs&|tkr"t|d�r"tSntS(NR,(RRRR!(R"R((s/sys/lib/python2.7/_abcoll.pyR#bs(R$R%RR&RR,R'R#(((s/sys/lib/python2.7/_abcoll.pyR[scBs,eZeZed��Zed��ZRS(cCstS(N(R((Rtx((s/sys/lib/python2.7/_abcoll.pyt__contains__mscCs&|tkr"t|d�r"tSntS(NR.(RRRR!(R"R((s/sys/lib/python2.7/_abcoll.pyR#qs(R$R%RR&RR.R'R#(((s/sys/lib/python2.7/_abcoll.pyRjscBs,eZeZed��Zed��ZRS(cOstS(N(R((Rtargstkwds((s/sys/lib/python2.7/_abcoll.pyt__call__|scCs&|tkr"t|d�r"tSntS(NR1(RRRR!(R"R((s/sys/lib/python2.7/_abcoll.pyR#�s(R$R%RR&RR1R'R#(((s/sys/lib/python2.7/_abcoll.pyRyscBs�eZdZd�Zd�Zd�Zd�Zd�Zd�Ze d��Z
d�ZeZd �Z
d
�ZeZd�Zd�Zd
�ZeZdZd�ZRS(shA 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), all you have to do is redefine __le__ and
then the other operations will automatically follow suit.
cCsTt|t�stSt|�t|�kr/tSx|D]}||kr6tSq6WtS(N(t
isinstanceRR!tlenR(R(Rtothertelem((s/sys/lib/python2.7/_abcoll.pyt__le__�s
cCs8t|t�stSt|�t|�ko7|j|�S(N(R2RR!R3R6(RR4((s/sys/lib/python2.7/_abcoll.pyt__lt__�scCs8t|t�stSt|�t|�ko7|j|�S(N(R2RR!R3t__ge__(RR4((s/sys/lib/python2.7/_abcoll.pyt__gt__�scCsTt|t�stSt|�t|�kr/tSx|D]}||kr6tSq6WtS(N(R2RR!R3R(R(RR4R5((s/sys/lib/python2.7/_abcoll.pyR8�s
cCs8t|t�stSt|�t|�ko7|j|�S(N(R2RR!R3R6(RR4((s/sys/lib/python2.7/_abcoll.pyt__eq__�scCs||kS(N((RR4((s/sys/lib/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/sys/lib/python2.7/_abcoll.pyt_from_iterable�scs0t|t�stS�j�fd�|D��S(Nc3s!|]}|�kr|VqdS(N((Rtvalue(R(s/sys/lib/python2.7/_abcoll.pys <genexpr>�s(R2RR!R=(RR4((Rs/sys/lib/python2.7/_abcoll.pyt__and__�scCs%x|D]}||krtSqWtS(s1Return True if two sets have a null intersection.(R(R(RR4R>((s/sys/lib/python2.7/_abcoll.pyt
isdisjoint�s
cCs6t|t�stSd�||fD�}|j|�S(Ncss"|]}|D]}|Vq
qdS(N((Rtste((s/sys/lib/python2.7/_abcoll.pys <genexpr>�s(R2RR!R=(RR4tchain((s/sys/lib/python2.7/_abcoll.pyt__or__�scsQt�t�s4t�t�s"tS|j���n|j�fd�|D��S(Nc3s!|]}|�kr|VqdS(N((RR>(R4(s/sys/lib/python2.7/_abcoll.pys <genexpr>�s(R2RRR!R=(RR4((R4s/sys/lib/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/sys/lib/python2.7/_abcoll.pys <genexpr>�s(R2RRR!R=(RR4((Rs/sys/lib/python2.7/_abcoll.pyt__rsub__�s
cCsDt|t�s4t|t�s"tS|j|�}n||||BS(N(R2RRR!R=(RR4((s/sys/lib/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�ii�[l�~2i�i�6i�i�8#(tsystmaxintR3thash(RtMAXtMASKtnthR-thx((s/sys/lib/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/sys/lib/python2.7/_abcoll.pyR�s&
cBskeZdZed��Zed��Zd�Zd�Zd�Zd�Z d�Z
d�Zd �ZRS(
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/sys/lib/python2.7/_abcoll.pytadd&scCs
t�dS(s8Remove an element. Do not raise an exception if absent.N(RU(RR>((s/sys/lib/python2.7/_abcoll.pytdiscard+scCs,||krt|��n|j|�dS(s5Remove an element. If not a member, raise a KeyError.N(tKeyErrorRW(RR>((s/sys/lib/python2.7/_abcoll.pytremove0scCsGt|�}yt|�}Wntk
r5t�nX|j|�|S(s2Return the popped value. Raise KeyError if empty.(titerR+R*RXRW(RR<R>((s/sys/lib/python2.7/_abcoll.pytpop6s
cCs3yxtr|j�qWWntk
r.nXdS(s6This is slow (creates N new iterators!) but effective.N(RR[RX(R((s/sys/lib/python2.7/_abcoll.pytclear@s
cCs"x|D]}|j|�qW|S(N(RV(RR<R>((s/sys/lib/python2.7/_abcoll.pyt__ior__Hs
cCs&x||D]}|j|�qW|S(N(RW(RR<R>((s/sys/lib/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/sys/lib/python2.7/_abcoll.pyt__ixor__Rs
cCs;||kr|j�nx|D]}|j|�q W|S(N(R\RW(RR<R>((s/sys/lib/python2.7/_abcoll.pyt__isub___s
(
R$R%RQRRVRWRYR[R\R]R^R_R`(((s/sys/lib/python2.7/_abcoll.pyR s
cBs�eZdZed��Zdd�Zd�Zd�Zd�Z d�Z
d�Zd�Zd �Z
dZd
�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/sys/lib/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/sys/lib/python2.7/_abcoll.pytget{s
cCs)y||Wntk
r tSXtSdS(N(RXR(R(RRa((s/sys/lib/python2.7/_abcoll.pyR.�s
cCs
t|�S(s.D.iterkeys() -> an iterator over the keys of D(RZ(R((s/sys/lib/python2.7/_abcoll.pytiterkeys�sccsx|D]}||VqWdS(s2D.itervalues() -> an iterator over the values of DN((RRa((s/sys/lib/python2.7/_abcoll.pyt
itervalues�s
ccs$x|D]}|||fVqWdS(s=D.iteritems() -> an iterator over the (key, value) items of DN((RRa((s/sys/lib/python2.7/_abcoll.pyt iteritems�s
cCs
t|�S(sD.keys() -> list of D's keys(tlist(R((s/sys/lib/python2.7/_abcoll.pytkeys�scCs!g|D]}|||f^qS(s8D.items() -> list of D's (key, value) pairs, as 2-tuples((RRa((s/sys/lib/python2.7/_abcoll.pytitems�scCsg|D]}||^qS(s D.values() -> list of D's values((RRa((s/sys/lib/python2.7/_abcoll.pytvalues�scCs5t|t�stSt|j��t|j��kS(N(R2R
R!tdictRj(RR4((s/sys/lib/python2.7/_abcoll.pyR:�scCs||kS(N((RR4((s/sys/lib/python2.7/_abcoll.pyR;�sN(R$R%RQRRbR RdR.ReRfRgRiRjRkRR:R;(((s/sys/lib/python2.7/_abcoll.pyR
ms cBs#eZd�Zd�Zd�ZRS(cCs
||_dS(N(t_mapping(Rtmapping((s/sys/lib/python2.7/_abcoll.pyt__init__�scCs
t|j�S(N(R3Rm(R((s/sys/lib/python2.7/_abcoll.pyR,�scCs
dj|�S(Ns&{0.__class__.__name__}({0._mapping!r})(tformat(R((s/sys/lib/python2.7/_abcoll.pyt__repr__�s(R$R%RoR,Rq(((s/sys/lib/python2.7/_abcoll.pyR�s cBs)eZed��Zd�Zd�ZRS(cCs
t|�S(N(tset(RR<((s/sys/lib/python2.7/_abcoll.pyR=�scCs
||jkS(N(Rm(RRa((s/sys/lib/python2.7/_abcoll.pyR.�sccsx|jD]}|Vq
WdS(N(Rm(RRa((s/sys/lib/python2.7/_abcoll.pyR)�s(R$R%R'R=R.R)(((s/sys/lib/python2.7/_abcoll.pyR
�s cBs)eZed��Zd�Zd�ZRS(cCs
t|�S(N(Rr(RR<((s/sys/lib/python2.7/_abcoll.pyR=�scCs@|\}}y|j|}Wntk
r1tSX||kSdS(N(RmRXR((RtitemRaR>tv((s/sys/lib/python2.7/_abcoll.pyR.�s
ccs*x#|jD]}||j|fVq
WdS(N(Rm(RRa((s/sys/lib/python2.7/_abcoll.pyR)�s(R$R%R'R=R.R)(((s/sys/lib/python2.7/_abcoll.pyR�s cBseZd�Zd�ZRS(cCs/x(|jD]}||j|kr
tSq
WtS(N(RmRR((RR>Ra((s/sys/lib/python2.7/_abcoll.pyR.�sccs$x|jD]}|j|Vq
WdS(N(Rm(RRa((s/sys/lib/python2.7/_abcoll.pyR)�s(R$R%R.R)(((s/sys/lib/python2.7/_abcoll.pyR�s cBsheZdZed��Zed��Ze�Zed�Zd�Z d�Z
d�Zdd�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/sys/lib/python2.7/_abcoll.pyt__setitem__�scCs
t�dS(N(RX(RRa((s/sys/lib/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/sys/lib/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/sys/lib/python2.7/_abcoll.pytpopitem
s
cCs3yxtr|j�qWWntk
r.nXdS(s,D.clear() -> None. Remove all items from D.N(RRxRX(R((s/sys/lib/python2.7/_abcoll.pyR\s
cOs%t|�dkr0tdjt|����n|sEtd��n|d}t|�dkrk|dnd}t|t�r�xw|D]}||||<q�WnXt|d�r�xF|j�D]}||||<q�Wn!x|D]\}}|||<q�x$|j�D]\}}|||<qWdS( sK D.update([E, ]**F) -> 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
is8update() takes at most 2 positional arguments ({} given)s,update() takes at least 1 argument (0 given)iiRiN((R3t TypeErrorRpR2R
RRiRj(R/R0RR4RaR>((s/sys/lib/python2.7/_abcoll.pytupdate!s"
"
cCs.y||SWntk
r)|||<nX|S(s@D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D(RX(RRaRc((s/sys/lib/python2.7/_abcoll.pyt
setdefault;s
N(R$R%RQRRuRvtobjectRwR[RxR\RzR R{(((s/sys/lib/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/sys/lib/python2.7/_abcoll.pyRbPsccsId}y*x#tr.||}|V|d7}qWWntk
rDdSXdS(Nii(RR}(RtiRt((s/sys/lib/python2.7/_abcoll.pyR)Ts
cCs%x|D]}||krtSqWtS(N(RR((RR>Rt((s/sys/lib/python2.7/_abcoll.pyR.^s
ccs0x)ttt|���D]}||VqWdS(N(treversedtrangeR3(RR((s/sys/lib/python2.7/_abcoll.pyt__reversed__dscCs7x*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/sys/lib/python2.7/_abcoll.pyR~hscst�fd�|D��S(sBS.count(value) -> integer -- return number of occurrences of valuec3s!|]}|�krdVqdS(iN((RRt(R>(s/sys/lib/python2.7/_abcoll.pys <genexpr>ss(tsum(RR>((R>s/sys/lib/python2.7/_abcoll.pytcountqs(
R$R%RQRRbR)R.R�R~R�(((s/sys/lib/python2.7/_abcoll.pyRIs
cBsteZdZed��Zed��Zed��Zd�Zd�Zd�Z dd�Z
d �Zd
�ZRS(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/sys/lib/python2.7/_abcoll.pyRu�scCs
t�dS(N(R}(RR~((s/sys/lib/python2.7/_abcoll.pyRv�scCs
t�dS(s5S.insert(index, object) -- insert object before indexN(R}(RR~R>((s/sys/lib/python2.7/_abcoll.pytinsert�scCs|jt|�|�dS(s<S.append(object) -- append object to the end of the sequenceN(R�R3(RR>((s/sys/lib/python2.7/_abcoll.pytappend�scCsXt|�}xEt|d�D]3}|||d||||<|||d<qWdS(s!S.reverse() -- reverse *IN PLACE*iiN(R3R�(RRMR((s/sys/lib/python2.7/_abcoll.pytreverse�scCs"x|D]}|j|�qWdS(sMS.extend(iterable) -- extend sequence by appending elements from the iterableN(R�(RRkRt((s/sys/lib/python2.7/_abcoll.pytextend�s
i�cCs||}||=|S(s�S.pop([index]) -> item -- remove and return item at index (default last).
Raise IndexError if list is empty or index is out of range.
((RR~Rt((s/sys/lib/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/sys/lib/python2.7/_abcoll.pyRY�scCs|j|�|S(N(R�(RRk((s/sys/lib/python2.7/_abcoll.pyt__iadd__�s
(
R$R%RQRRuRvR�R�R�R�R[RYR�(((s/sys/lib/python2.7/_abcoll.pyR{s ((((((!RQtabcRRRHt__all__RRRtregistertstrRRRRRt frozensetR RrR
RR
RRRRlRttuplet
basestringtbuffertxrangeRRh(((s/sys/lib/python2.7/_abcoll.pyt<module> sD
�M
B
Y
,
7
|