Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 18.218.42.199
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : enum.cpython-39.pyc
a

$b��@s�ddlZddlmZmZgd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	e
�ZGdd�d�ZGdd�de
�ZdZGdd�de�ZGdd�ded�ZGdd�dee�Zdd�ZGdd�de�ZGdd�dee�Zdd �Zd!d"�Zd#d$�ZdS)%�N)�MappingProxyType�DynamicClassAttribute)�EnumMeta�Enum�IntEnum�Flag�IntFlag�auto�uniquecCst|d�pt|d�pt|d�S)z?
    Returns True if obj is a descriptor, False otherwise.
    �__get__�__set__�
__delete__)�hasattr)�obj�r�+/usr/local/python-3.9/lib/python3.9/enum.py�_is_descriptors

��rcCsLt|�dkoJ|dd�|dd�ko.dknoJ|ddkoJ|ddkS)z=
    Returns True if a __dunder__ name, False otherwise.
    �N�����__�_�����len��namerrr�
_is_dunders&�
�
�rcCsLt|�dkoJ|d|dko&dknoJ|dd�dkoJ|dd�dkS)z;
    Returns True if a _sunder_ name, False otherwise.
    rr���r�rrrrrr�
_is_sunder!s���r cCsTd|f}t|�dkrL|�|�rL|t|�dkrL|ddksH|ddkrLdSdSdS)Nz_%s__�rrrTF)r�
startswith)Zcls_namer�patternrrr�_is_private,s

���
�
�r$cCsdd�}||_d|_dS)z,
    Make the given class un-picklable.
    cSstd|��dS)Nz%r cannot be pickled)�	TypeError��selfZprotorrr�_break_on_call_reduce=sz6_make_class_unpicklable.<locals>._break_on_call_reducez	<unknown>N)�
__reduce_ex__�
__module__)�clsr(rrr�_make_class_unpicklable9sr,c@seZdZdZeZdS)r	zP
    Instances are replaced with an appropriate value in Enum class suites.
    N)�__name__r*�__qualname__�__doc__�
_auto_null�valuerrrrr	Csr	cs,eZdZdZ�fdd�Z�fdd�Z�ZS)�	_EnumDictz�
    Track enum member order and ensure member names are not reused.

    EnumMeta will use the names found in self._member_names as the
    enumeration member names.
    cs&t���g|_g|_g|_d|_dS)NF)�super�__init__�
_member_names�_last_values�_ignore�_auto_called�r'��	__class__rrr4Qs

