o
    X|Äj~  ã                   @   s”  d Z ddlmZmZ ddlZeee ƒZedƒZ	dd„ Z
ee
ƒZ[
g d¢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�Z0G dd„ ded�Z1G dd„ de1ƒZ2e2 3e+¡ G dd„ ded�Z4G dd „ d e4ƒZ5G d!d"„ d"e5ƒZ6e6 3e.¡ G d#d$„ d$ed�Z7G d%d&„ d&e7ƒZ8e8 3e¡ e8 3e¡ e8 3e¡ e8 3e¡ e8 3e¡ e8 3e¡ e8 3e¡ e8 3e¡ e8 3e¡ e8 3e¡ e8 3e ¡ e8 3e!¡ e8 3e#¡ G d'd(„ d(e7ƒZ9G d)d*„ d*e8ƒZ:e: 3e)¡ G d+d,„ d,ed�Z;G d-d.„ d.ed�Z<G d/d0„ d0e;e7e<ƒZ=G d1d2„ d2eƒZ>d3d4„ Z?d5d6„ Z@d7d8„ ZAG d9d:„ d:ed�ZBG d;d<„ d<e=ƒZCeC 3eD¡ G d=d>„ d>eCƒZEeE 3e¡ G d?d@„ d@e=ƒZFeF 3e(¡ G dAdB„ dBe;ƒZGG dCdD„ dDeGeCƒZHeH 3e$¡ G dEdF„ dFeGeCƒZIeI 3e&¡ G dGdH„ dHeGe=ƒZJeJ 3e%¡ G dIdJ„ dJeFƒZKeK 3eL¡ G dKdL„ dLe9e=ƒZMeM 3eN¡ eM 3eO¡ eM 3e¡ eM 3eP¡ G dMdN„ dNeMƒZQeQ 3eR¡ eQ 3e¡ G dOdP„ dPeMƒZSeS 3e¡ eS 3e¡ dS )QzjAbstract Base Classes (ABCs) for collections, according to PEP 3119.

Unit tests are in test_collections.
é    )ÚABCMetaÚabstractmethodN.c                   C   s   d S ©N© r   r   r   ú-/usr/local/lib/python3.10/_collections_abc.pyÚ_f   s    r   )Ú	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è  Ú r   c                   c   s   � d V S r   r   r   r   r   r   Ú<lambda>>   s   € r$   c                   Ã   s   �d S r   r   r   r   r   r   Ú_coro@   s   € r%   c                   C  s   �d V  d S r   r   r   r   r   r   Ú_agF   s   €
 r&   c                 G   sN   | j }|D ]}|D ]}||jv r|j| d u rt    S  nq	t  S qdS )NT)Ú__mro__Ú__dict__ÚNotImplemented)ÚCZmethodsÚmroÚmethodÚBr   r   r   Ú_check_methodsN   s   
ýþr.   c                   @   ó(   e Zd ZdZedd„ ƒZedd„ ƒZdS )r   r   c                 C   ó   dS ©Nr   r   ©Úselfr   r   r   Ú__hash__^   ó   zHashable.__hash__c                 C   ó   | t u r	t|dƒS tS )Nr4   )r   r.   r)   ©Úclsr*   r   r   r   Ú__subclasshook__b   ó   
zHashable.__subclasshook__N)Ú__name__Ú
__module__Ú__qualname__Ú	__slots__r   r4   Úclassmethodr9   r   r   r   r   r   Z   ó    
r   )Ú	metaclassc                   @   ó0   e Zd ZdZedd„ ƒZedd„ ƒZeeƒZ	dS )r   r   c                 c   s   � d V  d S r   r   r2   r   r   r   Ú	__await__m   s   €
zAwaitable.__await__c                 C   r6   )NrC   )r   r.   r)   r7   r   r   r   r9   q   r:   zAwaitable.__subclasshook__N)
r;   r<   r=   r>   r   rC   r?   r9   ÚGenericAliasÚ__class_getitem__r   r   r   r   r   i   ó    

r   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   ó   t ‚)zcSend a value into the coroutine.
        Return next yielded value or raise StopIteration.
        ©ÚStopIteration©r3   Úvaluer   r   r   Úsend~   ó   zCoroutine.sendNc                 C   ó0   |du r|du r
