B
    u9a8g                 @   sp  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  Zeei  Zeei  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d!Zeee Zei  Zei  Zei  Zeej Z!ed"d#  Z"d$d% Z#e# Z#ee#Z$e#%  [#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+,e$ G d.d ded+Z-G d/d de-Z.G d0d de.Z/e/,e' G d1d	 d	ed+Z0G d2d
 d
e0Z1e1,e e1,e
 e1,e e1,e e1,e e1,e e1,e e1,e e1,e e1,e e1,e e1,e e1,e G d3d de0Z2G d4d de1Z3e3,e" G d5d ded+Z4G d6d ded+Z5G d7d de4e0e5Z6G d8d ded+Z7G d9d de6Z8e8,e9 G d:d de8Z:e:,e G d;d de6Z;e;,e! G d<d de4Z<G d=d de<e8Z=e=,e G d>d de<e8Z>e>,e G d?d de<e6Z?e?,e G d@d de;Z@e@,eA G dAd de2e6ZBeB,eC eB,eD eB,e eB,eE G dBd deBZFeF,eG eF,e	 G dCd deBZHeH,eI eH,e	 dS )D    )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 )Nr    r    r    r    &/usr/lib/python3.7/_collections_abc.py<lambda>8   r   r"   c                  s   d S )Nr    r    r    r    r!   _coro:   r   r#   c               C  s
   d V  d S )Nr    r    r    r    r!   _ag@   r   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)CmethodsmromethodBr    r    r!   _check_methodsH   s    


r-   c               @   s(   e Zd ZdZedd Zedd ZdS )r	   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/   classmethodr1   r    r    r    r!   r	   T   s   )	metaclassc               @   s(   e Zd ZdZedd Zedd ZdS )r   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 )Nr8   )r   r-   r'   )r0   r(   r    r    r!   r1   k   s    
zAwaitable.__subclasshook__N)r2   r3   r4   r5   r   r8   r6   r1   r    r    r    r!   r   c   s   c               @   s>   e Zd ZdZedd ZedddZdd Zed	d
 Z	dS )r   r    c             C   s   t d S )N)StopIteration)r.   valuer    r    r!   sendv   s    zCoroutine.sendNc             C   s4   |d kr|d kr|| }|d k	r,| |}|d S )N)with_traceback)r.   typvaltbr    r    r!   throw}   s    
zCoroutine.throwc          	   C   s4   y|  t W n ttfk
r&   Y n
X tdd S )Nzcoroutine ignored GeneratorExit)r@   GeneratorExitr9   RuntimeError)r.   r    r    r!   close   s
    zCoroutine.closec             C   s   | t krt|ddddS tS )Nr8   r;   r@   rC   )r   r-   r'   )r0   r(   r    r    r!   r1      s    zCoroutine.__subclasshook__)NN)
r2   r3   r4   r5   r   r;   r@   rC   r6   r1   r    r    r    r!   r   r   s   
c               @   s(   e Zd ZdZedd Zedd ZdS )r   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 )NrD   )r   r-   r'   )r0   r(   r    r    r!   r1      s    
zAsyncIterable.__subclasshook__N)r2   r3   r4   r5   r   rD   r6   r1   r    r    r    r!   r      s   c               @   s0   e Zd ZdZedd Zdd Zedd ZdS )	r   r    c                s   t d S )N)StopAsyncIteration)r.   r    r    r!   	__anext__   s    zAsyncIterator.__anext__c             C   s   | S )Nr    )r.   r    r    r!   rD      s    zAsyncIterator.__aiter__c             C   s   | t krt|ddS tS )NrF   rD   )r   r-   r'   )r0   r(   r    r    r!   r1      s    zAsyncIterator.__subclasshook__N)	r2   r3   r4   r5   r   rF   rD   r6   r1   r    r    r    r!   r      s   c               @   sF   e Zd ZdZdd Zedd ZedddZd	d
 Ze	dd Z
