a
     ÑOcÀ  ã                   @   sÂ   d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZmZ e 	¡ dkZ
ejdd… dkZeZejdd… dkZe
s|er‚eZnd dlmZ eZdd	„ ZG d
d„ dƒZdd„ Zeƒ Ze ¡ ZdS )é    N)ÚMappingÚSequenceÚPyPyé   )é   é   )r   é
   )ÚOrderedDictc                  O   s   t jdtdd� d S )Nz§Running interpreter doesn't sufficiently support code object introspection.  Some features like bare super() or accessing __class__ will not work with slotted classes.r   )Ú
stacklevel)ÚwarningsÚwarnÚRuntimeWarning)ÚargsÚkw© r   úC/var/www/html/gsl.tools/lib/python3.9/site-packages/attr/_compat.pyÚ	just_warn   s
    ûr   c                   @   s.   e Zd ZdZdgZdd„ Zdd„ Zdd„ Zd	S )
Ú_AnnotationExtractorz^
    Extract type annotations from a callable, returning None whenever there
    is none.
    Úsigc              	   C   s2   zt  |¡| _W n ttfy,   d | _Y n0 d S ©N)ÚinspectÚ	signaturer   Ú
ValueErrorÚ	TypeError)ÚselfÚcallabler   r   r   Ú__init__.   s    z_AnnotationExtractor.__init__c                 C   s>   | j s
dS t| j j ¡ ƒ}|r:|d jtjjur:|d jS dS )zU
        Return the type annotation of the first argument if it's not empty.
        Nr   )r   ÚlistÚ
parametersÚvaluesÚ
annotationr   Ú	ParameterÚempty)r   Úparamsr   r   r   Úget_first_param_type4   s    
z)_AnnotationExtractor.get_first_param_typec                 C   s"   | j r| j jtjjur| j jS dS )z;
        Return the return type if it's not empty.
        N)r   Úreturn_annotationr   Ú	Signaturer"   )r   r   r   r   Úget_return_typeA   s    ÿþz$_AnnotationExtractor.get_return_typeN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   r$   r'   r   r   r   r   r   &   s
   r   c                     s  t rdd„ } | S dd„ }zÊ|j}|jdks4|jdkr8t‚tjdkrLdd„ } nh|jg}| |j	¡ | 
|j|j|j|j|j|j|j|j|j|j|j|j|jg¡ tj|Ž ‰ ‡ fd	d„} d
d„ }|ƒ jd }| |dƒ |jdkràt‚W n tyø   t Y S 0 | S dS )z|Return a function of two arguments (cell, value) which sets
    the value stored in the closure cell `cell` to `value`.
    c                 S   s   |   |f¡ d S r   )Ú__setstate__©ÚcellÚvaluer   r   r   Úset_closure_cellV   s    z/make_set_closure_cell.<locals>.set_closure_cellc                    s   | ‰ d S )Nc                      s   ˆ S r   r   r   ©Úxr   r   Úforce_x_to_be_a_celle   s    zQmake_set_closure_cell.<locals>.set_first_cellvar_to.<locals>.force_x_to_be_a_cellr   )r0   r4   r   r2   r   Úset_first_cellvar_to^   s    z3make_set_closure_cell.<locals>.set_first_cellvar_tor2   r   )r   é   c                 S   s
   || _ d S r   )Úcell_contentsr.   r   r   r   r1   s   s    c                    s    t  ˆ i dd| f¡}||ƒ d S )NÚsetterr   )ÚtypesÚFunctionType)r/   r0   r8   ©Zset_first_freevar_coder   r   r1   �   s    ÿc                     s   d ‰ ‡ fdd„} | S )Nc                      s   ˆ S r   r   r   r2   r   r   Úfunc›   s    z@make_set_closure_cell.<locals>.make_func_with_cell.<locals>.funcr   )r<   r   r2   r   Úmake_func_with_cell˜   s    z2make_set_closure_cell.<locals>.make_func_with_cellr   éd   N)ÚPYPYÚ__code__Úco_cellvarsÚco_freevarsÚAssertionErrorÚsysÚversion_infoÚ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_lnotabr9   ÚCodeTypeÚ__closure__r7   Ú	Exceptionr   )r1   r5   Úcor   r=   r/   r   r;   r   Úmake_set_closure_cellN   sL    


òÿ



rY   )r   ÚplatformrD   Ú	threadingr9   r   Úcollections.abcr   r   Úpython_implementationr?   rE   ZPY36ZHAS_F_STRINGSZPY310ÚdictZordered_dictÚcollectionsr	   r   r   rY   r1   ÚlocalZrepr_contextr   r   r   r   Ú<module>   s&   
(]