Your IP : 3.145.152.168


Current Path : /opt/alt/python34/lib64/python3.4/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/__pycache__/_collections_abc.cpython-34.pyo

�
e f�M�@s�dZddlmZmZddlZdddddd	d
ddd
dddddddgZdZeed��Z	eee
���Zeeij���Z
eeij���Zeeij���Zeeg��Zeeeg���Zeeed���Zeee���Zeed��Zeef��Zeee���Zeij��Zeij��Zeij��Zeej �Z!Gdd�dde�Z"Gdd�dde�Z#Gdd�de#�Z$e$j%e	�e$j%e�e$j%e
�e$j%e�e$j%e�e$j%e�e$j%e�e$j%e�e$j%e�e$j%e�e$j%e�e$j%e�Gdd�dde�Z&Gdd�dde�Z'Gdd	�d	de�Z(Gdd
�d
e&e#e'�Z)e)j%e*�Gd d�de)�Z+e+j%e�Gd!d�de&e#e'�Z,e,j%e!�Gd"d�de&�Z-Gd#d�de-e)�Z.e.j%e�Gd$d�de-e)�Z/e/j%e�Gd%d�de-�Z0e0j%e�Gd&d
�d
e,�Z1e1j%e2�Gd'd�de&e#e'�Z3e3j%e4�e3j%e5�e3j%e�e3j%e6�Gd(d�de3�Z7e7j%e8�e7j%e
�Gd)d�de3�Z9e9j%e:�e9j%e
�dS)*zjAbstract Base Classes (ABCs) for collections, according to PEP 3119.