z_EnumDict.__init__cs�t|j|�r*ddl}|jd|ftdd�t|�r�|dvrBtd��|dkrf|jrXtd	��t	|d
|�nV|dkr�t
|t�r�|�dd
��
�}nt|�}||_t|�t|j�@}|r�td|f��n�t|�r�|dkr�d}n�||jvr�td|��n�||jvr�n�t|��s~||v�r td|||f��t
|t��rf|jtk�r`|�|dt|j�|jdd��|_d|_|j}|j�|�|j�|�t��||�dS)z�
        Changes anything not dundered or not a descriptor.

        If an enum member name is used twice, an error is raised; duplicate
        values are not checked for.

        Single underscore (sunder) names are reserved.
        rNz@private variables, such as %r, will be normal attributes in 3.10r)�
stacklevel)�_order_�_create_pseudo_member_�_generate_next_value_�	_missing_�_ignore_z(_names_ are reserved for future Enum user?z4_generate_next_value_ must be defined before members�_generate_next_valuerA�,� z-_ignore_ cannot specify already set names: %rZ	__order__r=zAttempted to reuse key: %rz%r already defined as: %rrT)r$�	_cls_name�warnings�warn�DeprecationWarningr �
ValueErrorr8r%�setattr�
isinstance�str�replace�split�listr7�setr5rrr	r1r0rBrr6�appendr3�__setitem__)r'�keyr1rFZalreadyr:rrrRXsf	��
��



�z_EnumDict.__setitem__)r-r*r.r/r4rR�
__classcell__rrr:rr2Jsr2cs�eZdZdZedd��Z�fdd�Zdd�Zd-dddd	d
�dd�Zd
d�Z	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zedd��Zdd�Zdd �Z�fd!d"�Zdddd	d
�d#d$�Zd.d%d&�Zed'd(��Zed)d*��Zed+d,��Z�ZS)/rz
    Metaclass for Enum
    cKsD|�||�t�}||_|�||�\}}|dur@t|dd�|d<|S)Nr?)�_check_for_existing_membersr2rE�_get_mixins_�getattr)�metaclsr+�bases�kwdsZ	enum_dict�member_type�
first_enumrrr�__prepare__�s�zEnumMeta.__prepare__c	s���dg��d��d}|D]}��|d�q|�||�\�}|���|�\}}	}
�fdd��jD�}�jD]
}�|=qn��dd�}
t|�ddh@}|r�td�d�	|����d	�vr�d
�d	<t
�j|||�fi|��}g|_i|_
�|_dd�|��D�}i|_d
�v�r̈tu�r�d}t�fdd�|D���s�d�v�rFt|�n�d}|D]n}|jD]P��tu�rl�qXn:t�fdd�|D���r�d}�q�nd�jv�rXd}�q��qX|du�rN�q��qN|�r�t|��jD�]*}||}t|t��s�|f}n|}�tu�r|f}|
�s*||�}t|d��sb||_n8||g|�R�}t|d��sb�tu�rX||_n
�|�|_|j}||_||_|j|�|j
��D]"\}}|j|jk�r�|}�q��q�|j�|�||v�r�t|||�||j
|<z||j|<Wnt�y�Yn0�q�dD]V}|�v�r�qt ||�}t �|d�}t ||d�}|du�r||u�rt|||��qt!du�rz|	�rr||_"t!j|_|
du�r�t|
t#��r�|
�$dd��%�}
|
|jk�r�td��|S)NrAcsi|]}|�|�qSrr)�.0�k)�	classdictrr�
<dictcomp>��z$EnumMeta.__new__.<locals>.<dictcomp>r=�mro�zInvalid enum member name: {0}rCr/zAn enumeration.cSs.h|]&}|j��D]\}}t|t�r|�qqSr)�__dict__�itemsrKr)r^�cr_�vrrr�	<setcomp>�s
�z#EnumMeta.__new__.<locals>.<setcomp>r))Z__getnewargs_ex__�__getnewargs__r)�
__reduce__c3s|]}|�jvVqdS�N�re�r^�m)r[rr�	<genexpr>�rbz#EnumMeta.__new__.<locals>.<genexpr>�__new__c3s|]}|�jvVqdSrlrmrn)�baserrrprbFT�_value_)�__repr__�__str__�
__format__r)rDz#member order does not match _order_)&�
setdefaultrQ�poprV�
_find_new_r5rPrI�format�joinr3rq�_member_names_�_member_map_�
_member_type_rc�_value2member_map_�object�anyr,�__mro__rerK�tuplerrs�_name_�__objclass__r4rfrJr%rWr�__new_member__rLrMrN)rXr+rYr`rZ�ignorerSr\rq�save_new�use_argsZenum_membersrr=Z
invalid_names�
enum_classZdynamic_attributes�methodsZsabotage�chain�member_namer1�argsZenum_memberZcanonical_memberZclass_methodZ
obj_methodZenum_methodr:)rrr`r[rrq�s��

��




















zEnumMeta.__new__cCsdS)z6
        classes/types should always be True.
        Trr9rrr�__bool__`szEnumMeta.__bool__Nr��module�qualname�type�startcCs*|dur|�||�S|j||||||d�S)a!
        Either returns an existing member, or creates a new enum class.

        This method is used both when an enum class is given a value to match
        to an enumeration member (i.e. Color(3)) and for the functional API
        (i.e. Color = Enum('Color', names='RED GREEN BLUE')).

        When used for the functional API:

        `value` will be the name of the new class.

        `names` should be either a string of white-space/comma delimited names
        (values will start at `start`), or an iterator/mapping of name, value pairs.

        `module` should be set to the module this class is being created in;
        if it is not set, an attempt to find that module will be made, but if
        it fails the class will not be picklable.

        `qualname` should be set to the actual location this class can be found
        at in its module; by default it is set to the global scope.  If this is
        not correct, unpickling will fail in some circumstances.

        `type`, if set, will be mixed in as the first base class.
        Nr�)rq�_create_)r+r1�namesr�r�r�r�rrr�__call__fs�zEnumMeta.__call__cCs:t|t�s$tdt|�j|jjf��t||�o8|j|jvS)N�3unsupported operand type(s) for 'in': '%s' and '%s')rKrr%r�r.r;r�r})r+�memberrrr�__contains__�s
