o
    àý°j  ã                   @  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d dlmZ G dd„ de	ƒZ
e
Ze
Ze
Ze
Ze
Ze
Ze
Zejeeef Zd'dd„Zd(dd„Zd)d*dd„ZG dd„ deƒZG dd„ dƒZG dd„ dejƒZ	d)d+d#d$„ZG d%d&„ d&ej ƒZ dS ),é    )ÚannotationsN)ÚSequencec                   @  ó   e Zd ZdS )ÚCryptographyDeprecationWarningN©Ú__name__Ú
__module__Ú__qualname__© r
   r
   ú…/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/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   ÚBufferc                 C  s@   t |tttfƒr
d S zt|ƒ W d S  ty   t| › d�ƒ‚w )Nz must be bytes-like)r   r   Ú	bytearrayÚ
memoryviewr   r   r
   r
   r   Ú_check_byteslike-   s   ÿr   ÚintegerÚintÚlengthú
int | Nonec                 C  s0   |dkrt dƒ‚|  |p|  ¡ d d pdd¡S )Nr   zlength argument can't be 0é   é   é   Úbig)Ú
ValueErrorÚto_bytesÚ
bit_length)r   r   r
   r
   r   Úint_to_bytes6   s
   ÿr&   c                   @  r   )ÚInterfaceNotImplementedNr   r
   r
   r
   r   r'   >   r   r'   c                   @  s   e Zd Zddd„ZdS )	Ú_DeprecatedValuer   ÚobjectÚmessager   c                 C  s   || _ || _|| _d S ©N)r   r*   Úwarning_class)Úselfr   r*   r,   r
   r
   r   Ú__init__C   s   
z_DeprecatedValue.__init__N)r   r)   r*   r   )r   r   r	   r.   r
   r
   r
   r   r(   B   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)Úsuperr.   r   Ú__dict__)r-   r0   ©Ú	__class__r
   r   r.   J   s   z _ModuleWithDeprecations.__init__r   r   r   ú
typing.Anyc                 C  sB   t | j|ƒ}t|tƒrtj|j|jdd� |j}|S || j	|< |S ©Né   )Ú
stacklevel)
Úgetattrr3   r   r(   ÚwarningsÚwarnr*   r,   r   r5   )r-   r   Úobjr
   r
   r   Ú__getattr__N   s   
	
ÿz#_ModuleWithDeprecations.__getattr__Úattrr   r)   r   c                 C  s6   t |tƒr| j |d ¡ n|| j|< t| j||ƒ d S r+   )r   r(   r5   ÚpopÚsetattrr3   )r-   rA   r   r
   r
   r   Ú__setattr__]   s   

z#_ModuleWithDeprecations.__setattr__c                 C  sH   t | j|ƒ}t|tƒrtj|j|jdd� | j 	|d ¡ t
| j|ƒ d S r9   )r<   r3   r   r(   r=   r>   r*   r,   r5   rB   Údelattr)r-   rA   r?   r
   r
   r   Ú__delattr__d   s
   
z#_ModuleWithDeprecations.__delattr__úSequence[str]c                 C  s   dgt | jƒ¢S r2   )Údirr3   ©r-   r
   r
   r   Ú__dir__l   s   z_ModuleWithDeprecations.__dir__)r0   r1   )r   r   r   r8   )rA   r   r   r)   r   r   )rA   r   r   r   )r   rG   )	r   r   r	   r.   r@   rD   rF   rJ   Ú__classcell__r
   r
   r6   r   r/   I   s    


r/   r)   Úmodule_namer*   r,   útype[Warning]ú
str | Nonec                 C  sJ   t j| }t|tƒst|ƒ t j|< }t| ||ƒ}|d ur#t|||ƒ |S r+   )ÚsysÚmodulesr   r/   r(   rC   )r   rL   r*   r,   r   r0   Údvr
   r
   r   Ú
deprecatedp   s   

rR   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: ú>)r7   r   Ú_name_Ú_value_rI   r
   r
   r   Ú__repr__„   s    zEnum.__repr__c                 C  s   | j j› d| j› �S )NrU   )r7   r   rW   rI   r
   r
   r   Ú__str__‡   s   zEnum.__str__N)r   r   )r   r   r	   rY   rZ   r
   r
   r
   r   rS   ƒ   s    
rS   )r   r   r   r   r   r   )r   r   r   r   r   r   r+   )r   r   r   r   r   r   )r   r)   rL   r   r*   r   r,   rM   r   rN   r   r(   )!Ú
__future__r   ÚenumrO   ÚtypesÚtypingr=   Úcollections.abcr   ÚUserWarningr   ÚDeprecatedIn36ÚDeprecatedIn40ÚDeprecatedIn41ÚDeprecatedIn42ÚDeprecatedIn43ÚDeprecatedIn47ÚDeprecatedIn50ÚUnionr   r   r   r   r   r   r&   Ú	Exceptionr'   r(   Ú
ModuleTyper/   rR   rS   r
   r
   r
   r   Ú<module>   s2   

	,û