Unit tests are in test_collections.
�)�ABCMeta�abstractmethodN�Hashable�Iterable�Iterator�Sized�	Container�Callable�Set�
MutableSet�Mapping�MutableMapping�MappingView�KeysView�	ItemsView�
ValuesView�Sequence�MutableSequence�
ByteStringzcollections.abc��c@s:eZdZfZedd��Zedd��ZdS)rcCsdS)Nr�)�selfrr�5/opt/alt/python34/lib64/python3.4/_collections_abc.py�__hash__=szHashable.__hash__cCsK|tkrGx8|jD]*}d|jkr|jdr<dSPqqWntS)NrT)r�__mro__�__dict__�NotImplemented)�cls�C�Brrr�__subclasshook__As
zHashable.__subclasshook__N)�__name__�
__module__�__qualname__�	__slots__rr�classmethodr!rrrrr9s�	metaclassc@s:eZdZfZedd��Zedd��ZdS)rccsdS)Nr)rrrr�__iter__PszIterable.__iter__cCs3|tkr/tdd�|jD��r/dSntS)Ncss|]}d|jkVqdS)r(N)r)�.0r rrr�	<genexpr>Xsz,Iterable.__subclasshook__.<locals>.<genexpr>T)r�anyrr)rrrrrr!UszIterable.__subclasshook__N)r"r#r$r%rr(r&r!rrrrrLsc@sFeZdZfZedd��Zdd�Zedd��ZdS)rcCs
t�dS)zKReturn the next item from the iterator. When exhausted, raise StopIterationN)�
StopIteration)rrrr�__next__aszIterator.__next__cCs|S)Nr)rrrrr(fszIterator.__iter__cCsO|tkrKtdd�|jD��rKtdd�|jD��rKdSntS)Ncss|]}d|jkVqdS)r-N)r)r)r rrrr*lsz,Iterator.__subclasshook__.<locals>.<genexpr>css|]}d|jkVqdS)r(N)r)r)r rrrr*msT)rr+rr)rrrrrr!is
zIterator.__subclasshook__N)	r"r#r$r%rr-r(r&r!rrrrr]sc@s:eZdZfZedd��Zedd��ZdS)rcCsdS)Nrr)rrrr�__len__�sz
Sized.__len__cCs3|tkr/tdd�|jD��r/dSntS)Ncss|]}d|jkVqdS)r.N)r)r)r rrrr*�sz)Sized.__subclasshook__.<locals>.<genexpr>T)rr+rr)rrrrrr!�szSized.__subclasshook__N)r"r#r$r%rr.r&r!rrrrrsc@s:eZdZfZedd��Zedd��ZdS)rcCsdS)NFr)r�xrrr�__contains__�szContainer.__contains__cCs3|tkr/tdd�|jD��r/dSntS)Ncss|]}d|jkVqdS)r0N)r)r)r rrrr*�sz-Container.__subclasshook__.<locals>.<genexpr>T)rr+rr)rrrrrr!�szContainer.__subclasshook__N)r"r#r$r%rr0r&r!rrrrr�sc@s:eZdZfZedd��Zedd��ZdS)r	cOsdS)NFr)r�args�kwdsrrr�__call__�szCallable.__call__cCs3|tkr/tdd�|jD��r/dSntS)Ncss|]}d|jkVqdS)r3N)r)r)r rrrr*�sz,Callable.__subclasshook__.<locals>.<genexpr>T)r	r+rr)rrrrrr!�szCallable.__subclasshook__N)r"r#r$r%rr3r&r!rrrrr	�sc@s�eZdZdZfZdd�Zdd�Zdd�Zdd	�Zd
d�Z	e
dd
��Zdd�ZeZ
dd�Zdd�ZeZdd�Zdd�Zdd�ZeZdd�ZdS)r
aZA 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/dSx|D]}||kr6dSq6WdS)NFT)�
isinstancer
r�len)r�other�elemrrr�__le__�s
z
Set.__le__cCs8t|t�stSt|�t|�ko7|j|�S)N)r4r
rr5r8)rr6rrr�__lt__�sz
Set.__lt__cCs8t|t�stSt|�t|�ko7|j|�S)N)r4r
rr5�__ge__)rr6rrr�__gt__�sz
Set.__gt__cCsTt|t�stSt|�t|�kr/dSx|D]}||kr6dSq6WdS)NFT)r4r
rr5)rr6r7rrrr:�s
z
Set.__ge__cCs8t|t�stSt|�t|�ko7|j|�S)N)r4r
rr5r8)rr6rrr�__eq__�sz
Set.__eq__cCs
||�S)z�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)r�itrrr�_from_iterable�szSet._from_iterablecs3t|t�stS�j�fdd�|D��S)Nc3s!|]}|�kr|VqdS)Nr)r)�value)rrrr*�szSet.__and__.<locals>.<genexpr>)r4rrr>)rr6r)rr�__and__�szSet.__and__cCs%x|D]}||krdSqWdS)z1Return True if two sets have a null intersection.FTr)rr6r?rrr�
isdisjoint�s
zSet.isdisjointcCs9t|t�stSdd�||fD�}|j|�S)Ncss"|]}|D]}|Vq
qdS)Nr)r)�s�errrr*�szSet.__or__.<locals>.<genexpr>)r4rrr>)rr6�chainrrr�__or__�sz
Set.__or__csTt�t�s4t�t�s"tS|j���n|j�fdd�|D��S)Nc3s!|]}|�kr|VqdS)Nr)r)r?)r6rrr*szSet.__sub__.<locals>.<genexpr>)r4r
rrr>)rr6r)r6r�__sub__s
zSet.__sub__csTt|t�s4t|t�s"tS�j|�}n�j�fdd�|D��S)Nc3s!|]}|�kr|VqdS)Nr)r)r?)rrrr*szSet.__rsub__.<locals>.<genexpr>)r4r
rrr>)rr6r)rr�__rsub__
s
zSet.__rsub__cCsDt|t�s4t|t�s"tS|j|�}n||||BS)N)r4r
rrr>)rr6rrr�__xor__s
zSet.__xor__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)a+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.
        ��iM��r�i�M[l�4~2i�
i��6i��8#���)�sys�maxsizer5�hash)r�MAX�MASK�n�hr/�hxrrr�_hashs 	


	z	Set._hashN)r"r#r$�__doc__r%r8r9r;r:r<r&r>r@�__rand__rArE�__ror__rFrGrH�__rxor__rUrrrrr
�s$


	c@s�eZdZdZfZedd��Zedd��Zdd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�ZdS)ra�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)zAdd an element.N)�NotImplementedError)rr?rrr�addLszMutableSet.addcCs
t�dS)z8Remove an element.  Do not raise an exception if absent.N)rZ)rr?rrr�discardQszMutableSet.discardcCs,||krt|��n|j|�dS)z5Remove an element. If not a member, raise a KeyError.N)�KeyErrorr\)rr?rrr�removeVszMutableSet.removecCsHt|�}yt|�}Wntk
r6t�YnX|j|�|S)z2Return the popped value.  Raise KeyError if empty.)�iter�nextr,r]r\)rr=r?rrr�pop\s

zMutableSet.popcCs.yx|j�qWWntk
r)YnXdS)z6This is slow (creates N new iterators!) but effective.N)rar])rrrr�clearfs

