HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/attr/__pycache__/_compat.cpython-38.pyc
U

��`��@s$ddlmZmZmZddlZddlZddlZddlZejddkZ	e�
�dkZesdejdd�dkrjeZ
nddlmZeZ
e	r�ddlmZmZddlmZd	d
�Zdd�Zd
Zdd�ZGdd�de�Zdd�Zdd�Zn:ddlmZmZdd�Zdd
�ZdZdd�ZejZdd�Zdd�Ze�ZdS)�)�absolute_import�division�print_functionN�ZPyPy)��)�OrderedDict)�Mapping�Sequence)�IterableUserDictcCst|ttjf�S�N)�
isinstance�type�types�	ClassType��klass�r�./usr/lib/python3/dist-packages/attr/_compat.py�isclasssrcCsi}||�t|||�S)zP
        A minimal stub of types.new_class that we need for make_class.
        )r)�name�bases�kwds�	exec_body�nsrrr�	new_classsrrcCs|��Sr)�	iteritems��drrrr+src@sTeZdZdZdd�Zdd�Zdd�Zdd	�Zddd�Zd
d�Z	ddd�Z
dd�Zd
S)�ReadOnlyDictz5
        Best-effort read-only dict wrapper.
        cCstd��dS)Nz6'mappingproxy' object does not support item assignment��	TypeError)�self�key�valrrr�__setitem__4s�zReadOnlyDict.__setitem__cCstd��dS)Nz/'mappingproxy' object has no attribute 'update'��AttributeError�r"�_rrr�update:s�zReadOnlyDict.updatecCstd��dS)Nz4'mappingproxy' object does not support item deletionr r(rrr�__delitem__@s�zReadOnlyDict.__delitem__cCstd��dS)Nz.'mappingproxy' object has no attribute 'clear'r&�r"rrr�clearFs�zReadOnlyDict.clearNcCstd��dS)Nz,'mappingproxy' object has no attribute 'pop'r&�r"r#�defaultrrr�popLs�zReadOnlyDict.popcCstd��dS)Nz0'mappingproxy' object has no attribute 'popitem'r&r,rrr�popitemRs�zReadOnlyDict.popitemcCstd��dS)Nz3'mappingproxy' object has no attribute 'setdefault'r&r.rrr�
setdefaultXs�zReadOnlyDict.setdefaultcCsdt|j�dS)Nz
mappingproxy(�))�repr�datar,rrr�__repr__^szReadOnlyDict.__repr__)N)N)�__name__�
__module__�__qualname__�__doc__r%r*r+r-r0r1r2r6rrrrr/s

rcCst�}|j�|�|Sr)rr5r*)r�resrrr�metadata_proxybsr<cOsdS)��
        We only warn on Python 3 because we are not aware of any concrete
        consequences of not setting the cell on Python 2.
        Nr��args�kwrrr�	just_warngsrAcOstjdtdd�dS)r=z�Running interpreter doesn't sufficiently support code object introspection.  Some features like bare super() or accessing __class__ will not work with slotted classes.r)�
stacklevelN)�warnings�warn�RuntimeWarningr>rrrrAqs
�cCs
t|t�Sr)r
rrrrrr~s�classcCs|��Sr)�itemsrrrrr�scCst�t|��Sr)r�MappingProxyType�dictrrrrr<�scs4trdd�}|Sdd�}z�tr&|j}n|j}|jdks@|jdkrDt�tjdkrb|j	|j|jd��n`|j
g}tsz|�|j�|�
|j|j|j|j|j|j|j|j|j|j|j|j|jg
�tj|���fd	d�}d
d�}tr�|�jd}n|�jd}||d
�|jd
k�rt�Wntk
�r*tYSX|SdS)z|Return a function of two arguments (cell, value) which sets
    the value stored in the closure cell `cell` to `value`.
    cSs|�|f�dSr)�__setstate__)�cell�valuerrr�set_closure_cell�sz/make_set_closure_cell.<locals>.set_closure_cellcs|�dS)Ncs�Srrr��xrr�force_x_to_be_a_cell�szQmake_set_closure_cell.<locals>.set_first_cellvar_to.<locals>.force_x_to_be_a_cellr)rLrPrrNr�set_first_cellvar_to�sz3make_set_closure_cell.<locals>.set_first_cellvar_torNr)r�)�co_cellvars�co_freevarscs t��idd|f�}||�dS)N�setterr)r�FunctionType)rKrLrU�Zset_first_freevar_coderrrM�s�csd��fdd�}|S)Ncs�SrrrrNrr�func�sz@make_set_closure_cell.<locals>.make_func_with_cell.<locals>.funcr)rXrrNr�make_func_with_cell�sz2make_set_closure_cell.<locals>.make_func_with_cellr�dN) �PYPY�PY2�	func_code�__code__rSrT�AssertionError�sys�version_info�replace�co_argcount�append�co_kwonlyargcount�extend�
co_nlocals�co_stacksize�co_flags�co_code�	co_consts�co_names�co_varnames�co_filename�co_name�co_firstlineno�	co_lnotabr�CodeTypeZfunc_closure�__closure__�
cell_contents�	ExceptionrA)rMrQ�cor?rYrKrrWr�make_set_closure_cell�s\

���


rw)�
__future__rrr�platformr`rrCrar\Zpython_implementationr[rIZordered_dict�collectionsrr	r
�UserDictrrrZTYPErrr<rA�collections.abcrwrMrrrr�<module>s:
3

f