dS )r   r    c                s   |  d I d H S )N)asend)r.   r    r    r!   rF      s    zAsyncGenerator.__anext__c                s   t d S )N)rE   )r.   r:   r    r    r!   rG      s    zAsyncGenerator.asendNc                s4   |d kr|d kr|| }|d k	r,| |}|d S )N)r<   )r.   r=   r>   r?   r    r    r!   athrow   s    
zAsyncGenerator.athrowc          	      s:   y|  tI d H  W n ttfk
r,   Y n
X tdd S )Nz,asynchronous generator ignored GeneratorExit)rH   rA   rE   rB   )r.   r    r    r!   aclose   s
    zAsyncGenerator.aclosec             C   s   | t krt|dddddS tS )NrD   rF   rG   rH   rI   )r   r-   r'   )r0   r(   r    r    r!   r1      s    
zAsyncGenerator.__subclasshook__)NN)r2   r3   r4   r5   rF   r   rG   rH   rI   r6   r1   r    r    r    r!   r      s   
c               @   s(   e Zd ZdZedd Zedd ZdS )r
   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 )NrJ   )r
   r-   r'   )r0   r(   r    r    r!   r1      s    
zIterable.__subclasshook__N)r2   r3   r4   r5   r   rJ   r6   r1   r    r    r    r!   r
      s   c               @   s0   e Zd ZdZedd Zdd Zedd ZdS )	r   r    c             C   s   t d S )N)r9   )r.   r    r    r!   __next__  s    zIterator.__next__c             C   s   | S )Nr    )r.   r    r    r!   rJ     s    zIterator.__iter__c             C   s   | t krt|ddS tS )NrJ   rK   )r   r-   r'   )r0   r(   r    r    r!   r1     s    zIterator.__subclasshook__N)	r2   r3   r4   r5   r   rK   rJ   r6   r1   r    r    r    r!   r     s   c               @   s(   e Zd ZdZedd Zedd ZdS )r   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 )NrL   rJ   )r   r-   r'   )r0   r(   r    r    r!   r1   .  s    zReversible.__subclasshook__N)r2   r3   r4   r5   r   rL   r6   r1   r    r    r    r!   r   %  s   c               @   sF   e Zd ZdZdd Zedd ZedddZd	d
 Ze	dd Z
dS )r   r    c             C   s
   |  d S )N)r;   )r.   r    r    r!   rK   9  s    zGenerator.__next__c             C   s   t d S )N)r9   )r.   r:   r    r    r!   r;   ?  s    zGenerator.sendNc             C   s4   |d kr|d kr|| }|d k	r,| |}|d S )N)r<   )r.   r=   r>   r?   r    r    r!   r@   F  s    
zGenerator.throwc          	   C   s4   y|  t W n ttfk
r&   Y n
X tdd S )Nzgenerator ignored GeneratorExit)r@   rA   r9   rB   )r.   r    r    r!   rC   S  s
    zGenerator.closec             C   s   | t krt|dddddS tS )NrJ   rK   r;   r@   rC   )r   r-   r'   )r0   r(   r    r    r!   r1   ]  s    