|‚|ƒ }|dur|  |¡}|‚)zgRaise an exception in the coroutine.
        Return next yielded value or raise StopIteration.
        N©Úwith_traceback©r3   ZtypZvalÚtbr   r   r   Úthrow…   ó   
zCoroutine.throwc              	   C   ó.   z
|   t¡ W tdƒ‚ ttfy   Y dS w )ú.Raise GeneratorExit inside coroutine.
        zcoroutine ignored GeneratorExitN©rS   ÚGeneratorExitrI   ÚRuntimeErrorr2   r   r   r   Úclose’   ó   ýÿzCoroutine.closec                 C   s   | t u rt|ddddƒS tS )NrC   rL   rS   rZ   )r	   r.   r)   r7   r   r   r   r9   œ   s   zCoroutine.__subclasshook__©NN)
r;   r<   r=   r>   r   rL   rS   rZ   r?   r9   r   r   r   r   r	   z   s    

r	   c                   @   rB   )r
   r   c                 C   s   t ƒ S r   )r   r2   r   r   r   Ú	__aiter__ª   s   zAsyncIterable.__aiter__c                 C   r6   )Nr]   )r
   r.   r)   r7   r   r   r   r9   ®   r:   zAsyncIterable.__subclasshook__N)
r;   r<   r=   r>   r   r]   r?   r9   rD   rE   r   r   r   r   r
   ¦   rF   r
   c                   @   ó0   e Zd ZdZedd„ ƒZdd„ Zedd„ ƒZdS )	r   r   c                 Ã   ó   �t ‚)z@Return the next item or raise StopAsyncIteration when exhausted.©ÚStopAsyncIterationr2   r   r   r   Ú	__anext__»   s   €zAsyncIterator.__anext__c                 C   ó   | S r   r   r2   r   r   r   r]   À   ó   zAsyncIterator.__aiter__c                 C   ó   | t u r