��zEnumMeta.__contains__cs(||jvrtd|j��t��|�dS)Nz%s: cannot delete Enum member.)r}�AttributeErrorr-r3�__delattr__)r+�attrr:rrr��s
zEnumMeta.__delattr__cCsgd�|jS)N)r;r/�__members__r*�r|r9rrr�__dir__�s��zEnumMeta.__dir__cCs>t|�rt|��z|j|WSty8t|�d�Yn0dS)a=
        Return the enum member matching `name`

        We use __getattr__ instead of descriptors or inserting into the enum
        class' __dict__ in order to support `name` and `value` being both
        properties for enum members (which live in the class' __dict__) and
        enum members themselves.
        N)rr�r}�KeyError�r+rrrr�__getattr__�s	zEnumMeta.__getattr__cCs
|j|Srl�r}r�rrr�__getitem__�szEnumMeta.__getitem__cs�fdd��jD�S)z6
        Returns members in definition order.
        c3s|]}�j|VqdSrlr��r^r�r+rrrp�rbz$EnumMeta.__iter__.<locals>.<genexpr>r�r�rr�r�__iter__�szEnumMeta.__iter__cCs
t|j�Srl)rr|r�rrr�__len__�szEnumMeta.__len__cCs
t|j�S)z�
        Returns a mapping of member name->value.

        This mapping lists all enum members, including aliases. Note that this
        is a read-only view of the internal mapping.
        )rr}r�rrrr��szEnumMeta.__members__cCs
d|jS)Nz	<enum %r>)r-r�rrrrt�szEnumMeta.__repr__cs�fdd�t�j�D�S)z>
        Returns members in reverse definition order.
        c3s|]}�j|VqdSrlr�r�r�rrrp�rbz(EnumMeta.__reversed__.<locals>.<genexpr>)�reversedr|r�rr�r�__reversed__�szEnumMeta.__reversed__cs0|j�di�}||vrtd��t��||�dS)a
        Block attempts to reassign Enum members.

        A simple assignment to the class namespace only changes one of the
        several possible ways to get an Enum member from the Enum class,
        resulting in an inconsistent Enumeration.
        r}zCannot reassign members.N)re�getr�r3�__setattr__)r+rr1Z
member_mapr:rrr��szEnumMeta.__setattr__c
Csn|j}|dur|fn||f}|�||�\}	}
|�||�}t|t�rR|�dd���}t|ttf�r�|r�t|dt�r�|g}}g}
t	|�D]8\}}|
�
||||
dd��}|
�|�|�||f�q�|D].}t|t�r�|||}}n|\}}|||<q�|�||||�}|du�r@zt
�d�jd}Wntttf�y>Yn0|du�rTt|�n||_|du�rj||_|S)a�
        Convenience method to create a new Enum class.

        `names` can be:

        * A string containing member names, separated either with spaces or
          commas.  Values are incremented by 1 from `start`.
        * An iterable of member names.  Values are incremented by 1 from `start`.
        * An iterable of (member name, value) pairs.
        * A mapping of member name -> value pairs.
        NrCrDrrr-)r;rVr]rKrLrMrNr�rO�	enumerater?rQrq�sys�	_getframe�	f_globalsr�rIr�r,r*r.)r+�
class_namer�r�r�r�r�rXrYrr\r`Zoriginal_names�last_values�countrr1�itemr��member_valuer�rrrr��s<
 







zEnumMeta._create_cs�ttj|�}|rt|�}n|}�fdd�|��D�}z|jdd�d�Wn"tyl|jdd�d�Yn0||||d�}t|_|�|j	�|||<|S)z[
        Create a new Enum subclass that replaces a collection of global constants
        cs g|]\}}�|�r||f�qSrr)r^rr1��filterrr�
<listcomp>!s�z&EnumMeta._convert_.<locals>.<listcomp>cSs|d|dfS)Nrrr��trrr�<lambda>'rbz$EnumMeta._convert_.<locals>.<lambda>)rScSs|dS�Nrrr�rrrr�*rb)r�)
�varsr��modulesrf�sortr%�_reduce_ex_by_namer)�updater�)r+rr�r��sourceZmodule_globals�membersrr�r�	_convert_s 	

�zEnumMeta._convert_cCs<|D]2}|jD]&}t|t�r|jrtd||jf��qqdS)Nz %s: cannot extend enumeration %r)r��
issubclassrr|r%r-)r�rYr�rrrrrrU1s
��z$EnumMeta._check_for_existing_memberscsT|sttfS�fdd�}|d}t|t�s2td��||�p<t}|jrLtd��||fS)z�
        Returns the type for creating enum members, and the first inherited
        enum class.

        bases: the tuple of bases that was given to __new__
        cs�t�}|D]x}d}|jD]h}|tur(qqt|t�rN|jtur�|�|j�q
qd|jvrxt|t�rdq|�|pn|�q
q|p~|}qq
t|�dkr�t	d�|f��n|r�|�
�SdSdS)Nrqrz%r: too many data types: %r)rPr�r�r�rr~�addrerr%rx)rYZ
data_typesr��	candidaterr�r�rr�_find_data_typeFs*




z.EnumMeta._get_mixins_.<locals>._find_data_typerzZnew enumerations should be created as `EnumName([mixin_type, ...] [data_type,] enum_type)`zCannot extend enumerations)r�rr�r%r|)r�rYr�r\r[rr�rrV;s
zEnumMeta._get_mixins_c	Cs�|�dd�}|du}|durpdD]H}||fD].}t||d�}|ddjtjtjhvr,|}q\q,|dur qpq tj}|tjur�d}nd}|||fS)a
        Returns the __new__ to be used for creating the enum members.

        classdict: the class dictionary given to __new__
        member_type: the data type whose __new__ will be used by default
        first_enum: enumeration to check for an overriding __new__
        rqN)r�rqFT)r�rWrqr�r)	r`r[r\rqr��methodZpossible�targetr�rrrryjs*�
zEnumMeta._find_new_)N)N)r-r*r.r/�classmethodr]rqr�r�r�r�r�r�r�r�r��propertyr�rtr�r�r�r��staticmethodrUrVryrTrrr:rr�s6
.%
	
5
!
	
.rc@steZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
edd��Zedd��ZdS)rzV
    Generic enumeration.

    Derive from this class to define new enumerations.
    c
Cs(t|�|ur|Sz|j|WSty.Yn8tyd|j��D]}|j|krD|YSqDYn0zd}|�|�}Wn,ty�}z|}d}WYd}~n
d}~00zrt	||�r�|Wd}d}St
d||jf�}|dur�|dur�|�n|du�rtd|j|f�}||_
|�Wd}d}n
d}d}0dS)N�%r is not a valid %szDerror in %s._missing_: returned %r instead of None or a valid member)r�rr�r%r}�valuesrsr@�	ExceptionrKrIr.r-�__context__)r+r1r��exc�result�eZve_excrrrrq�sJ