zGenerator.__subclasshook__)NN)r2   r3   r4   r5   rK   r   r;   r@   rC   r6   r1   r    r    r    r!   r   5  s   
c               @   s(   e Zd ZdZedd Zedd ZdS )r   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 )NrM   )r   r-   r'   )r0   r(   r    r    r!   r1   o  s    
zSized.__subclasshook__N)r2   r3   r4   r5   r   rM   r6   r1   r    r    r    r!   r   g  s   c               @   s(   e Zd ZdZedd Zedd ZdS )r   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 )NrO   )r   r-   r'   )r0   r(   r    r    r!   r1   ~  s    
zContainer.__subclasshook__N)r2   r3   r4   r5   r   rO   r6   r1   r    r    r    r!   r   v  s   c               @   s   e Zd ZdZedd ZdS )r   r    c             C   s   | t krt|dddS tS )NrM   rJ   rO   )r   r-   r'   )r0   r(   r    r    r!   r1     s    zCollection.__subclasshook__N)r2   r3   r4   r5   r6   r1   r    r    r    r!   r     s   c               @   s(   e Zd ZdZedd Zedd ZdS )r   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 )NrR   )r   r-   r'   )r0   r(   r    r    r!   r1     s    
zCallable.__subclasshook__N)r2   r3   r4   r5   r   rR   r6   r1   r    r    r    r!   r     s   c               @   s   e Zd Zd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   r    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&| |S )N)rS   r   r'   rT   rW   )r.   rU   r    r    r!   __lt__  s    
z
Set.__lt__c             C   s(   t |tstS t| t|ko&| |S )N)rS   r   r'   rT   __ge__)r.   rU   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)rS   r   r'   rT   )r.   rU   rV   r    r    r!   rY     s    

z
Set.__ge__c             C   s(   t |tstS t| t|ko&| |S )N)rS   r   r'   rT   rW   )r.   rU   r    r    r!   __eq__  s    
z
Set.__eq__c             C   s   | |S )Nr    )r0   itr    r    r!   _from_iterable  s    zSet._from_iterablec                s&   t |tstS   fdd|D S )Nc             3   s   | ]}| kr|V  qd S )Nr    ).0r:   )r.   r    r!   	<genexpr>  s    zSet.__and__.<locals>.<genexpr>)rS   r
   r'   r]   )r.   rU   r    )r.   r!   __and__  s    
zSet.__and__c             C   s   x|D ]}|| krdS qW dS )NFTr    )r.   rU   r:   r    r    r!   
isdisjoint  s    
zSet.isdisjointc             C   s*   t |tstS dd | |fD }| |S )Nc             s   s   | ]}|D ]
}|V  q
qd S )Nr    )r^   ser    r    r!   r_     s    zSet.__or__.<locals>.<genexpr>)rS   r
   r'   r]   )r.   rU   chainr    r    r!   __or__  s    
z
Set.__or__c                s:   t  ts"t  tstS |   |  fdd| D S )Nc             3   s   | ]}| kr|V  qd S )Nr    )r^   r:   )rU   r    r!   r_     s    zSet.__sub__.<locals>.<genexpr>)rS   r   r
   r'   r]   )r.   rU   r    )rU   r!   __sub__  s
    


zSet.__sub__c                s:   t |ts"t |tstS  |}  fdd|D S )Nc             3   s   | ]}| kr|V  qd S )Nr    )r^   r:   )r.   r    r!   r_     s    zSet.__rsub__.<locals>.<genexpr>)rS   r   r
   r'   r]   )r.   rU   r    )r.   r!   __rsub__  s
    


zSet.__rsub__c             C   s2   t |ts"t |tstS | |}| | ||  B S )N)rS   r   r
   r'   r]   )r.   rU   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 )N   r   iMr   iM[l   4~2 i i6i8#)sysmaxsizerT   hash)r.   MAXMASKnhrN   hxr    r    r!   _hash	  s     
z	Set._hashN)r2   r3   r4   r5   rW   rX   rZ   rY   r[   r6   r]   r`   __rand__ra   re   __ror__rf   rg   rh   __rxor__rt   r    r    r    r!   r     s"   

	c               @   s`   e Zd Zd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   r    c             C   s   t d S )N)NotImplementedError)r.   r:   r    r    r!   add:  s    zMutableSet.addc             C   s   t d S )N)rx   )r.   r:   r    r    r!   discard?  s    zMutableSet.discardc             C   s   || krt || | d S )N)KeyErrorrz   )r.   r:   r    r    r!   removeD  s    zMutableSet.removec             C   s>   t | }yt|}W n tk
