3
4^^g                 @   sr  d Z ddlmZmZ ddlZdddddd	d
ddddddddddddddddddgZdZeedZ	eee
 Zeei j Zeei j Zeei j Zeeg Zeeeg ZeeedZeeedd > Zeee Zeed!Zeef Zeee Zei j Zei j Zei j Z eej!Z"ed"d#  Z#d$d% Z$e$ Z$ee$Z%e$j&  [$d&d' Z'e' Z'ee'Z(['d(d) Z)G d*d	 d	ed+Z*G d,d ded+Z+G d-d de+Z,e,j-e% G d.d ded+Z.G d/d de.Z/G d0d de/Z0e0j-e( G d1d
 d
ed+Z1G d2d de1Z2e2j-e	 e2j-e e2j-e e2j-e e2j-e e2j-e e2j-e e2j-e e2j-e e2j-e e2j-e e2j-e e2j-e G d3d de1Z3G d4d de2Z4e4j-e# G d5d ded+Z5G d6d ded+Z6G d7d de5e1e6Z7G d8d ded+Z8G d9d de7Z9e9j-e: G d:d de9Z;e;j-e G d;d de7Z<e<j-e" G d<d de5Z=G d=d de=e9Z>e>j-e G d>d de=e9Z?e?j-e  G d?d de=Z@e@j-e G d@d de<ZAeAj-eB G dAd de3e7ZCeCj-eD eCj-eE eCj-e eCj-eF G dBd deCZGeGj-eH eGj-e
 G dCd deCZIeIj-eJ eIj-e
 dS )DzjAbstract Base Classes (ABCs) for collections, according to PEP 3119.

Unit tests are in test_collections.
    )ABCMetaabstractmethodN	Awaitable	CoroutineAsyncIterableAsyncIteratorAsyncGeneratorHashableIterableIterator	Generator
ReversibleSized	ContainerCallable
CollectionSet
MutableSetMappingMutableMappingMappingViewKeysView	ItemsView
ValuesViewSequenceMutableSequence
ByteStringzcollections.abc       i   c               c   s   d V S )N r    r    r    w/home/aldo/Documentos/tesis/tesis/device auto/pruebas pulsar/pruebaclonado/envClonado/lib/python3.6/_collections_abc.py<lambda>8   s    r"   c                  s   d S )Nr    r    r    r    r!   _coro:   s    r#   c               C  s
   d V  d S )Nr    r    r    r    r!   _ag@   s    r$   c             G   sH   | j }x<|D ]4}x.|D ]"}||jkr|j| d kr6tS P qW tS qW dS )NT)__mro____dict__NotImplemented)CZmethodsmromethodBr    r    r!   _check_methodsH   s    


r,   c               @   s(   e Zd Zf Zedd Zedd ZdS )r	   c             C   s   dS )Nr   r    )selfr    r    r!   __hash__X   s    zHashable.__hash__c             C   s   | t krt|dS tS )Nr.   )r	   r,   r'   )clsr(   r    r    r!   __subclasshook__\   s    
zHashable.__subclasshook__N)__name__
__module____qualname__	__slots__r   r.   classmethodr0   r    r    r    r!   r	   T   s   )	metaclassc               @   s(   e Zd Zf Zedd Zedd ZdS )r   c             c   s
   d V  d S )Nr    )r-   r    r    r!   	__await__g   s    zAwaitable.__await__c             C   s   | t krt|dS tS )Nr7   )r   r,   r'   )r/   r(   r    r    r!   r0   k   s    
zAwaitable.__subclasshook__N)r1   r2   r3   r4   r   r7   r5   r0   r    r    r    r!   r   c   s   c               @   s>   e Zd Zf Zedd Zed
ddZdd Zedd	 Z	dS )r   c             C   s   t dS )zcSend a value into the coroutine.
        Return next yielded value or raise StopIteration.
        N)StopIteration)r-   valuer    r    r!   sendv   s    zCoroutine.sendNc             C   s4   |dkr|dkr|| }|dk	r,|j |}|dS )zgRaise an exception in the coroutine.
        Return next yielded value or raise StopIteration.
        N)with_traceback)r-   typvaltbr    r    r!   throw}   s    