zMutableSet.clearcCs"x|D]}|j|�qW|S)N)r[)rr=r?rrr�__ior__ns
zMutableSet.__ior__cCs&x||D]}|j|�qW|S)N)r\)rr=r?rrr�__iand__sszMutableSet.__iand__cCsx||kr|j�n[t|t�s:|j|�}nx7|D]/}||krc|j|�qA|j|�qAW|S)N)rbr4r
r>r\r[)rr=r?rrr�__ixor__xs

zMutableSet.__ixor__cCs;||kr|j�nx|D]}|j|�q W|S)N)rbr\)rr=r?rrr�__isub__�s


zMutableSet.__isub__N)r"r#r$rVr%rr[r\r^rarbrcrdrerfrrrrr>s


c@sseZdZfZedd��Zddd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZdS)rcCs
t�dS)N)r])r�keyrrr�__getitem__�szMapping.__getitem__NcCs)y||SWntk
r$|SYnXdS)z<D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.N)r])rrg�defaultrrr�get�s
zMapping.getcCs-y||Wntk
r$dSYnXdSdS)NFT)r])rrgrrrr0�s

	zMapping.__contains__cCs
t|�S)z:D.keys() -> a set-like object providing a view on D's keys)r)rrrr�keys�szMapping.keyscCs
t|�S)z<D.items() -> a set-like object providing a view on D's items)r)rrrr�items�sz
Mapping.itemscCs
t|�S)z6D.values() -> an object providing a view on D's values)r)rrrr�values�szMapping.valuescCs5t|t�stSt|j��t|j��kS)N)r4rr�dictrl)rr6rrrr<�szMapping.__eq__)r"r#r$r%rrhrjr0rkrlrmr<rrrrr�s
c@s4eZdZdd�Zdd�Zdd�ZdS)rcCs
||_dS)N)�_mapping)r�mappingrrr�__init__�szMappingView.__init__cCs
t|j�S)N)r5ro)rrrrr.�szMappingView.__len__cCs
dj|�S)Nz&{0.__class__.__name__}({0._mapping!r}))�format)rrrr�__repr__�szMappingView.__repr__N)r"r#r$rqr.rsrrrrr�sc@s:eZdZedd��Zdd�Zdd�ZdS)rcCs
t|�S)N)�set)rr=rrrr>�szKeysView._from_iterablecCs
||jkS)N)ro)rrgrrrr0�szKeysView.__contains__ccs|jDdHdS)N)ro)rrrrr(�szKeysView.__iter__N)r"r#r$r&r>r0r(rrrrr�sc@s:eZdZedd��Zdd�Zdd�ZdS)rcCs
t|�S)N)rt)rr=rrrr>�szItemsView._from_iterablecCsD|\}}y|j|}Wntk
r5dSYnX||kSdS)NF)ror])r�itemrgr?�vrrrr0�s
	zItemsView.__contains__ccs*x#|jD]}||j|fVq
WdS)N)ro)rrgrrrr(�szItemsView.__iter__N)r"r#r$r&r>r0r(rrrrr�s	c@s(eZdZdd�Zdd�ZdS)rcCs/x(|jD]}||j|kr
dSq
WdS)NTF)ro)rr?rgrrrr0�szValuesView.__contains__ccs$x|jD]}|j|Vq
WdS)N)ro)rrgrrrr(�szValuesView.__iter__N)r"r#r$r0r(rrrrr�sc@s�eZdZfZedd��Zedd��Ze�Zedd�Z	dd�Z
d	d
�Zdd�Zd
dd�Z
d
S)r
cCs
t�dS)N)r])rrgr?rrr�__setitem__szMutableMapping.__setitem__cCs
t�dS)N)r])rrgrrr�__delitem__szMutableMapping.__delitem__cCsKy||}Wn+tk
r;||jkr3�n|SYnX||=|SdS)z�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)r]�_MutableMapping__marker)rrgrir?rrrras
	zMutableMapping.popcCsLytt|��}Wntk