r.   td Y nX | | |S )N)iternextr9   r{   rz   )r.   r\   r:   r    r    r!   popJ  s    
zMutableSet.popc             C   s,   yx|    qW W n tk
r&   Y nX d S )N)r   r{   )r.   r    r    r!   clearT  s
    zMutableSet.clearc             C   s   x|D ]}|  | qW | S )N)ry   )r.   r\   r:   r    r    r!   __ior__\  s    
zMutableSet.__ior__c             C   s    x| | D ]}|  | q
W | S )N)rz   )r.   r\   r:   r    r    r!   __iand__a  s    zMutableSet.__iand__c             C   sV   || kr|    n@t|ts&| |}x*|D ]"}|| krD| | q,| | q,W | S )N)r   rS   r   r]   rz   ry   )r.   r\   r:   r    r    r!   __ixor__f  s    



zMutableSet.__ixor__c             C   s.   || kr|    nx|D ]}| | qW | S )N)r   rz   )r.   r\   r:   r    r    r!   __isub__s  s
    

zMutableSet.__isub__N)r2   r3   r4   r5   r   ry   rz   r|   r   r   r   r   r   r   r    r    r    r!   r   ,  s   
c               @   sR   e Zd Zd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   r    c             C   s   t d S )N)r{   )r.   keyr    r    r!   __getitem__  s    zMapping.__getitem__Nc             C   s"   y| | S  t k
r   |S X d S )N)r{   )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)r{   )r.   r   r    r    r!   rO     s
    zMapping.__contains__c             C   s   t | S )N)r   )r.   r    r    r!   keys  s    zMapping.keysc             C   s   t | S )N)r   )r.   r    r    r!   items  s    zMapping.itemsc             C   s   t | S )N)r   )r.   r    r    r!   values  s    zMapping.valuesc             C   s&   t |tstS t|  t| kS )N)rS   r   r'   dictr   )r.   rU   r    r    r!   r[     s    
zMapping.__eq__)N)r2   r3   r4   r5   r   r   r   rO   r   r   r   r[   rL   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.   mappingr    r    r!   __init__  s    zMappingView.__init__c             C   s
   t | jS )N)rT   r   )r.   r    r    r!   rM     s    zMappingView.__len__c             C   s
   d | S )Nz&{0.__class__.__name__}({0._mapping!r}))format)r.   r    r    r!   __repr__  s    zMappingView.__repr__N)r2   r3   r4   r5   r   rM   r   r    r    r    r!   r     s   c               @   s,   e Zd ZdZedd Zdd Zdd ZdS )	r   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!   rO     s    zKeysView.__contains__c             c   s   | j E d H  d S )N)r   )r.   r    r    r!   rJ     s    zKeysView.__iter__N)r2   r3   r4   r5   r6   r]   rO   rJ   r    r    r    r!   r     s   c               @   s,   e Zd ZdZedd Zdd Zdd ZdS )	r   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   r{   )r.   itemr   r:   vr    r    r!   rO     s    zItemsView.__contains__c             c   s$   x| j D ]}|| j | fV  qW d S )N)r   )r.   r   r    r    r!   rJ     s    zItemsView.__iter__N)r2   r3   r4   r5   r6   r]   rO   rJ   r    r    r    r!   r     s   	c               @   s    e Zd ZdZdd Zdd ZdS )r   r    c             C   s2   x,| j D ]"}| j | }||ks&||krdS qW dS )NTF)r   )r.   r:   r   r   r    r    r!   rO     s
    