zCoroutine.throwc             C   s4   y| j t W n ttfk
r&   Y n
X tddS )z.Raise GeneratorExit inside coroutine.
        zcoroutine ignored GeneratorExitN)r?   GeneratorExitr8   RuntimeError)r-   r    r    r!   close   s
    zCoroutine.closec             C   s   | t krt|ddddS tS )Nr7   r:   r?   rB   )r   r,   r'   )r/   r(   r    r    r!   r0      s    zCoroutine.__subclasshook__)NN)
r1   r2   r3   r4   r   r:   r?   rB   r5   r0   r    r    r    r!   r   r   s   
c               @   s(   e Zd Zf Zedd Zedd ZdS )r   c             C   s   t  S )N)r   )r-   r    r    r!   	__aiter__   s    zAsyncIterable.__aiter__c             C   s   | t krt|dS tS )NrC   )r   r,   r'   )r/   r(   r    r    r!   r0      s    
zAsyncIterable.__subclasshook__N)r1   r2   r3   r4   r   rC   r5   r0   r    r    r    r!   r      s   c               @   s0   e Zd Zf Zedd Zdd Zedd ZdS )r   c                s   t dS )z@Return the next item or raise StopAsyncIteration when exhausted.N)StopAsyncIteration)r-   r    r    r!   	__anext__   s    zAsyncIterator.__anext__c             C   s   | S )Nr    )r-   r    r    r!   rC      s    zAsyncIterator.__aiter__c             C   s   | t krt|ddS tS )NrE   rC   )r   r,   r'   )r/   r(   r    r    r!   r0      s    zAsyncIterator.__subclasshook__N)	r1   r2   r3   r4   r   rE   rC   r5   r0   r    r    r    r!   r      s   c               @   sF   e Zd Zf Zdd Zedd ZedddZdd	 Ze	d
d Z
dS )r   c                s   | j dI dH S )zpReturn the next item from the asynchronous generator.
        When exhausted, raise StopAsyncIteration.
        N)asend)r-   r    r    r!   rE      s    zAsyncGenerator.__anext__c                s   t dS )zuSend a value into the asynchronous generator.
        Return next yielded value or raise StopAsyncIteration.
        N)rD   )r-   r9   r    r    r!   rF      s    zAsyncGenerator.asendNc                s4   |dkr|dkr|| }|dk	r,|j |}|dS )zyRaise an exception in the asynchronous generator.
        Return next yielded value or raise StopAsyncIteration.
        N)r;   )r-   r<   r=   r>   r    r    r!   athrow   s    
zAsyncGenerator.athrowc                s:   y| j tI dH  W n ttfk
r,   Y n
X tddS )z.Raise GeneratorExit inside coroutine.
        Nz,asynchronous generator ignored GeneratorExit)rG   r@   rD   rA   )r-   r    r    r!   aclose   s
    zAsyncGenerator.aclosec             C   s   | t krt|dddddS tS )NrC   rE   rF   rG   rH   )r   r,   r'   )r/   r(   r    r    r!   r0      s    
zAsyncGenerator.__subclasshook__)NN)r1   r2   r3   r4   rE   r   rF   rG   rH   r5   r0   r    r    r    r!   r      s   
c               @   s(   e Zd Zf Zedd Zedd ZdS )r
   c             c   s   d S )Nr    )r-   r    r    r!   __iter__   s    zIterable.__iter__c             C   s   | t krt|dS tS )NrI   )r
   r,   r'   )r/   r(   r    r    r!   r0      s    