�
���zEnum.__new__c	Cs4t|�D]&}z|dWSty,Yq0q|S)��
        Generate the next value when not given.

        name: the name of the member
        start: the initial start value or None
        count: the number of existing members
        last_value: the last value assigned or None
        rN)r�r%)rr�r�r��
last_valuerrrr?�s	zEnum._generate_next_value_cCsdSrlr)r+r1rrrr@�szEnum._missing_cCsd|jj|j|jfS)N�<%s.%s: %r>)r;r-r�rsr9rrrrt�s�z
Enum.__repr__cCsd|jj|jfS)N�%s.%s)r;r-r�r9rrrru�szEnum.__str__cs4�fdd��j��D�dd��jD�}gd�|S)z<
        Returns all members and all public methods
        cs2g|]*}|jD]}|ddkr|�jvr|�qqS�rr)rer})r^r+ror9rrr��s
�z Enum.__dir__.<locals>.<listcomp>cSsg|]}|ddkr|�qSr�rrnrrrr��rb)r;r/r*)r;rcre)r'Zadded_behaviorrr9rr��s
��zEnum.__dir__cCsJt|�jtjtjfv}|jtus$|r2t}t|�}n|j}|j}|�||�S)z\
        Returns format using actual value type unless __str__ has been overridden.
        )	r�rurrr~r�rLrsrv)r'�format_specZstr_overriddenr+�valrrrrv�s	
zEnum.__format__cCs
t|j�Srl)�hashr�r9rrr�__hash__sz
Enum.__hash__cCs|j|jffSrl�r;rsr&rrrr)	szEnum.__reduce_ex__cCs|jS)zThe name of the Enum member.)r�r9rrrrsz	Enum.namecCs|jS)zThe value of the Enum member.�rsr9rrrr1sz
Enum.valueN)r-r*r.r/rqr?r�r@rtrur�rvr�r)rrr1rrrrr�s-


r)�	metaclassc@seZdZdZdS)rz.Enum where members are also (and must be) intsN)r-r*r.r/rrrrrsrcCs|jSrlrr&rrrr�"sr�c@speZdZdZdd�Zedd��Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)rz
    Support for flags
    c	Csb|s|dur|SdSt|�D]8}zt|�}WqVWqtyRtd|�d�Yq0qd|dS)r�NrzInvalid Flag value: %rr)r��	_high_bitr�r%)rr�r�r�r�Zhigh_bitrrrr?*s	
zFlag._generate_next_value_cCs.|}|dkr|}|�|�}|dkr*|}|S)�V
        Returns member (possibly creating it) if one can be found for value.
        r)r>)r+r1Zoriginal_valueZpossible_memberrrrr@=s
zFlag._missing_cCsb|j�|d�}|dur^t||�\}}|r:td||jf��t�|�}d|_||_|j�	||�}|S)�L
        Create a composite member iff value contains only members.
        Nr�)
rr��
_decomposerIr.r�rqr�rsrw)r+r1�
pseudo_memberr�extra_flagsrrrr>Js
zFlag._create_pseudo_member_cCs8t||j�s&tdt|�j|jjf��|j|j@|jkS)zP
        Returns True if self has at least the same flags set as other.
        r�)rKr;r%r�r.rs�r'�otherrrrr�^s��zFlag.__contains__cCsV|j}|jdur$d|j|j|jfSt||j�\}}d|jd�dd�|D��|jfS)Nr��|cSsg|]}t|jp|j��qSr�rLr�rsrnrrrr�orbz!Flag.__repr__.<locals>.<listcomp>)r;r�r-rsr�r{�r'r+r��	uncoveredrrrrths
