o
    K+g'                     @   s  d Z ddlZdd ZeeZedd ZeejZeejZ	eej
Zdd Zee Zd	d
 Zee Zdd Ze ZeeZe  dd Ze ZeeZG dd dZee jZeeZeg jZeejZee jZ ee!j"Z#ee$jd Z%eeZ&ze' e'y   e( d Z)ee)Z*ee)j+Z,dZ)[)Y nw eejZ-eej.Z/[[[[[[d$ddZ0dd Z1d%ddZ2dd Z3G dd dZ4G dd dZ5d d! Z6ee7e8 Z9ee8e!B Z:ee;Z<edZ=ee>Z?d"d# e@ D ZAdS )&zO
Define names for built-in types that aren't directly accessible as a builtin.
    Nc                   C      d S N r   r   r   7/var/www/html/squashfs-root/usr/lib/python3.10/types.py_f       r   c                   C   r   r   r   r   r   r   r   <lambda>   r   r   c                     s   d  fdd} | j d S )N   c                      r   r   r   r   ar   r   f   r   z_cell_factory.<locals>.fr   )__closure__)r   r   r
   r   _cell_factory   s   
r   c                   c   s    dV  d S )Nr	   r   r   r   r   r   _g      
r   c                      s   d S r   r   r   r   r   r   _c   s    r   c                   C  s   d V  d S r   r   r   r   r   r   _ag"   r   r   c                   @   s   e Zd Zdd ZdS )_Cc                 C   r   r   r   selfr   r   r   _m(   r   z_C._mN)__name__
__module____qualname__r   r   r   r   r   r   '   s    r   fromkeys   r   c                 C   sN   t |}t| ||\}}}|dur|| ||ur||d< || ||fi |S )zBCreate a class object dynamically using the appropriate metaclass.NZ__orig_bases__)resolve_basesprepare_class)namebaseskwdsZ	exec_bodyZresolved_basesmetansr   r   r   	new_classE   s   r#   c                 C   s   t | }d}d}t| D ]9\}}t|trt|tsqt|ds!q|| }d}t|ts1td|||| || d < |t	|d 7 }q|sJ| S t|S )z8Resolve MRO entries dynamically as specified by PEP 560.Fr   __mro_entries__Tz#__mro_entries__ must return a tupler	   )
list	enumerate
isinstancetypeGenericAliashasattrr$   tuple	TypeErrorlen)r   Z	new_basesupdatedZshiftibaseZnew_baser   r   r   r   O   s"   


r   c                 C   s   |du ri }nt |}d|v r|d}n|rt|d }nt}t|tr*t||}t|dr:|j| |fi |}ni }|||fS )az  Call the __prepare__ method of the appropriate metaclass.

    Returns (metaclass, namespace, kwds) as a 3-tuple

    *metaclass* is the appropriate metaclass
    *namespace* is the prepared class namespace
    *kwds* is an updated copy of the passed in kwds argument with any
    'metaclass' entry removed. If no kwds argument is passed in, this will
    be an empty dict.
    N	metaclassr   __prepare__)dictpopr(   r'   _calculate_metar*   r2   )r   r   r    r!   r"   r   r   r   r   d   s   



r   c                 C   s<   | }|D ]}t |}t||rqt||r|}qtd|S )z%Calculate the most derived metaclass.zxmetaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases)r(   
issubclassr,   )r!   r   Zwinnerr0   Z	base_metar   r   r   r5      s   

r5   c                   @   sL   e Zd ZdZdddZdddZdd Zd	d
 Zdd Zdd Z	dd Z
dS )DynamicClassAttributea  Route attribute access on a class to __getattr__.

    This is a descriptor, used to define attributes that act differently when
    accessed through an instance and through a class.  Instance access remains
    normal, but access to an attribute through a class will be routed to the
    class's __getattr__ method; this is done by raising AttributeError.

    This allows one to have properties active on an instance, and have virtual
    attributes on the class with the same name.  (Enum used this between Python
    versions 3.4 - 3.9 .)

    Subclass from this to use a different method of accessing virtual atributes
    and still be treated properly by the inspect module. (Enum uses this since
    Python 3.10 .)

    Nc                 C   s>   || _ || _|| _|p|j| _|d u | _tt|dd| _d S )N__isabstractmethod__F)fgetfsetfdel__doc__overwrite_docboolgetattrr8   )r   r9   r:   r;   docr   r   r   __init__   s   
zDynamicClassAttribute.__init__c                 C   s4   |d u r| j r	| S t | jd u rtd| |S )Nzunreadable attribute)r8   AttributeErrorr9   )r   instanceZ
ownerclassr   r   r   __get__   s   