zValuesView.__contains__c             c   s    x| j D ]}| j | V  qW d S )N)r   )r.   r   r    r    r!   rJ     s    zValuesView.__iter__N)r2   r3   r4   r5   rO   rJ   r    r    r    r!   r     s   c               @   s\   e Zd Zd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   r    c             C   s   t d S )N)r{   )r.   r   r:   r    r    r!   __setitem__  s    zMutableMapping.__setitem__c             C   s   t d S )N)r{   )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 )N)r{   _MutableMapping__marker)r.   r   r   r:   r    r    r!   r     s    
zMutableMapping.popc             C   sB   yt t| }W n tk
r*   td Y nX | | }| |= ||fS )N)r~   r}   r9   r{   )r.   r   r:   r    r    r!   popitem$  s    zMutableMapping.popitemc             C   s,   yx|    qW W n tk
r&   Y nX d S )N)r   r{   )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| D ]}|| ||< qvW nx|D ]\}}|||< qW x| D ]\}}|||< qW d S )Nz@descriptor 'update' of 'MutableMapping' object needs an argumentr   z+update expected at most 1 arguments, got %dr   r   )	TypeErrorrT   rS   r   hasattrr   r   )rP   rQ   r.   rU   r   r:   r    r    r!   update8  s$    


zMutableMapping.updateNc             C   s*   y| | S  t k
r$   || |< Y nX |S )N)r{   )r.   r   r   r    r    r!   
setdefaultS  s
    zMutableMapping.setdefault)N)r2   r3   r4   r5   r   r   r   objectr   r   r   r   r   r   r    r    r    r!   r     s   c               @   sF   e Zd ZdZedd Zdd Zdd Zdd	 ZdddZ	dd Z
dS )r   r    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!   rJ   o  s    zSequence.__iter__c             C   s&   x | D ]}||ks||krdS qW dS )NTFr    )r.   r:   r   r    r    r!   rO   y  s    
zSequence.__contains__c             c   s(   x"t tt| D ]}| | V  qW d S )N)reversedrangerT   )r.   r   r    r    r!   rL     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 )Nr   r   )maxrT   r   
ValueError)r.   r:   startstopr   r   r    r    r!   r     s    zSequence.indexc                s   t  fdd| D S )Nc             3   s"   | ]}| ks| krd V  qdS )r   Nr    )r^   r   )r:   r    r!   r_     s    z!Sequence.count.<locals>.<genexpr>)sum)r.   r:   r    )r:   r!   count  s    zSequence.count)r   N)r2   r3   r4   r5   r   r   rJ   rO   rL   r   r   r    r    r    r!   r   a  s   

c               @   s   e Zd ZdZdS )r   r    N)r2   r3   r4   r5   r    r    r    r!   r     s   c               @   sn   e Zd Zd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   r    c             C   s   t d S )N)r   )r.   r   r:   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 )N)r   )r.   r   r:   r    r    r!   insert  s    zMutableSequence.insertc             C   s   |  t| | d S )N)r   rT   )r.   r:   r    r    r!   append  s    zMutableSequence.appendc             C   s,   yx|    qW W n tk
r&   Y nX d S )N)r   r   )r.   r    r    r!   r     s
    zMutableSequence.clearc             C   sL   t | }x>t|d D ].}| || d  | |  | |< | || d < qW d S )Nri   r   )rT   r   )r.   rq   r   r    r    r!   reverse  s    zMutableSequence.reversec             C   s   x|D ]}|  | qW d S )N)r   )r.   r   r   r    r    r!   extend  s    
zMutableSequence.extendrk   c             C   s   | | }| |= |S )Nr    )r.   r   r   r    r    r!   r     s    zMutableSequence.popc             C   s   | |  |= d S )N)r   )r.   r:   r    r    r!   r|     s    zMutableSequence.removec             C   s   |  | | S )N)r   )r.   r   r    r    r!   __iadd__  s    
zMutableSequence.__iadd__N)rk   )r2   r3   r4   r5   r   r   r   r   r   r   r   r   r   r|   r   r    r    r    r!   r     s   	
)Jabcr   r   rl   __all__r2   typer}   bytes_iterator	bytearraybytearray_iteratorr   dict_keyiteratorr   dict_valueiteratorr   dict_itemiteratorlist_iteratorr   list_reverseiteratorr   range_iteratorlongrange_iteratorr   set_iteratorstr_iteratortuple_iteratorzipzip_iterator	dict_keysdict_values
dict_itemsr&   mappingproxy	generatorr#   	coroutinerC   r$   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