t|ddƒS tS )Nrb   r]   )r   r.   r)   r7   r   r   r   r9   Ã   ó   zAsyncIterator.__subclasshook__N)	r;   r<   r=   r>   r   rb   r]   r?   r9   r   r   r   r   r   ·   ó    
r   c                   @   óF   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 )zpReturn the next item from the asynchronous generator.
        When exhausted, raise StopAsyncIteration.
        N)Úasendr2   r   r   r   rb   Î   s   €zAsyncGenerator.__anext__c                 Ã   r_   )zuSend a value into the asynchronous generator.
        Return next yielded value or raise StopAsyncIteration.
        r`   rJ   r   r   r   ri   Ô   s   €zAsyncGenerator.asendNc                 Ã   s2   �|du r|du r|‚|ƒ }|dur|  |¡}|‚)zyRaise an exception in the asynchronous generator.
        Return next yielded value or raise StopAsyncIteration.
        NrO   rQ   r   r   r   ÚathrowÛ   s   €
zAsyncGenerator.athrowc              	   Ã   s6   �z|   t¡I dH  W tdƒ‚ ttfy   Y dS w )rV   Nz,asynchronous generator ignored GeneratorExit)rj   rX   ra   rY   r2   r   r   r   Úacloseè   s   €ýÿzAsyncGenerator.aclosec                 C   ó   | t u rt|dddddƒS tS )Nr]   rb   ri   rj   rk   )r   r.   r)   r7   r   r   r   r9   ò   ó
   ÿzAsyncGenerator.__subclasshook__r\   )r;   r<   r=   r>   rb   r   ri   rj   rk   r?   r9   r   r   r   r   r   Ê   ó    

r   c                   @   rB   )r   r   c                 c   ó   � d S r   r   r2   r   r   r   Ú__iter__  ó   €zIterable.__iter__c                 C   r6   )Nrp   )r   r.   r)   r7   r   r   r   r9     r:   zIterable.__subclasshook__N)
r;   r<   r=   r>   r   rp   r?   r9   rD   rE   r   r   r   r   r   ý   s    

r   c                   @   r^   )	r   r   c                 C   rG   )zKReturn the next item from the iterator. When exhausted, raise StopIterationrH   r2   r   r   r   Ú__next__  ó   zIterator.__next__c                 C   rc   r   r   r2   r   r   r   rp     rd   zIterator.__iter__c                 C   re   )Nrp   rr   )r   r.   r)   r7   r   r   r   r9     rf   zIterator.__subclasshook__N)	r;   r<   r=   r>   r   rr   rp   r?   r9   r   r   r   r   r     rg   r   c                   @   r/   )r   r   c                 c   ro   r   r   r2   r   r   r   Ú__reversed__6  rq   zReversible.__reversed__c                 C   re   )Nrt   rp   )r   r.   r)   r7   r   r   r   r9   ;  rf   zReversible.__subclasshook__N)r;   r<   r=   r>   r   rt   r?   r9   r   r   r   r   r   2  s    
r   c                   @   rh   )r   r   c                 C   s
   |   d¡S )z^Return the next item from the generator.
        When exhausted, raise StopIteration.
        N)rL   r2   r   r   r   rr   F  s   
zGenerator.__next__c                 C   rG   )zcSend a value into the generator.
        Return next yielded value or raise StopIteration.
        rH   rJ   r   r   r   rL   L  rM   zGenerator.sendNc                 C   rN   )zgRaise an exception in the generator.
        Return next yielded value or raise StopIteration.
        NrO   rQ   r   r   r   rS   S  rT   zGenerator.throwc              	   C   rU   )z.Raise GeneratorExit inside generator.
        zgenerator ignored GeneratorExitNrW   r2   r   r   r   rZ   `  r[   zGenerator.closec                 C   rl   )Nrp   rr   rL   rS   rZ   )r   r.   r)   r7   r   r   r   r9   j  rm   zGenerator.__subclasshook__r\   )r;   r<   r=   r>   rr   r   rL   rS   rZ   r?   r9   r   r   r   r   r   B  rn   r   c                   @   r/   )r   r   c                 C   r0   r1   r   r2   r   r   r   Ú__len__y  r5   zSized.__len__c                 C   r6   )Nru   )r   r.   r)   r7   r   r   r   r9   }  r:   zSized.__subclasshook__N)r;   r<   r=   r>   r   ru   r?   r9   r   r   r   r   r   u  r@   r   c                   @   rB   )r   r   c                 C   r0   ©NFr   )r3   Úxr   r   r   Ú__contains__ˆ  r5   zContainer.__contains__c                 C   r6   )Nrx   )r   r.   r)   r7   r   r   r   r9   Œ  r:   zContainer.__subclasshook__N)
r;   r<   r=   r>   r   rx   r?   r9   rD   rE   r   r   r   r   r   „  rF   r   c                   @   s   e Zd ZdZedd„ ƒZdS )r   r   c                 C   s   | t u rt|dddƒS tS )Nru   rp   rx   )r   r.   r)   r7   r   r   r   r9   ™  s   zCollection.__subclasshook__N)r;   r<   r=   r>   r?   r9   r   r   r   r   r   •  s    r   c                       sL   e Zd ZdZdZ‡ fdd„Zedd„ ƒZ‡ fdd„Zd	d
„ Z	dd„ Z
‡  ZS )Ú_CallableGenericAliaszü Represent `Callable[argtypes, resulttype]`.

    This sets ``__args__`` to a tuple containing the flattened ``argtypes``
    followed by ``resulttype``.

    Example: ``Callable[[int, str], float]`` sets ``__args__`` to
    ``(int, str, float)``.
    r   c                    sf   t |tƒrt|ƒdkstdƒ‚|\}}t |tƒr g |¢|‘R }nt|ƒs+td|› �ƒ‚tƒ  | ||¡S )Né   z6Callable must be used as Callable[[arg, ...], result].úFExpected a list of types, an ellipsis, ParamSpec, or Concatenate. Got )Ú
isinstanceÚtupleÚlenÚ	TypeErrorÚlistÚ_is_param_exprÚsuperÚ__new__)r8   ÚoriginÚargsÚt_argsÚt_result©Ú	__class__r   r   rƒ   ¬  s   ÿ
ÿz_CallableGenericAlias.__new__c                 C   sj   g }| j D ](}t|tƒrt|tƒsqt|dƒr$t|jtƒr$| |j¡ qt|ƒr-| 	|¡ qtt
 |¡ƒS )NÚ__parameters__)Ú__args__r|   ÚtyperD   ÚhasattrrŠ   r}   ÚextendÚ_is_typevarlikeÚappendÚdictÚfromkeys)r3   ZparamsÚargr   r   r   rŠ   ¸  s   

