o
    �¨Êhl  ã                   @   sJ  d dl mZ d dl mZ d dl mZ d dl mZ d dlmZ d dlmZ d dl	Z	zd dlm
Z
 W n ey?   d dl
m
Z
 Y nw zd d	lmZ W n eyW   d d	lmZ Y nw zd d
lmZ W n! ey�   zd d
lmZ W n ey~   d d
lmZ Y nw Y nw ddd„ZG dd„ deƒZG dd„ de
ƒZdd„ ZG dd„ deƒZdS )é    )Úabsolute_import)Údivision)Úprint_function)Úunicode_literals)ÚABCMeta)ÚMutableMappingN)ÚUserDict)ÚOrderedDict)Ú	get_identú...c                    s   ‡ fdd„}|S )zGDecorator to make a repr function return fillvalue for a recursive callc                    sL   t ƒ ‰ ‡‡ ‡fdd„}tˆdƒ|_tˆdƒ|_tˆdƒ|_tˆdi ƒ|_|S )Nc              	      sJ   t | ƒtƒ f}|ˆv rˆ S ˆ |¡ zˆ| ƒ}W ˆ |¡ |S ˆ |¡ w ©N)Úidr
   ÚaddÚdiscard)ÚselfÚkeyÚresult)Ú	fillvalueÚrepr_runningÚuser_function© úH/var/www/html/env/lib/python3.10/site-packages/singledispatch_helpers.pyÚwrapper#   s   


ÿz<recursive_repr.<locals>.decorating_function.<locals>.wrapperÚ
__module__Ú__doc__Ú__name__Ú__annotations__)ÚsetÚgetattrr   r   r   r   )r   r   ©r   )r   r   r   Údecorating_function    s   z+recursive_repr.<locals>.decorating_functionr   )r   r    r   r   r   Úrecursive_repr   s   r!   c                   @   s¬   e Zd ZdZdd„ Zdd„ Zdd„ Zd%d	d
„Zdd„ Zdd„ Z	dd„ Z
eƒ dd„ ƒZedd„ ƒZdd„ ZeZdd„ Zedd„ ƒZdd„ Zdd„ Zdd „ Zd!d"„ Zd#d$„ ZdS )&ÚChainMapa±   A ChainMap groups multiple dicts (or other mappings) together
    to create a single, updateable view.

    The underlying mappings are stored in a list.  That list is public and can
    accessed or updated using the *maps* attribute.  There is no other state.

    Lookups search the underlying mappings successively until a key is found.
    In contrast, writes, updates, and deletions only operate on the first
    mapping.

    c                 G   s   t |ƒpi g| _dS )z�Initialize a ChainMap by setting *maps* to the given mappings.
        If no mappings are provided, a single empty dictionary is used.

        N)ÚlistÚmaps)r   r$   r   r   r   Ú__init__E   s   zChainMap.__init__c                 C   s   t |ƒ‚r   )ÚKeyError©r   r   r   r   r   Ú__missing__L   s   zChainMap.__missing__c              	   C   s6   | j D ]}z|| W   S  ty   Y qw |  |¡S r   )r$   r&   r(   )r   r   Úmappingr   r   r   Ú__getitem__O   s   
ÿ
zChainMap.__getitem__Nc                 C   s   || v r| | S |S r   r   )r   r   Údefaultr   r   r   ÚgetW   s   zChainMap.getc                 C   ó   t tƒ j| jŽ ƒS r   )Úlenr   Úunionr$   ©r   r   r   r   Ú__len__Z   ó   zChainMap.__len__c                 C   r-   r   )Úiterr   r/   r$   r0   r   r   r   Ú__iter__]   r2   zChainMap.__iter__c                    s   t ‡ fdd„| jD ƒƒS )Nc                 3   s   � | ]}ˆ |v V  qd S r   r   )Ú.0Úm©r   r   r   Ú	<genexpr>a   s   € z(ChainMap.__contains__.<locals>.<genexpr>)Úanyr$   r'   r   r7   r   Ú__contains__`   s   zChainMap.__contains__c                 C   s   d  | d tt| jƒ¡¡S )Nz{0.__class__.__name__}({1})z, )ÚformatÚjoinÚmapÚreprr$   r0   r   r   r   Ú__repr__c   s   ÿzChainMap.__repr__c                 G   s   | t j|g|¢R Ž ƒS )z?Create a ChainMap with a single dict created from the iterable.)ÚdictÚfromkeys)ÚclsÚiterableÚargsr   r   r   rA   h   s   zChainMap.fromkeysc                 C   s&   | j | jd  ¡ g| jdd… ¢R Ž S )zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]r   é   N)Ú	__class__r$   Úcopyr0   r   r   r   rG   m   s   &zChainMap.copyc                 C   s   | j i g| j¢R Ž S )z;New ChainMap with a new dict followed by all previous maps.©rF   r$   r0   r   r   r   Ú	new_childs   s   zChainMap.new_childc                 C   s   | j | jdd… Ž S )zNew ChainMap from maps[1:].rE   NrH   r0   r   r   r   Úparentsw   s   zChainMap.parentsc                 C   s   || j d |< d S )Nr   )r$   )r   r   Úvaluer   r   r   Ú__setitem__|   r2   zChainMap.__setitem__c                 C   s0   z	| j d |= W d S  ty   td |¡ƒ‚w )Nr   ú(Key not found in the first mapping: {!r})r$   r&   r;   r'   r   r   r   Ú__delitem__   s
   ÿzChainMap.__delitem__c                 C   s(   z| j d  ¡ W S  ty   tdƒ‚w )zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.r   z#No keys found in the first mapping.)r$   Úpopitemr&   r0   r   r   r   rO   …   s
   ÿzChainMap.popitemc                 G   s8   z| j d j|g|¢R Ž W S  ty   td |¡ƒ‚w )zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].r   rM   )r$   Úpopr&   r;   )r   r   rD   r   r   r   rP   Œ   s
   ÿzChainMap.popc                 C   s   | j d  ¡  dS )z'Clear maps[0], leaving maps[1:] intact.r   N)r$   Úclearr0   r   r   r   rQ   “   s   zChainMap.clearr   )r   r   Ú__qualname__r   r%   r(   r*   r,   r1   r4   r:   r!   r?   ÚclassmethodrA   rG   Ú__copy__rI   ÚpropertyrJ   rL   rN   rO   rP   rQ   r   r   r   r   r"   8   s.    



r"   c                   @   s   e Zd Zdd„ ZdS )ÚMappingProxyTypec                 C   s   t  | ¡ || _d S r   )r   r%   Údata)r   rW   r   r   r   r%   ™   s   

zMappingProxyType.__init__N)r   r   rR   r%   r   r   r   r   rV   ˜   s    rV   c                   C   s   t jS r   )r   Ú_abc_invalidation_counterr   r   r   r   Úget_cache_tokenž   s   rY   c                   @   s   e Zd Zdd„ Zdd„ ZdS )ÚSupportc                 C   s   d S r   r   r0   r   r   r   Údummy¤   s   zSupport.dummyc                 C   s   dt jv r| jS |S )NÚPyPy)ÚsysÚversionr[   )r   Úfuncr   r   r   Úcpython_only§   s   
zSupport.cpython_onlyN)r   r   rR   r[   r`   r   r   r   r   rZ   £   s    rZ   )r   )Ú
__future__r   r   r   r   Úabcr   Úcollectionsr   r]   r   ÚImportErrorr	   ÚordereddictÚthreadr
   Ú_threadÚ_dummy_threadr!   r"   rV   rY   ÚobjectrZ   r   r   r   r   Ú<module>   s@   ÿÿÿ€ý
`