zIterable.__subclasshook__N)r1   r2   r3   r4   r   rI   r5   r0   r    r    r    r!   r
      s   c               @   s0   e Zd Zf Zedd Zdd Zedd ZdS )r   c             C   s   t dS )zKReturn the next item from the iterator. When exhausted, raise StopIterationN)r8   )r-   r    r    r!   __next__  s    zIterator.__next__c             C   s   | S )Nr    )r-   r    r    r!   rI     s    zIterator.__iter__c             C   s   | t krt|ddS tS )NrI   rJ   )r   r,   r'   )r/   r(   r    r    r!   r0     s    zIterator.__subclasshook__N)	r1   r2   r3   r4   r   rJ   rI   r5   r0   r    r    r    r!   r     s   c               @   s(   e Zd Zf Zedd Zedd ZdS )r   c             c   s   d S )Nr    )r-   r    r    r!   __reversed__)  s    zReversible.__reversed__c             C   s   | t krt|ddS tS )NrK   rI   )r   r,   r'   )r/   r(   r    r    r!   r0   .  s    zReversible.__subclasshook__N)r1   r2   r3   r4   r   rK   r5   r0   r    r    r    r!   r   %  s   c               @   sF   e Zd Zf Zdd Zedd ZedddZdd	 Ze	d
d Z
dS )r   c             C   s
   | j dS )z^Return the next item from the generator.
        When exhausted, raise StopIteration.
        N)r:   )r-   r    r    r!   rJ   9  s    zGenerator.__next__c             C   s   t dS )zcSend a value into the generator.
        Return next yielded value or raise StopIteration.
        N)r8   )r-   r9   r    r    r!   r:   ?  s    zGenerator.sendNc             C   s4   |dkr|dkr|| }|dk	r,|j |}|dS )zgRaise an exception in the generator.
        Return next yielded value or raise StopIteration.
        N)r;   )r-   r<   r=   r>   r    r    r!   r?   F  s    
zGenerator.throwc             C   s4   y| j t W n ttfk
r&   Y n
X tddS )z.Raise GeneratorExit inside generator.
        zgenerator ignored GeneratorExitN)r?   r@   r8   rA   )r-   r    r    r!   rB   S  s
    zGenerator.closec             C   s   | t krt|dddddS tS )NrI   rJ   r:   r?   rB   )r   r,   r'   )r/   r(   r    r    r!   r0   ]  s    
zGenerator.__subclasshook__)NN)r1   r2   r3   r4   rJ   r   r:   r?   rB   r5   r0   r    r    r    r!   r   5  s   
c               @   s(   e Zd Zf Zedd Zedd ZdS )r   c             C   s   dS )Nr   r    )r-   r    r    r!   __len__k  s    zSized.__len__c             C   s   | t krt|dS tS )NrL   )r   r,   r'   )r/   r(   r    r    r!   r0   o  s    
zSized.__subclasshook__N)r1   r2   r3   r4   r   rL   r5   r0   r    r    r    r!   r   g  s   c               @   s(   e Zd Zf Zedd Zedd ZdS )r   c             C   s   dS )NFr    )r-   xr    r    r!   __contains__z  s    zContainer.__contains__c             C   s   | t krt|dS tS )NrN   )r   r,   r'   )r/   r(   r    r    r!   r0   ~  s    
zContainer.__subclasshook__N)r1   r2   r3   r4   r   rN   r5   r0   r    r    r    r!   r   v  s   c               @   s   e Zd Zf Zedd ZdS )r   c             C   s   | t krt|dddS tS )NrL   rI   rN   )r   r,   r'   )r/   r(   r    r    r!   r0     s    zCollection.__subclasshook__N)r1   r2   r3   r4   r5   r0   r    r    r    r!   r     s   c               @   s(   e Zd Zf Zedd Zedd ZdS )r   c             O   s   dS )NFr    )r-   argskwdsr    r    r!   __call__  s    zCallable.__call__c             C   s   | t krt|dS tS )NrQ   )r   r,   r'   )r/   r(   r    r    r!   r0     s    
zCallable.__subclasshook__N)r1   r2   r3   r4   r   rQ   r5   r0   r    r    r    r!   r     s   c               @   s   e Zd ZdZf Zdd Zdd Zdd Zdd	 Zd
d Z	e
dd Zdd ZeZdd Zdd ZeZdd Zdd Zdd ZeZdd ZdS )r   aZ  A 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.
    c             C   s@   t |tstS t| t|kr"dS x| D ]}||kr(dS q(W dS )NFT)