€z$_CallableGenericAlias.__parameters__c                    s\   t | jƒdkrt| jd ƒrtƒ  ¡ S dd dd„ | jd d… D ƒ¡› dt| jd ƒ› d	�S )
Nrz   r   zcollections.abc.Callable[[z, c                 S   s   g | ]}t |ƒ‘qS r   )Ú
_type_repr)Ú.0Úar   r   r   Ú
<listcomp>Ê  s    z2_CallableGenericAlias.__repr__.<locals>.<listcomp>éÿÿÿÿz], ú])r~   r‹   r�   r‚   Ú__repr__Újoinr”   r2   rˆ   r   r   rš   Æ  s   
ÿþz_CallableGenericAlias.__repr__c                 C   sB   | j }t|ƒdkrt|d ƒst|d d… ƒ|d f}tt|ffS )Nrz   r   r˜   )r‹   r~   r�   r€   ry   r   )r3   r…   r   r   r   Ú
__reduce__Í  s   z _CallableGenericAlias.__reduce__c           
   	      s¬  t | jƒ}|dkrt| › d�ƒ‚t|tƒs|f}|dkr0t| jd ƒr0|r0t|d ƒs0t|ƒf}t |ƒ}||krNtd||kr@dnd› d| › d|› d	|› �ƒ‚tt| j|ƒƒ‰ g }| j	D ]^}t|t