�z
Flag.__repr__cCs�|j}|jdur d|j|jfSt||j�\}}t|�dkr^|djdur^d|j|djfSd|jd�dd�|D��fSdS)Nr�rrz%s.%rr�cSsg|]}t|jp|j��qSrr�rnrrrr�}rbz Flag.__str__.<locals>.<listcomp>)r;r�r-r�rsrr{r�rrrruss
�zFlag.__str__cCs
t|j�Srl)�boolrsr9rrrr��sz
Flag.__bool__cCs"t||j�stS|�|j|jB�Srl�rKr;�NotImplementedrsr�rrr�__or__�szFlag.__or__cCs"t||j�stS|�|j|j@�Srlr�r�rrr�__and__�szFlag.__and__cCs"t||j�stS|�|j|jA�Srlr�r�rrr�__xor__�szFlag.__xor__cCsNt|j|j�\}}|�d�}|jD] }||vr"|j|j@s"||B}q"|�|�Sr�)r�r;rs)r'r�r�Zinvertedrorrr�
__invert__�s


zFlag.__invert__N)r-r*r.r/r?r�r@r>r�rtrur�r�r�r�r�rrrrr%s



rc@sTeZdZdZedd��Zedd��Zdd�Zdd	�Zd
d�Z	eZ
eZe	Zdd
�Z
dS)rz)
    Support for integer-based Flags
    cCs*t|t�std||jf��|�|�}|S)r�r�)rK�intrIr.r>)r+r1Z
new_memberrrrr@�s

zIntFlag._missing_cCs�|j�|d�}|dur�|g}t||�\}}|rtt|�}d|}||jvrZ||vrZ|�|�||krjd}q*||N}q*t|�D]*}t�||�}d|_||_	|j�
||�}q||S)r�Nrr)rr�r�r�rQr�r�rqr�rsrw)r+r1r�Zneed_to_createrr�Zbit�
flag_valuerrrr>�s(
�


zIntFlag._create_pseudo_member_cCs0t||jtf�stS|�|j|�|�jB�}|Srl�rKr;r�r�rs)r'r�r�rrrr��szIntFlag.__or__cCs,t||jtf�stS|�|j|�|�j@�Srlr�r�rrrr��szIntFlag.__and__cCs,t||jtf�stS|�|j|�|�jA�Srlr�r�rrrr��szIntFlag.__xor__cCs|�|j�}|Srlr�)r'r�rrrr��szIntFlag.__invert__N)r-r*r.r/r�r@r>r�r�r��__ror__�__rand__�__rxor__r�rrrrr�s
	
 rcCs|��dS)zJ
    returns index of highest bit, or -1 if value is zero or negative
    r)�
bit_length)r1rrrr��sr�cCs^g}|j��D]"\}}||jkr|�||jf�q|rZd�dd�|D��}td||f��|S)zI
    Class decorator for enumerations ensuring unique member values.
    z, cSsg|]\}}d||f�qS)z%s -> %sr)r^�aliasrrrrr��rbzunique.<locals>.<listcomp>z duplicate values found in %r: %s)r�rfrrQr{rI)ZenumerationZ
duplicatesrr�Z
alias_detailsrrrr
�s
��r
c	Cs�|}|dk}g}|D].}|j}|r||@|kr|�|�||M}q|s�|}|r�dt|�}||jvr�|�|j|�||M}||M}qL|s�||jvr�|�|j|�|jdd�dd�t|�dkr�|dj|kr�|�d�||fS)z-
    Extract all members from the value.
    rrcSs|jSrlr�)rorrrr�rbz_decompose.<locals>.<lambda>T)rS�reverser)r1rQr�rr�rrx)	Zflagr1Znot_covered�negativer�r�r�Ztmpr�rrrr��s,



r�)r��typesrr�__all__rrr r$r,r�r0r	�dictr2rr�rr�rr�rrr�r
r�rrrr�<module>s0

	T{vI
© 2025 GrazzMean