HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib64/python3.10/site-packages/dns/__pycache__/enum.cpython-310.pyc
o

!wek�@s>ddlZddlmZmZmZeddd�ZGdd�dej�ZdS)�N)�Type�TypeVar�Union�TIntEnum�IntEnum)�boundc@s�eZdZedd��Zedd��Zedeededefdd	��Z	edeed
e
defdd��Zedeed
ee
efdefd
d��Z
edd��Zedd��Zedd��Zedd��Zedd��Zedd��ZdS)rcCs>|�|�t�||�}|�|d�p|���|��|_||_|S�N)�_check_value�int�__new__�_extra_to_text�_prefix�_name_�_value_)�cls�value�val�r�A/home/arjun/projects/env/lib/python3.10/site-packages/dns/enum.py�	_missing_s

zIntEnum._missing_cCsD|��}t|t�st�|dks||kr |��}t|�d|����dS)Nrz$ must be an int between >= 0 and <= )�_maximum�
isinstancer
�	TypeError�_short_name�
ValueError)rr�max�namerrrr	!s
�zIntEnum._check_valuer�text�returncCs�|��}z||WStyYnw|�|�}|r|S|��}|�|�rO|t|�d���rOt|t|�d��}|�|�z||�WSt	yN|YSw|�
��r)�upper�KeyError�_extra_from_textr
�
startswith�len�isdigitr
r	r�_unknown_exception_class)rrr�prefixrrr�	from_text*s&
�


�zIntEnum.from_textrcCsX|�|�z||�j}Wntyd}Ynw|�||�}|dur*|���|��}|Sr)r	rrrr
)rrrrrr�to_text>s
�zIntEnum.to_textcCs&t|t�r
|�|�S|�|�||�S)a�Convert text or a value into an enumerated type, if possible.

        *value*, the ``int`` or ``str`` to convert.

        Raises a class-specific exception if a ``str`` is provided that
        cannot be converted.

        Raises ``ValueError`` if the value is out of range.

        Returns an enumeration from the calling class corresponding to the
        value, if one is defined, or an ``int`` otherwise.
        )r�strr'r	)rrrrr�makeJs


zIntEnum.makecCst�r)�NotImplementedError�rrrrr^�zIntEnum._maximumcCs
|j��Sr)�__name__�lowerr,rrrrbs
zIntEnum._short_namecCsdS)N�rr,rrrr
fr-zIntEnum._prefixcCsdSrr)rrrrrr!jr-zIntEnum._extra_from_textcCs|Srr)rr�current_textrrrrnr-zIntEnum._extra_to_textcCstSr)rr,rrrr%rr-z IntEnum._unknown_exception_classN)r.�
__module__�__qualname__�classmethodrr	rrr)r'r
r(rr*rrr
r!rr%rrrrrs.

$




)�enum�typingrrrrrrrrr�<module>s