ƒrmt|tƒsm| |¡ q[t|ƒrŠt|ƒr…ˆ | }t|ƒs„td
|› �ƒ‚n$ˆ | }nt|dƒr©t|jtƒr©|j}|r©t‡ fdd„|D ƒƒ}|| }t|tƒr´| |¡ q[| |¡ q[t|d tƒsÏ|d }|d d… }	|	|f}ttt|ƒƒS )Nr   z is not a generic classr"   zToo ZmanyZfewz arguments for z	; actual z, expected r{   rŠ   c                 3   s   � | ]}ˆ | V  qd S r   r   )r•   rw   ©Zsubstr   r   Ú	<genexpr>ú  s   € z4_CallableGenericAlias.__getitem__.<locals>.<genexpr>r˜   )r~   rŠ   r   r|   r}   r�   r€   r‘   Úzipr‹   rŒ   rD   r�   r�   r�   rŽ   ry   r   )
r3   ÚitemZ	param_lenZitem_lenZnew_argsr“   Z	subparamsZsubargsr‡   r†   r   r�   r   Ú__getitem__Ó  s`   

ÿ
ÿ
ÿþþ

ÿÿ

z!_CallableGenericAlias.__getitem__)r;   r<   r=   Ú__doc__r>   rƒ   ÚpropertyrŠ   rš   rœ   r¡   Ú__classcell__r   r   rˆ   r   ry      s    	
ry   c                 C   s   t | ƒ}|jdko|jdv S )NÚtyping>   ZTypeVarÚ	ParamSpec)rŒ   r<   r;   )r“   Úobjr   r   r   r�   	  s   
ÿr�   c                    sF   ˆ t u rdS tˆ tƒrdS tˆ ƒ‰ d}ˆ jdko"t‡ fdd„|D ƒƒS )z|Checks if obj matches either a list of types, ``...``, ``ParamSpec`` or
    ``_ConcatenateGenericAlias`` from typing.py
    T)r¦   Z_ConcatenateGenericAliasr¥   c                 3   s   � | ]}ˆ j |kV  qd S r   )r;   )r•   Úname©r§   r   r   rž     s   € z!_is_param_expr.<locals>.<genexpr>)ÚEllipsisr|   r€   rŒ   r<   Úany)r§   Únamesr   r©   r   r�     s   
 r�   c                 C   sb   t | tƒr	t| ƒS t | tƒr| jdkr| jS | j› d| j› �S | tu r%dS t | tƒr-| jS t| ƒS )z¦Return the repr() of an object, special-casing types (internal helper).

    Copied from :mod:`typing` since collections.abc
    shouldn't depend on that module.
    ÚbuiltinsÚ.z...)	r|   rD   ÚreprrŒ   r<   r=   rª   ÚFunctionTyper;   r©   r   r   r   r”     s   



r”   c                   @   rB   )r   r   c                 O   r0   rv   r   )r3   r…   Úkwdsr   r   r   Ú__call__2  r5   zCallable.__call__c                 C   r6   )Nr²   )r   r.   r)   r7   r   r   r   r9   6  r:   zCallable.__subclasshook__N)
r;   r<   r=   r>   r   r²   r?   r9   ry   rE   r   r   r   r   r   .  rF   r   c                   @   sŒ   e Zd 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   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.
    r   c                 C   s>   t |tƒstS t| ƒt|ƒkrdS | D ]	}||vr dS qdS ©NFT©r|   r   r)   r~   ©r3   ÚotherZelemr   r   r   Ú__le__O  ó   
ÿz
Set.__le__c                 C   s(   t |tƒstS t| ƒt|ƒk o|  |¡S r   ©r|   r   r)   r~   r·   ©r3   r¶   r   r   r   Ú__lt__Y  ó   
z
Set.__lt__c                 C   s(   t |tƒstS t| ƒt|ƒko|  |¡S r   )r|   r   r)   r~   Ú__ge__rº   r   r   r   Ú__gt__^  r¼   z
Set.__gt__c                 C   s>   t |tƒstS t| ƒt|ƒk rdS |D ]	}|| vr dS qdS r³   r´   rµ   r   r   r   r½   c  r¸   z
Set.__ge__c                 C   s(   t |tƒstS t| ƒt|ƒko|  |¡S r   r¹   rº   r   r   r   Ú__eq__m  r¼   z
Set.__eq__c                 C   s   | |ƒ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   ©r8   Úitr   r   r   Ú_from_iterabler  s   zSet._from_iterablec                    s&   t |tƒstS ˆ  ‡ fdd„|D ƒ¡S )Nc                 3   s   � | ]	}|ˆ v r|V  qd S r   r   ©r•   rK   r2   r   r   rž   ~  s   € zSet.__and__.<locals>.<genexpr>©r|   r   r)   rÂ   rº   r   r2   r   Ú__and__{  ó   
zSet.__and__c                 C   s   |D ]	}|| v r dS qdS )z1Return True if two sets have a null intersection.FTr   )r3   r¶   rK   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 r   r   )r•   ÚsÚer   r   r   rž   Œ  s   € zSet.__or__.<locals>.<genexpr>rÄ   )r3   r¶   Z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   ó   � | ]	}|ˆ vr|V  qd S r   r   rÃ   ©r¶   r   r   rž   –  ó   € ÿÿzSet.__sub__.<locals>.<genexpr>©r|   r   r   r)   rÂ   rº   r   rÌ   r   Ú__sub__‘  ó
   


zSet.__sub__c                    s:   t |tƒst |tƒstS ˆ  |¡}ˆ  ‡ fdd„|D ƒ¡S )Nc                 3   rË   r   r   rÃ   r2   r   r   rž   ž  rÍ   zSet.__rsub__.<locals>.<genexpr>rÎ   rº   r   r2   r   Ú__rsub__™  rÐ   zSet.__rsub__c                 C   s2   t |tƒst |tƒstS |  |¡}| | ||  B S r   rÎ   rº   r   r   r   Ú__xor__¡  s
   


zSet.__xor__c                 C   s¬   t j}d| d }t| ƒ}d|d  }||M }| D ]}t|ƒ}|||d> A dA d N }||M }q||d? |d? A N }|d	 d
 }||M }||krN||d 8 }|dkrTd}|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.
        rz   r"   iMïèré   i³M[l   ×4~2 é   é   iÍ iãÃ6r˜   iÁÇ8#)ÚsysÚmaxsizer~   Úhash)r3   ZMAXZMASKÚnÚhrw   Zhxr   r   r   Ú_hashª  s"   
z	Set._hashN)r;   r<   r=   r¢   r>   r·   r»   r¾   r½   r¿   r?   rÂ   rÅ   Ú__rand__rÇ   rÊ   Ú__ror__rÏ   rÑ   rÒ   Ú__rxor__rÛ   r   r   r   r   r   B  s(    



r   c                   @   sd   e Zd 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   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.
    r   c                 C   rG   )zAdd an element.©ÚNotImplementedErrorrJ   r   r   r   ÚaddÝ  rs   zMutableSet.addc                 C   rG   )z8Remove an element.  Do not raise an exception if absent.rß   rJ   r   r   r   Údiscardâ  rs   zMutableSet.discardc                 C   s   || vrt |ƒ‚|  |¡ dS )z5Remove an element. If not a member, raise a KeyError.N)ÚKeyErrorrâ   rJ   r   r   r   Úremoveç  s   zMutableSet.removec                 C   s8   t | ƒ}zt|ƒ}W n
 ty   td‚w |  |¡ |S )z2Return the popped value.  Raise KeyError if empty.N)ÚiterÚnextrI   rã   râ   ©r3   rÁ   rK   r   r   r   Úpopí  s   ÿ
zMutableSet.popc                 C   ó"   z	 |   ¡  q ty   Y dS w )z6This is slow (creates N new iterators!) but effective.TN)rè   rã   r2   r   r   r   Úclear÷  ó   ÿÿzMutableSet.clearc                 C   s   |D ]}|   |¡ q| S r   )rá   rç   r   r   r   Ú__ior__ÿ  s   zMutableSet.__ior__c                 C   s   | | D ]}|   |¡ q| S r   )râ   rç   r   r   r   Ú__iand__  s   zMutableSet.__iand__c                 C   sT   || u r
|   ¡  | S t|tƒs|  |¡}|D ]}|| v r"|  |¡ q|  |¡ q| S r   )rê   r|   r   rÂ   râ   rá   rç   r   r   r   Ú__ixor__	  s   	
ù
zMutableSet.__ixor__c                 C   s,   || u r
|   ¡  | S |D ]}|  |¡ q| S r   )rê   râ   rç   r   r   r   Ú__isub__  s   þzMutableSet.__isub__N)r;   r<   r=   r¢   r>   r   rá   râ   rä   rè   rê   rì   rí   rî   rï   r   r   r   r   r   Ï  s    


r   c                   @   sZ   e Zd Zd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   zÆ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__.
    r   é@   c                 C   rG   r   ©rã   ©r3   Úkeyr   r   r   r¡   1  r5   zMapping.__getitem__Nc                 C   s"   z| | W S  t y   | Y S w )z<D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.rñ   ©r3   ró   Údefaultr   r   r   Úget5  s
   
ÿzMapping.getc                 C   s$   z| |  W dS  t y   Y dS w r³   rñ   rò   r   r   r   rx   <  s   
ýÿzMapping.__contains__c                 C   ó   t | ƒS )z:D.keys() -> a set-like object providing a view on D's keys)r   r2   r   r   r   ÚkeysD  ó   zMapping.keysc                 C   r÷   )z<D.items() -> a set-like object providing a view on D's items)r   r2   r   r   r   ÚitemsH  rù   zMapping.itemsc                 C   r÷   )z6D.values() -> an object providing a view on D's values)r   r2   r   r   r   ÚvaluesL  rù   zMapping.valuesc                 C   s&   t |tƒstS t|  ¡ ƒt| ¡ ƒkS r   )r|   r   r)   r‘   rú   rº   r   r   r   r¿   P  rÆ   zMapping.__eq__r   )r;   r<   r=   r¢   r>   Ú__abc_tpflags__r   r¡   rö   rx   rø   rú   rû   r¿   rt   r   r   r   r   r   $  s    

r   c                   @   s0   e Zd ZdZdd„ Zdd„ Zdd„ ZeeƒZ	dS )	r   ©Ú_mappingc                 C   s
   || _ d S r   rý   )r3   Úmappingr   r   r   Ú__init__^  ó   
zMappingView.__init__c                 C   s
   t | jƒS r   )r~   rþ   r2   r   r   r   ru   a  r  zMappingView.__len__c                 C   s
   d  | ¡S )Nz&{0.__class__.__name__}({0._mapping!r}))Úformatr2   r   r   r   rš   d  r  zMappingView.__repr__N)
r;   r<   r=   r>   r   ru   rš   r?   rD   rE   r   r   r   r   r   Z  s    r   c                   @   ó,   e Zd ZdZedd„ ƒZdd„ Zdd„ ZdS )	r   r   c                 C   ó   t |ƒS r   ©ÚsetrÀ   r   r   r   rÂ   n  rù   zKeysView._from_iterablec                 C   s
   || j v S r   rý   rò   r   r   r   rx   r  r  zKeysView.__contains__c                 c   s   � | j E d H  d S r   rý   r2   r   r   r   rp   u  s   €zKeysView.__iter__N©r;   r<   r=   r>   r?   rÂ   rx   rp   r   r   r   r   r   j  s    
r   c                   @   r  )	r   r   c                 C   r  r   r  rÀ   r   r   r   rÂ   €  rù   zItemsView._from_iterablec                 C   s<   |\}}z| j | }W n
 ty   Y dS w ||u p||kS rv   )rþ   rã   )r3   r    ró   rK   Úvr   r   r   rx   „  s   ÿzItemsView.__contains__c                 c   s"   � | j D ]
}|| j | fV  qd S r   rý   rò   r   r   r   rp   �  s   €
ÿzItemsView.__iter__Nr  r   r   r   r   r   |  s    
	r   c                   @   s    e Zd ZdZdd„ Zdd„ ZdS )r   r   c                 C   s0   | j D ]}| j | }||u s||kr dS qdS ©NTFrý   )r3   rK   ró   r  r   r   r   rx   ™  s   

ÿzValuesView.__contains__c                 c   s   � | j D ]}| j | V  qd S r   rý   rò   r   r   r   rp      s   €
ÿzValuesView.__iter__N)r;   r<   r=   r>   rx   rp   r   r   r   r   r   •  s    r   c                   @   sb   e Zd 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d„Zddd„ZdS )r   zë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__.
    r   c                 C   rG   r   rñ   ©r3   ró   rK   r   r   r   Ú__setitem__³  r5   zMutableMapping.__setitem__c                 C   rG   r   rñ   rò   r   r   r   Ú__delitem__·  r5   zMutableMapping.__delitem__c                 C   s:   z| | }W n t y   || ju r‚ | Y S w | |= |S )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.
        )rã   Ú_MutableMapping__marker)r3   ró   rõ   rK   r   r   r   rè   ½  s   
ýzMutableMapping.popc                 C   s<   zt t| ƒƒ}W n
 ty   td‚w | | }| |= ||fS )zƒD.popitem() -> (k, v), remove and return some (key, value) pair
           as a 2-tuple; but raise KeyError if D is empty.
        N)ræ   rå   rI   rã   r
  r   r   r   ÚpopitemË  s   ÿzMutableMapping.popitemc                 C   ré   )z,D.clear() -> None.  Remove all items from D.TN)r  rã   r2   r   r   r   rê   ×  rë   zMutableMapping.clearc                K   s|   t |tƒr|D ]}|| | |< qnt|dƒr$| ¡ D ]}|| | |< qn|D ]\}}|| |< q&| ¡ D ]\}}|| |< q3d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
        rø   N)r|   r   r�   rø   rú   )r3   r¶   r±   ró   rK   r   r   r   Úupdateß  s   
ÿ
ÿ

ÿzMutableMapping.updateNc                 C   s(   z| | W S  t y   || |< Y |S w )z@D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in Drñ   rô   r   r   r   Ú
setdefaultñ  s   

þzMutableMapping.setdefault)r   r   )r;   r<   r=   r¢   r>   r   r  r  Úobjectr  rè   r  rê   r  r  r   r   r   r   r   ¨  s    


r   c                   @   sN   e Zd Zd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   zŠAll the operations on a read-only sequence.

    Concrete subclasses must override __new__ or __init__,
    __getitem__, and __len__.
    r   é    c                 C   rG   r   ©Ú
IndexError©r3   Úindexr   r   r   r¡     r5   zSequence.__getitem__c                 c   s6   � d}z	 | | }|V  |d7 }q t y   Y d S w )Nr   Tr"   r  )r3   Úir  r   r   r   rp     s   €ýÿzSequence.__iter__c                 C   s$   | D ]}||u s||kr dS qdS r	  r   )r3   rK   r  r   r   r   rx     s
   ÿzSequence.__contains__c                 c   s&   � t tt| ƒƒƒD ]}| | V  q	d S r   )ÚreversedÚranger~   )r3   r  r   r   r   rt     s   €ÿzSequence.__reversed__r   Nc                 C   s¦   |dur|dk rt t| ƒ| dƒ}|dur|dk r|t| ƒ7 }|}|du s)||k rQz| | }||u s6||kr9|W S W n
 tyD   Y t‚w |d7 }|du s)||k s)t‚)zæS.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"   )Úmaxr~   r  Ú
ValueError)r3   rK   Ú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$   � | ]}|ˆ u s|ˆ krd V  qdS )r"   Nr   )r•   r  ©rK   r   r   rž   <  s   €" z!Sequence.count.<locals>.<genexpr>)ÚsumrJ   r   r  r   Úcount:  s   zSequence.count)r   N)r;   r<   r=   r¢   r>   rü   r   r¡   rp   rx   rt   r  r   r   r   r   r   r   ÿ  s    


r   c                   @   s   e Zd ZdZdZdS )r    zMThis unifies bytes and bytearray.

    XXX Should add all their methods.
    r   N)r;   r<   r=   r¢   r>   r   r   r   r   r    D  s    r    c                   @   sr   e Zd 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   z®All the operations on a read-write sequence.

    Concrete subclasses must provide __new__ or __init__,
    __getitem__, __setitem__, __delitem__, __len__, and insert().
    r   c                 C   rG   r   r  ©r3   r  rK   r   r   r   r  Y  r5   zMutableSequence.__setitem__c                 C   rG   r   r  r  r   r   r   r  ]  r5   zMutableSequence.__delitem__c                 C   rG   )z3S.insert(index, value) -- insert value before indexr  r!  r   r   r   Úinserta  rs   zMutableSequence.insertc                 C   s   |   t| ƒ|¡ dS )z:S.append(value) -- append value to the end of the sequenceN)r"  r~   rJ   r   r   r   r�   f  s   zMutableSequence.appendc                 C   ré   )z,S.clear() -> None -- remove all items from STN)rè   r  r2   r   r   r   rê   j  rë   zMutableSequence.clearc                 C   sH   t | ƒ}t|d ƒD ]}| || d  | | | |< | || d < q
dS )z!S.reverse() -- reverse *IN PLACE*rz   r"   N)r~   r  )r3   rÙ   r  r   r   r   Úreverser  s   ,ÿzMutableSequence.reversec                 C   s(   || u rt |ƒ}|D ]}|  |¡ q
dS )zMS.extend(iterable) -- extend sequence by appending elements from the iterableN)r€   r�   )r3   rû   r  r   r   r   rŽ   x  s
   ÿzMutableSequence.extendr˜   c                 C   s   | | }| |= |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   )r3   r  r  r   r   r   rè     s   zMutableSequence.popc                 C   s   | |   |¡= dS )zvS.remove(value) -- remove first occurrence of value.
           Raise ValueError if the value is not present.
        N)r  rJ   r   r   r   rä   ‡  s   zMutableSequence.removec                 C   s   |   |¡ | S r   )rŽ   )r3   rû   r   r   r   Ú__iadd__�  s   
zMutableSequence.__iadd__N)r˜   )r;   r<   r=   r¢   r>   r   r  r  r"  r�   rê   r#  rŽ   rè   rä   r$  r   r   r   r   r   P  s     



r   )Tr¢   Úabcr   r   rÖ   rŒ   r€   ÚintrD   ZEllipsisTyper   r°   Ú__all__r;   rå   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_iteratorrŸ   Zzip_iteratorZ	dict_keysZdict_valuesZ
dict_itemsr(   ZmappingproxyZ	generatorr%   Z	coroutinerZ   r&   Zasync_generatorr.   r   r   r	   Úregisterr
   r   r   r   r   r   r   r   r   r   ry   r�   r�   r”   r   r   Ú	frozensetr   r   r   r   r   r   r   r‘   r   r}   ÚstrÚ
memoryviewr    Úbytesr   r   r   r   r   Ú<module>   sÆ   	

)
0













0i 

P
3



R
?





B