zDynamicClassAttribute.__get__c                 C   s"   | j d u r	td|  || d S )Nzcan't set attribute)r:   rB   )r   rC   valuer   r   r   __set__   s   
zDynamicClassAttribute.__set__c                 C   s    | j d u r	td|  | d S )Nzcan't delete attribute)r;   rB   )r   rC   r   r   r   
__delete__   s   
z DynamicClassAttribute.__delete__c                 C   s8   | j r|jnd }t| || j| j|p| j}| j |_ |S r   )r=   r<   r(   r:   r;   )r   r9   Zfdocresultr   r   r   getter   s   zDynamicClassAttribute.getterc                 C   s$   t | | j|| j| j}| j|_|S r   )r(   r9   r;   r<   r=   )r   r:   rH   r   r   r   setter      zDynamicClassAttribute.setterc                 C   s$   t | | j| j|| j}| j|_|S r   )r(   r9   r:   r<   r=   )r   r;   rH   r   r   r   deleter   rK   zDynamicClassAttribute.deleter)NNNNr   )r   r   r   r<   rA   rD   rF   rG   rI   rJ   rL   r   r   r   r   r7      s    


	r7   c                   @   s   e Zd Zdd Zdd Zdd Zdd Zed	d
 Zedd Z	edd Z
edd ZeZe	Ze
ZeZdd Zdd ZeZdS )_GeneratorWrapperc                 C   s2   || _ |jtu | _t|dd | _t|dd | _d S )Nr   r   )_GeneratorWrapper__wrapped	__class__GeneratorType_GeneratorWrapper__isgenr?   r   r   )r   Zgenr   r   r   rA      s   z_GeneratorWrapper.__init__c                 C   s   | j |S r   )rN   send)r   valr   r   r   rR      s   z_GeneratorWrapper.sendc                 G   s   | j j|g|R  S r   )rN   throw)r   Ztprestr   r   r   rT      s   z_GeneratorWrapper.throwc                 C   s
   | j  S r   )rN   closer   r   r   r   rV         
z_GeneratorWrapper.closec                 C      | j jS r   )rN   gi_coder   r   r   r   rY         z_GeneratorWrapper.gi_codec                 C   rX   r   )rN   gi_framer   r   r   r   r[      rZ   z_GeneratorWrapper.gi_framec                 C   rX   r   )rN   
gi_runningr   r   r   r   r\      rZ   z_GeneratorWrapper.gi_runningc                 C   rX   r   )rN   gi_yieldfromr   r   r   r   r]      rZ   z_GeneratorWrapper.gi_yieldfromc                 C   s
   t | jS r   )nextrN   r   r   r   r   __next__   rW   z_GeneratorWrapper.__next__c                 C   s   | j r| jS | S r   )rQ   rN   r   r   r   r   __iter__   s   z_GeneratorWrapper.__iter__N)r   r   r   rA   rR   rT   rV   propertyrY   r[   r\   r]   cr_codecr_frame
cr_runningcr_awaitr_   r`   	__await__r   r   r   r   rM      s(    



rM   c                    s   t stdjtu r3tddjtu r3jj}|d@ r S |d@ r3j}|j|jdB d_S ddl	}ddl
 | fd	d
}|S )z2Convert regular generator function to a coroutine.z$types.coroutine() expects a callable__code__Ni         )co_flagsr   c                     sV   | i |}|j tu s|j tu r|jjd@ r|S t| jr)t| js)t|S |S )Nri   )	rO   CoroutineTyperP   rY   rj   r'   	Generator	CoroutinerM   )argskwargsZcoro_collections_abcfuncr   r   wrapped  s   

zcoroutine.<locals>.wrapped)callabler,   rO   FunctionTyper?   CodeTyperg   rj   replace	functoolsrq   wraps)rr   rj   corx   rs   r   rp   r   	coroutine   s    
r{   c                 C   s    g | ]}|d d dkr|qS )Nr	   _r   ).0nr   r   r   
<listcomp>3  s     r   )r   NN)r   N)Br<   sysr   r(   ru   Z
LambdaTyperg   rv   __dict__MappingProxyTypeimplementationZSimpleNamespacer   ZCellTyper   rP   r   rk   rV   r   ZAsyncGeneratorTyper   r   Z
MethodTyper-   ZBuiltinFunctionTypeappendZBuiltinMethodTypeobjectrA   ZWrapperDescriptorType__str__ZMethodWrapperTypestrjoinZMethodDescriptorTyper3   ZClassMethodDescriptorTypeZ
ModuleTyper,   exc_infotbZTracebackTypetb_frameZ	FrameTypeZGetSetDescriptorType__globals__ZMemberDescriptorTyper#   r   r   r5   r7   rM   r{   r%   intr)   Z	UnionTypeEllipsisEllipsisTypeZNoneTypeNotImplementedZNotImplementedTypeglobals__all__r   r   r   r   <module>   sh    














 ?%3