isinstancer   r'   len)r-   otherelemr    r    r!   __le__  s    

z
Set.__le__c             C   s(   t |tstS t| t|k o&| j|S )N)rR   r   r'   rS   rV   )r-   rT   r    r    r!   __lt__  s    
z
Set.__lt__c             C   s(   t |tstS t| t|ko&| j|S )N)rR   r   r'   rS   __ge__)r-   rT   r    r    r!   __gt__  s    
z
Set.__gt__c             C   s@   t |tstS t| t|k r"dS x|D ]}|| kr(dS q(W dS )NFT)rR   r   r'   rS   )r-   rT   rU   r    r    r!   rX     s    

z
Set.__ge__c             C   s(   t |tstS t| t|ko&| j|S )N)rR   r   r'   rS   rV   )r-   rT   r    r    r!   __eq__  s    
z
Set.__eq__c             C   s   | |S )zConstruct 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/   itr    r    r!   _from_iterable  s    zSet._from_iterablec                s&   t |tstS  j fdd|D S )Nc             3   s   | ]}| kr|V  qd S )Nr    ).0r9   )r-   r    r!   	<genexpr>  s    zSet.__and__.<locals>.<genexpr>)rR   r
   r'   r\   )r-   rT   r    )r-   r!   __and__  s    
zSet.__and__c             C   s   x|D ]}|| krdS qW dS )z1Return True if two sets have a null intersection.FTr    )r-   rT   r9   r    r    r!   
isdisjoint  s    
zSet.isdisjointc             C   s*   t |tstS dd | |fD }| j|S )Nc             s   s   | ]}|D ]
}|V  q
qd S )Nr    )r]   ser    r    r!   r^     s    zSet.__or__.<locals>.<genexpr>)rR   r
   r'   r\   )r-   rT   Zchainr    r    r!   __or__  s    
z
Set.__or__c                s:   t  ts"t  tstS | j  | j fdd| D S )Nc             3   s   | ]}| kr|V  qd S )Nr    )r]   r9   )rT   r    r!   r^     s    zSet.__sub__.<locals>.<genexpr>)rR   r   r
   r'   r\   )r-   rT   r    )rT   r!   __sub__  s
    


zSet.__sub__c                s:   t |ts"t |tstS  j|} j fdd|D S )Nc             3   s   | ]}| kr|V  qd S )Nr    )r]   r9   )r-   r    r!   r^     s    zSet.__rsub__.<locals>.<genexpr>)rR   r   r
   r'   r\   )r-   rT   r    )r-   r!   __rsub__  s
    


zSet.__rsub__c             C   s2   t |ts"t |tstS | j|}| | ||  B S )N)rR   r   r
   r'   r\   )r-   rT   r    r    r!   __xor__   s
    


