o
    ÖèFhÁ  ã                   @  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/loop/nvenv/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.   


û