r0t�YnX||}||=||fS)z�D.popitem() -> (k, v), remove and return some (key, value) pair
           as a 2-tuple; but raise KeyError if D is empty.
        )r`r_r,r])rrgr?rrr�popitem+s

zMutableMapping.popitemcCs.yx|j�qWWntk
r)YnXdS)z,D.clear() -> None.  Remove all items from D.N)rzr])rrrrrb7s

zMutableMapping.clearcOs|std��n|^}}t|�dkrLtdt|���n|r�|d}t|t�r�xw|D]}||||<qrWq�t|d�r�xF|j�D]}||||<q�Wq�x!|D]\}}|||<q�Wnx$|j�D]\}}|||<q�WdS)aK 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
        z@descriptor 'update' of 'MutableMapping' object needs an argumentrJz+update expected at most 1 arguments, got %drrkN)�	TypeErrorr5r4r�hasattrrkrl)r1r2rr6rgr?rrr�update?s$

zMutableMapping.updateNcCs/y||SWntk
r*|||<YnX|S)z@D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D)r])rrgrirrr�
setdefaultZs

zMutableMapping.setdefault)r"r#r$r%rrwrx�objectryrarzrbr}r~rrrrr
s	c@sjeZdZdZfZedd��Zdd�Zdd�Zdd	�Z	d
d�Z
dd
�ZdS)rz�All the operations on a read-only sequence.

    Concrete subclasses must override __new__ or __init__,
    __getitem__, and __len__.
    cCs
t�dS)N)�
IndexError)r�indexrrrrhrszSequence.__getitem__ccsGd}y$x||}|V|d7}qWWntk
rBdSYnXdS)NrrJ)r�)r�irvrrrr(vs

zSequence.__iter__cCs%x|D]}||krdSqWdS)NTFr)rr?rvrrrr0�s
zSequence.__contains__ccs0x)ttt|���D]}||VqWdS)N)�reversed�ranger5)rr�rrr�__reversed__�szSequence.__reversed__cCs7x*t|�D]\}}||kr
|Sq
Wt�dS)z|S.index(value) -> integer -- return first index of value.
           Raises ValueError if the value is not present.
        N)�	enumerate�
ValueError)rr?r�rvrrrr��szSequence.indexcst�fdd�|D��S)zBS.count(value) -> integer -- return number of occurrences of valuec3s!|]}|�krdVqdS)rJNr)r)rv)r?rrr*�sz!Sequence.count.<locals>.<genexpr>)�sum)rr?r)r?r�count�szSequence.countN)r"r#r$rVr%rrhr(r0r�r�r�rrrrrhs
	c@seZdZdZfZdS)rzMThis unifies bytes and bytearray.

    XXX Should add all their methods.
    N)r"r#r$rVr%rrrrr�sc@s�eZdZfZedd��Zedd��Zedd��Zdd�Zd	d
�Z	dd�Z
d
d�Zddd�Zdd�Z
dd�ZdS)rcCs
t�dS)N)r�)rr�r?rrrrw�szMutableSequence.__setitem__cCs
t�dS)N)r�)rr�rrrrx�szMutableSequence.__delitem__cCs
t�dS)z3S.insert(index, value) -- insert value before indexN)r�)rr�r?rrr�insert�szMutableSequence.insertcCs|jt|�|�dS)z:S.append(value) -- append value to the end of the sequenceN)r�r5)rr?rrr�append�szMutableSequence.appendcCs.yx|j�qWWntk
r)YnXdS)z,S.clear() -> None -- remove all items from SN)rar�)rrrrrb�s

zMutableSequence.clearcCsXt|�}xEt|d�D]3}|||d||||<|||d<qWdS)z!S.reverse() -- reverse *IN PLACE*rIrJN)r5r�)rrRr�rrr�reverse�szMutableSequence.reversecCs"x|D]}|j|�qWdS)zMS.extend(iterable) -- extend sequence by appending elements from the iterableN)r�)rrmrvrrr�extend�s
zMutableSequence.extendrJcCs||}||=|S)z�S.pop([index]) -> item -- remove and return item at index (default last).
           Raise IndexError if list is empty or index is out of range.
        r)rr�rvrrrra�s
zMutableSequence.popcCs||j|�=dS)zvS.remove(value) -- remove first occurrence of value.
           Raise ValueError if the value is not present.
        N)r�)rr?rrrr^�szMutableSequence.removecCs|j|�|S)N)r�)rrmrrr�__iadd__�s
zMutableSequence.__iadd__NrL)r"r#r$r%rrwrxr�r�rbr�r�rar^r�rrrrr�s	);rV�abcrrrM�__all__r"�typer_�bytes_iterator�	bytearray�bytearray_iteratorrk�dict_keyiteratorrm�dict_valueiteratorrl�dict_itemiterator�
list_iteratorr��list_reverseiteratorr��range_iteratorrt�set_iterator�str_iterator�tuple_iterator�zip�zip_iterator�	dict_keys�dict_values�
dict_itemsr�mappingproxyrrr�registerrrr	r
�	frozensetrrrrrrr
rnr�tuple�str�
memoryviewr�bytesr�listrrrr�<module>s�				











�
O
0



\
/



	

A


?>