zSet.__xor__c             C   s   t j}d| d }t| }d|d  }||M }x4| D ],}t|}|||d> A dA d N }||M }q4W |d d }||M }||kr||d 8 }|d
krd	}|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.
           r   iMr   iM[l   4~2 i i6i8#)sysmaxsizerS   hash)r-   ZMAXZMASKnhrM   Zhxr    r    r!   _hash	  s     
z	Set._hashN)r1   r2   r3   __doc__r4   rV   rW   rY   rX   rZ   r5   r\   r_   __rand__r`   rc   __ror__rd   re   rf   __rxor__ro   r    r    r    r!   r     s$   


	c               @   sd   e Zd ZdZf Zedd Zedd Zdd Zdd	 Z	d
d Z
dd Zdd Zdd Zdd ZdS )r   a  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.
    c             C   s   t dS )zAdd an element.N)NotImplementedError)r-   r9   r    r    r!   add:  s    zMutableSet.addc             C   s   t dS )z8Remove an element.  Do not raise an exception if absent.N)rt   )r-   r9   r    r    r!   discard?  s    zMutableSet.discardc             C   s   || krt || j| dS )z5Remove an element. If not a member, raise a KeyError.N)KeyErrorrv   )r-   r9   r    r    r!   removeD  s    zMutableSet.removec             C   s<   t | }yt|}W n tk
r,   tY nX | j| |S )z2Return the popped value.  Raise KeyError if empty.)iternextr8   rw   rv   )r-   r[   r9   r    r    r!   popJ  s    

zMutableSet.popc             C   s,   yx| j   qW W n tk
r&   Y nX dS )z6This is slow (creates N new iterators!) but effective.N)r{   rw   )r-   r    r    r!   clearT  s
    zMutableSet.clearc             C   s   x|D ]}| j | qW | S )N)ru   )r-   r[   r9   r    r    r!   __ior__\  s    
zMutableSet.__ior__c             C   s    x| | D ]}| j | q
W | S )N)rv   )r-   r[   r9   r    r    r!   __iand__a  s    zMutableSet.__iand__c             C   sV   || kr| j   n@t|ts&| j|}x*|D ]"}|| krD| j| q,| j| q,W | S )N)r|   rR   r   r\   rv   ru   )r-   r[   r9   r    r    r!   __ixor__f  s    



zMutableSet.__ixor__c             C   s.   || kr| j   nx|D ]}| j| qW | S )N)r|   rv   )r-   r[   r9   r    r    r!   __isub__s  s
    

zMutableSet.__isub__N)r1   r2   r3   rp   r4   r   ru   rv   rx   r{   r|   r}   r~   r   r   r    r    r    r!   r   ,  s   

c               @   sR   e Zd Zf Zedd ZdddZdd Zdd	 Zd
d Z	dd Z
dd ZdZdS )r   c             C   s   t d S )N)rw   )r-   keyr    r    r!   __getitem__  s    zMapping.__getitem__Nc             C   s"   y| | S  t k
r   |S X dS )z<D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.N)rw   )r-   r   defaultr    r    r!   get  s    zMapping.getc             C   s*   y| |  W n t k
r    dS X dS d S )NFT)rw   )r-   r   r    r    r!   rN     s
    zMapping.__contains__c             C   s   t | S )z:D.keys() -> a set-like object providing a view on D's keys)r   )r-   r    r    r!   keys  s    zMapping.keysc             C   s   t | S )z<D.items() -> a set-like object providing a view on D's items)r   )r-   r    r    r!   items  s    zMapping.itemsc             C   s   t | S )z6D.values() -> an object providing a view on D's values)r   )r-   r    r    r!   values  s    zMapping.valuesc             C   s&   t |tstS t| j t|j kS )N)rR   r   r'   dictr   )r-   rT   r    r    r!   rZ     s    
zMapping.__eq__)N)r1   r2   r3   r4   r   r   r   rN   r   r   r   rZ   rK   r    r    r    r!   r     s   

c               @   s(   e Zd Zd	Zdd Zdd Zdd ZdS )
r   _mappingc             C   s
   || _ d S )N)r   )r-   Zmappingr    r    r!   __init__  s    zMappingView.__init__c             C   s
   t | jS )N)rS   r   )r-   r    r    r!   rL     s    zMappingView.__len__c             C   s
   dj | S )Nz&{0.__class__.__name__}({0._mapping!r}))format)r-   r    r    r!   __repr__  s    zMappingView.__repr__N)r   )r1   r2   r3   r4   r   rL   r   r    r    r    r!   r     s   c               @   s,   e Zd Zf Zedd Zdd Zdd ZdS )r   c             C   s   t |S )N)set)r-   r[   r    r    r!   r\     s    zKeysView._from_iterablec             C   s
   || j kS )N)r   )r-   r   r    r    r!   rN     s    zKeysView.__contains__c             c   s   | j E d H  d S )N)r   )r-   r    r    r!   rI     s    zKeysView.__iter__N)r1   r2   r3   r4   r5   r\   rN   rI   r    r    r    r!   r     s   c               @   s,   e Zd Zf Zedd Zdd Zdd ZdS )r   c             C   s   t |S )N)r   )r-   r[   r    r    r!   r\     s    zItemsView._from_iterablec             C   s@   |\}}y| j | }W n tk
r*   dS X ||kp:||kS d S )NF)r   rw   )r-   itemr   r9   vr    r    r!   rN     s    zItemsView.__contains__c             c   s$   x| j D ]}|| j | fV  qW d S )N)r   )r-   r   r    r    r!   rI     s    zItemsView.__iter__N)r1   r2   r3   r4   r5   r\   rN   rI   r    r    r    r!   r     s   	c               @   s    e Zd Zf Zdd Zdd ZdS )r   c             C   s2   x,| j D ]"}| j | }||ks&||krdS qW dS )NTF)r   )r-   r9   r   r   r    r    r!   rN     s
    
zValuesView.__contains__c             c   s    x| j D ]}| j | V  qW d S )N)r   )r-   r   r    r    r!   rI     s    zValuesView.__iter__N)r1   r2   r3   r4   rN   rI   r    r    r    r!   r     s   c               @   s\   e Zd Zf Zedd Zedd Ze ZefddZ	dd Z
d	d
 Zdd ZdddZdS )r   c             C   s   t d S )N)rw   )r-   r   r9   r    r    r!   __setitem__  s    zMutableMapping.__setitem__c             C   s   t d S )N)rw   )r-   r   r    r    r!   __delitem__  s    zMutableMapping.__delitem__c             C   s<   y| | }W n  t k
r,   || jkr( |S X | |= |S dS )zD.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)rw   _MutableMapping__marker)r-   r   r   r9   r    r    r!   r{     s    
zMutableMapping.popc             C   s@   yt t| }W n tk
r(   tY nX | | }| |= ||fS )zD.popitem() -> (k, v), remove and return some (key, value) pair
           as a 2-tuple; but raise KeyError if D is empty.
        )rz   ry   r8   rw   )r-   r   r9   r    r    r!   popitem$  s    
zMutableMapping.popitemc             C   s,   yx| j   qW W n tk
r&   Y nX dS )z,D.clear() -> None.  Remove all items from D.N)r   rw   )r-   r    r    r!   r|   0  s
    zMutableMapping.clearc              O   s   | st d| ^}} t| dkr0t dt|  | r| d }t|trbx^|D ]}|| ||< qLW nDt|drx8|j D ]}|| ||< qvW nx|D ]\}}|||< qW x|j D ]\}}|||< qW dS )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 argumentr   z+update expected at most 1 arguments, got %dr   r   N)	TypeErrorrS   rR   r   hasattrr   r   )rO   rP   r-   rT   r   r9   r    r    r!   update8  s$    


zMutableMapping.updateNc             C   s*   y| | S  t k
r$   || |< Y nX |S )z@D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D)rw   )r-   r   r   r    r    r!   
setdefaultS  s
    zMutableMapping.setdefault)N)r1   r2   r3   r4   r   r   r   objectr   r{   r   r|   r   r   r    r    r    r!   r     s   c               @   sJ   e Zd ZdZf Zedd Zdd Zdd Zdd	 Z	dddZ
dd ZdS )r   zAll the operations on a read-only sequence.

    Concrete subclasses must override __new__ or __init__,
    __getitem__, and __len__.
    c             C   s   t d S )N)
IndexError)r-   indexr    r    r!   r   k  s    zSequence.__getitem__c             c   s>   d}y x| | }|V  |d7 }qW W n t k
r8   d S X d S )Nr   r   )r   )r-   ir   r    r    r!   rI   o  s    zSequence.__iter__c             C   s&   x | D ]}||ks||krdS qW dS )NTFr    )r-   r9   r   r    r    r!   rN   y  s    
zSequence.__contains__c             c   s(   x"t tt| D ]}| | V  qW d S )N)reversedrangerS   )r-   r   r    r    r!   rK     s    zSequence.__reversed__r   Nc             C   s   |dk	r"|dk r"t t| | d}|dk	r>|dk r>|t| 7 }|}xT|dksT||k ry | | }||ksn||krr|S W n tk
r   P Y nX |d7 }qDW tdS )zS.index(value, [start, [stop]]) -> integer -- return first index of value.
           Raises ValueError if the value is not present.

           Supporting start and stop arguments is optional, but
           recommended.
        Nr   r   )maxrS   r   
ValueError)r-   r9   startstopr   r   r    r    r!   r     s    zSequence.indexc                s   t  fdd| D S )zBS.count(value) -> integer -- return number of occurrences of valuec             3   s"   | ]}| ks| krd V  qdS )r   Nr    )r]   r   )r9   r    r!   r^     s    z!Sequence.count.<locals>.<genexpr>)sum)r-   r9   r    )r9   r!   count  s    zSequence.count)r   N)r1   r2   r3   rp   r4   r   r   rI   rN   rK   r   r   r    r    r    r!   r   a  s   

c               @   s   e Zd ZdZf ZdS )r   zMThis unifies bytes and bytearray.

    XXX Should add all their methods.
    N)r1   r2   r3   rp   r4   r    r    r    r!   r     s   c               @   sn   e Zd Zf Zedd Zedd Zedd Zdd Zd	d
 Z	dd Z
dd ZdddZdd Zdd ZdS )r   c             C   s   t d S )N)r   )r-   r   r9   r    r    r!   r     s    zMutableSequence.__setitem__c             C   s   t d S )N)r   )r-   r   r    r    r!   r     s    zMutableSequence.__delitem__c             C   s   t dS )z3S.insert(index, value) -- insert value before indexN)r   )r-   r   r9   r    r    r!   insert  s    zMutableSequence.insertc             C   s   | j t| | dS )z:S.append(value) -- append value to the end of the sequenceN)r   rS   )r-   r9   r    r    r!   append  s    zMutableSequence.appendc             C   s,   yx| j   qW W n tk
r&   Y nX dS )z,S.clear() -> None -- remove all items from SN)r{   r   )r-   r    r    r!   r|     s
    zMutableSequence.clearc             C   sL   t | }x>t|d D ].}| || d  | |  | |< | || d < qW dS )z!S.reverse() -- reverse *IN PLACE*rg   r   N)rS   r   )r-   rm   r   r    r    r!   reverse  s    zMutableSequence.reversec             C   s   x|D ]}| j | qW dS )zMS.extend(iterable) -- extend sequence by appending elements from the iterableN)r   )r-   r   r   r    r    r!   extend  s    
zMutableSequence.extendr   c             C   s   | | }| |= |S )zS.pop([index]) -> item -- remove and return item at index (default last).
           Raise IndexError if list is empty or index is out of range.
        r    )r-   r   r   r    r    r!   r{     s    zMutableSequence.popc             C   s   | | j |= dS )zvS.remove(value) -- remove first occurrence of value.
           Raise ValueError if the value is not present.
        N)r   )r-   r9   r    r    r!   rx     s    zMutableSequence.removec             C   s   | j | | S )N)r   )r-   r   r    r    r!   __iadd__  s    
zMutableSequence.__iadd__Nri   )ri   )r1   r2   r3   r4   r   r   r   r   r   r|   r   r   r{   rx   r   r    r    r    r!   r     s   	
)Krp   abcr   r   rj   __all__r1   typery   Zbytes_iterator	bytearrayZbytearray_iteratorr   Zdict_keyiteratorr   Zdict_valueiteratorr   Zdict_itemiteratorZlist_iteratorr   Zlist_reverseiteratorr   Zrange_iteratorZlongrange_iteratorr   Zset_iteratorZstr_iteratorZtuple_iteratorzipZzip_iteratorZ	dict_keysZdict_valuesZ
dict_itemsr&   ZmappingproxyZ	generatorr#   Z	coroutinerB   r$   Zasync_generatorr,   r	   r   r   registerr   r   r   r
   r   r   r   r   r   r   r   r   	frozensetr   r   r   r   r   r   r   r   r   tuplestr
memoryviewr   bytesr   listr    r    r    r!   <module>   s   
	
)
0













/

 

O
2



\
=



	

A
