o
    *if                     @  s   d dl mZ d dlZd dlZd dlZd dlZd dlZG dd deZeZ	eZ
eZeZeZd/ddZd/ddZd0d1ddZd2ddZG dd deZG dd dZG dd dejZ	d0d3d&d'Zd4d+d,ZG d-d. d.ejZdS )5    )annotationsNc                   @     e Zd ZdS )CryptographyDeprecationWarningN__name__
__module____qualname__ r	   r	   K/var/www/html/corbot_env/lib/python3.10/site-packages/cryptography/utils.pyr          r   namestrvaluebytesreturnNonec                 C  s   t |tst|  dd S )Nz must be bytes)
isinstancer   	TypeErrorr   r   r	   r	   r
   _check_bytes   s   
r   c                 C  s,   zt | W d S  ty   t|  dw )Nz must be bytes-like)
memoryviewr   r   r	   r	   r
   _check_byteslike#   s
   r   integerintlength
int | Nonec                 C  s    |  |p|  d d pddS )N         big)to_bytes
bit_length)r   r   r	   r	   r
   int_to_bytes*   s   r"   obj
typing.Anytuple[typing.Any, int]c                 C  s.   ddl m} |j| }|t|jd|fS )Nr   )_openssl	uintptr_t)"cryptography.hazmat.bindings._rustr&   ffifrom_bufferr   cast)r#   r&   bufr	   r	   r
   _extract_buffer_length0   s   r-   c                   @  r   )InterfaceNotImplementedNr   r	   r	   r	   r
   r.   7   r   r.   c                   @  s   e Zd ZdddZdS )	_DeprecatedValuer   objectmessager   c                 C  s   || _ || _|| _d S N)r   r1   warning_class)selfr   r1   r3   r	   r	   r
   __init__<   s   
z_DeprecatedValue.__init__N)r   r0   r1   r   )r   r   r   r5   r	   r	   r	   r
   r/   ;   s    r/   c                      sF   e Zd Zd fddZdd	d
ZdddZdddZdddZ  ZS )_ModuleWithDeprecationsmoduletypes.ModuleTypec                   s   t  |j || jd< d S N_module)superr5   r   __dict__)r4   r7   	__class__r	   r
   r5   C   s   z _ModuleWithDeprecations.__init__attrr   r   r0   c                 C  s4   t | j|}t|trtj|j|jdd |j}|S N   )
stacklevel)	getattrr:   r   r/   warningswarnr1   r3   r   r4   r?   r#   r	   r	   r
   __getattr__G   s
   
z#_ModuleWithDeprecations.__getattr__r   r   c                 C  s   t | j|| d S r2   )setattrr:   )r4   r?   r   r	   r	   r
   __setattr__N   s   z#_ModuleWithDeprecations.__setattr__c                 C  s:   t | j|}t|trtj|j|jdd t| j| d S r@   )	rC   r:   r   r/   rD   rE   r1   r3   delattrrF   r	   r	   r
   __delattr__Q   s   
z#_ModuleWithDeprecations.__delattr__typing.Sequence[str]c                 C  s   dgt | jS r9   )dirr:   r4   r	   r	   r
   __dir__X   s   z_ModuleWithDeprecations.__dir__)r7   r8   )r?   r   r   r0   )r?   r   r   r0   r   r   )r?   r   r   r   )r   rL   )	r   r   r   r5   rG   rI   rK   rO   __classcell__r	   r	   r=   r
   r6   B   s    


r6   r0   module_namer1   r3   type[Warning]
str | Nonec                 C  sJ   t j| }t|tst| t j|< }t| ||}|d ur#t||| |S r2   )sysmodulesr   r6   r/   rH   )r   rQ   r1   r3   r   r7   dvr	   r	   r
   
deprecated\   s   

rW   functyping.Callablepropertyc                   s*   d  t  d fdd}t|S )N_cached_instancer0   c                   s0   t |  }|ur|S | }t|  | |S r2   )rC   rH   )r\   cacheresultcached_namerX   sentinelr	   r
   innerq   s   zcached_property.<locals>.inner)r\   r0   )r0   rZ   )rX   rb   r	   r_   r
   cached_propertym   s   
rc   c                   @  s    e Zd ZdddZdddZdS )	Enumr   r   c                 C  s    d| j j d| j d| jdS )N<.z: >)r>   r   _name__value_rN   r	   r	   r
   __repr__   s    zEnum.__repr__c                 C  s   | j j d| j S )Nrf   )r>   r   rh   rN   r	   r	   r
   __str__   s   zEnum.__str__N)r   r   )r   r   r   rj   rk   r	   r	   r	   r
   rd   ~   s    
rd   )r   r   r   r   r   r   r2   )r   r   r   r   r   r   )r#   r$   r   r%   )r   r0   rQ   r   r1   r   r3   rR   r   rS   r   r/   )rX   rY   r   rZ   )
__future__r   enumrT   typestypingrD   UserWarningr   DeprecatedIn36DeprecatedIn37DeprecatedIn40DeprecatedIn41DeprecatedIn42r   r   r"   r-   	Exceptionr.   r/   
ModuleTyper6   rW   rc   rd   r	   r	   r	   r
   <module>   s.   



