HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/__pycache__/enum.cpython-310.pyc
o

�N�g���@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�*/opt/saltstack/salt/lib/python3.10/enum.py�_is_descriptors

��rcCsLt|�dko%|dd�|dd�kodkno%|ddko%|ddkS)z=
    Returns True if a __dunder__ name, False otherwise.
    �N����Z__�_�����len��namerrr�
_is_dunders&�
�
�rcCsLt|�dko%|d|dkodkno%|dd�dko%|dd�dkS)z;
    Returns True if a _sunder_ name, False otherwise.
    rr���r�rrrrrr�
_is_sunder!s���rcCs^d|f}t|�}t|�|kr-|�|�r-|||d�dgkr-|ddks+|ddkr-dSdS)Nz_%s__rrrrTF)r�
startswith)Zcls_namer�patternZpat_lenrrr�_is_private,s
�r"cCsdd�}||_d|_dS)z,
    Make the given class un-picklable.
    cSstd|��)Nz%r cannot be pickled)�	TypeError��selfZprotorrr�_break_on_call_reduce>sz6_make_class_unpicklable.<locals>._break_on_call_reducez	<unknown>N)�
__reduce_ex__�
__module__)�clsr&rrr�_make_class_unpicklable:s
r*c@seZdZdZeZdS)r	zP
    Instances are replaced with an appropriate value in Enum class suites.
    N)�__name__r(�__qualname__�__doc__�
_auto_null�valuerrrrr	Dsr	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__rrr2Rs


z_EnumDict.__init__cs�t|j|�rddl}|jd|ftdd�t|�r_|dvr!td��|dkr3|jr,td	��t	|d
|�n�|dkr^t
|t�rE|�dd
��
�}nt|�}||_t|�t|j�@}|r^td|f��n[t|�rj|dkrid}nP||jvrutd|��||jvr{n?t|�s�||vr�td|||f��t
|t�r�|jtkr�|�|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.11r��
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_valuer@�,� 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�
ValueErrorr6r#�setattr�
isinstance�str�replace�split�listr5�setr3rrr	r/r.rArr4�appendr1�__setitem__)r%�keyr/rEZalreadyr8rrrQYsj	��
����



�z_EnumDict.__setitem__)r+r(r,r-r2rQ�
__classcell__rrr8rr0Ksr0cs�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_membersr0rD�_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]}�|=q7��dd�}
t|�ddh@}|rWtd�d�	|����d	�vr_d
�d	<t
�j|||�fi|��}g|_i|_
�|_dd�|��D�}i|_d
�vrՈtur�d}t�fdd�|D��s�d�vr�t|�n6d}|D]+}|jD]��tur�q�t�fdd�|D��r�d}n
d�jvr�d}nq�|dur�nq�|r�t|��jD]�}||}t|t�s�|f}n|}�tur�|f}|
s�||�}t|d�s�||_n||g|�R�}t|d��s�tu�r||_n�|�|_|j}||_||_|j|�|j
��D]\}}|j|jk�r=|}n�q.|j�|�||v�rPt|||�||j
|<z||j|<Wq�t�yfYq�wdD]+}|�v�rr�qit ||�}t �|d�}t ||d�}|du�r�||u�r�t|||��qit!du�r�|	�r�||_"t!j|_|
du�r�t|
t#��r�|
�$dd��%�}
|
|jk�r�td��|S)Nr@csi|]}|�|�qSrr)�.0�k)�	classdictrr�
<dictcomp>�sz$EnumMeta.__new__.<locals>.<dictcomp>r<�mro�zInvalid enum member name: {0}rBr-zAn enumeration.cSs.h|]}|j��D]\}}t|t�r	|�q	qSr)�__dict__�itemsrJr)r]�cr^�vrrr�	<setcomp>�s���z#EnumMeta.__new__.<locals>.<setcomp>r')Z__getnewargs_ex__�__getnewargs__r'�
__reduce__c3��|]}|�jvVqdS�N�rc�r]�m)rZrr�	<genexpr>���z#EnumMeta.__new__.<locals>.<genexpr>�__new__c3rjrkrlrm)�baserrrorpFT�_value_)�__repr__�__str__�
__format__r'rCz#member order does not match _order_)&�
setdefaultrP�poprU�
_find_new_r3rOrH�format�joinr1rq�_member_names_�_member_map_�
_member_type_ra�_value2member_map_�object�anyr*�__mro__rcrJ�tuplerrs�_name_�__objclass__r2rdrIr#rVr�__new_member__rKrLrM)rWr)rXr_rY�ignorerRr[rq�save_new�use_argsZenum_membersrr<Z
invalid_names�
enum_classZdynamic_attributes�methodsZsabotage�chain�member_namer/�argsZenum_memberZcanonical_memberZclass_methodZ
obj_methodZenum_methodr8)rrr_rZrrq�s�
�
��


��


�


�

�

�

zEnumMeta.__new__cCsdS)z6
        classes/types should always be True.
        Trr7rrr�__bool__aszEnumMeta.__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)r/�namesr�r�r�r�rrr�__call__gs�zEnumMeta.__call__cCsRt|t�sddl}|jdtdd�tdt|�j|jjf��t||�o(|j	|j
vS)Nrzpin 3.12 __contains__ will no longer raise TypeError, but will return True if
obj is a member or a member's valuerr:�3unsupported operand type(s) for 'in': '%s' and '%s')rJrrErFrGr#r�r,r9r�r})r)rrErrr�__contains__�s
���zEnumMeta.__contains__cs(||jvrtd|j��t��|�dS)Nz%s: cannot delete Enum member.)r}�AttributeErrorr+r1�__delattr__)r)�attrr8rrr��s
zEnumMeta.__delattr__cCsgd�|jS)N)r9r-�__members__r(�r|r7rrr�__dir__�s��zEnumMeta.__dir__cCs6t|�rt|��z|j|WStyt|�d�w)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|Srk�r}r�rrr�__getitem__��
zEnumMeta.__getitem__cs�fdd��jD�S)z6
        Returns members in definition order.
        c3��|]}�j|VqdSrkr��r]r�r)rrro�rpz$EnumMeta.__iter__.<locals>.<genexpr>r�r�rr�r�__iter__�szEnumMeta.__iter__cC�
t|j�Srk)rr|r�rrr�__len__�r�zEnumMeta.__len__cCr�)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��s
zEnumMeta.__members__cCs
d|jS)Nz	<enum %r>)r+r�rrrrt�r�zEnumMeta.__repr__cs�fdd�t�j�D�S)z>
        Returns members in reverse definition order.
        c3r�rkr�r�r�rrro�rpz(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)rc�getr�r1�__setattr__)r)rr/Z
member_mapr8rrr��szEnumMeta.__setattr__c
Csf|j}|dur
|fn||f}|�||�\}	}
|�||�}t|t�r)|�dd���}t|ttf�ra|rat|dt�ra|g}}g}
t	|�D]\}}|
�
||||
dd��}|
�|�|�||f�qD|D]}t|t�rr|||}}n|\}}|||<qc|�||||�}|dur�z
t
�d�jd}Wntttfy�Ynw|dur�t|�n||_|dur�||_|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.
        NrBrCrrr+)r9rUr\rJrKrLrMr�rN�	enumerater>rPrq�sys�	_getframe�	f_globalsr�rHr�r*r(r,)r)�
class_namer�r�r�r�r�rWrXrr[r_Zoriginal_names�last_values�countrr/�itemr��member_valuer�rrrr��s>
 



�
zEnumMeta._create_cs�ttj|�}|rt|�}n|}�fdd�|��D�}z
|jdd�d�Wnty6|jdd�d�Ynw||||d�}t|_|�|j	�|||<|S)z[
        Create a new Enum subclass that replaces a collection of global constants
        cs g|]\}}�|�r||f�qSrr)r]rr/��filterrr�
<listcomp>)s��z&EnumMeta._convert_.<locals>.<listcomp>cSs|d|dfS)Nrrr��trrr�<lambda>/sz$EnumMeta._convert_.<locals>.<lambda>)rRcSs|dS�Nrrr�rrrr�2s)r�)
�varsr��modulesrd�sortr#�_reduce_ex_by_namer'�updater�)r)rr�r��sourceZmodule_globals�membersrr�r�	_convert_s"	

��zEnumMeta._convert_cCs<|D]}|jD]}t|t�r|jrtd||jf��qqdS)Nz %s: cannot extend enumeration %r)r��
issubclassrr|r#r+)r�rXr�rrrrrrT9s
�����z$EnumMeta._check_for_existing_memberscsT|sttfS�fdd�}|d}t|t�std��||�pt}|jr&td��||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]:}d}|jD]2}|turqt|t�r&|jtur%|�|j�nqd|jvr:t|t�r1q|�|p6|�n|p=|}qqt|�dkrNt	d�|f��|rT|�
�SdS)Nrqrz%r: too many data types: %r)rOr�r�r�rr~�addrcrr#rx)rXZ
data_typesr�Z	candidaterr�r�rr�_find_data_typeNs.


�


�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�rXr�r[rZrr�rrUCs
zEnumMeta._get_mixins_c	Cs�|�dd�}|du}|dur8dD]$}||fD]}t||d�}|ddjtjtjhvr-|}nq|dur4nqtj}|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�rVrqr�r)	r_rZr[rqr��methodZpossible�targetr�rrrryrs.���

zEnumMeta._find_new_rk)r+r(r,r-�classmethodr\rqr�r�r�r�r�r�r�r�r��propertyr�rtr�r�r�r��staticmethodrTrUryrSrrr8rr�s8
.%
	
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
Cst|�|ur|Sz|j|WStyYnty2|j��D]
}|j|kr/|YSq"Ynwz	d}|�|�}WntyR}z
|}d}WYd}~nd}~wwz6t	||�r`|Wd}d}St
d||jf�}|durs|durs|�|dur�td|j|f�}t	|t
�s�||_
|�d}d}w)N�%r is not a valid %szDerror in %s._missing_: returned %r instead of None or a valid member)r�rr�r#r}�valuesrsr?�	ExceptionrJrHr,r+�__context__)r)r/�member�exc�result�eZve_excrrrrq�sP
�����
���
zEnum.__new__c	Cs2t|�D]}z|dWStyYqw|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
        r)r�r#)rr�r�r��
last_valuerrrr>�s	�zEnum._generate_next_value_cCsdSrkr)r)r/rrrr?�szEnum._missing_cCsd|jj|j|jfS)N�<%s.%s: %r>)r9r+r�rsr7rrrrt�s�z
Enum.__repr__cCsd|jj|jfS)N�%s.%s)r9r+r�r7rrrru�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)rcr})r]r)rnr7rrr��s��z Enum.__dir__.<locals>.<listcomp>cSsg|]
}|ddkr|�qSr�rrmrrrr���)r9r-r()r9rarc)r%Zadded_behaviorrr7rr��s
��zEnum.__dir__cCsJt|�jtjtjfv}|jtus|rt}t|�}n|j}|j}|�||�S)z\
        Returns format using actual value type unless __str__ has been overridden.
        )	r�rurrr~r�rKrsrv)r%�format_specZstr_overriddenr)�valrrrrv�s	
zEnum.__format__cCr�rk)�hashr�r7rrr�__hash__r�z
Enum.__hash__cCs|j|jffSrk�r9rsr$rrrr'szEnum.__reduce_ex__cC�|jS)zThe name of the Enum member.)r�r7rrrr�z	Enum.namecCr�)zThe value of the Enum member.�rsr7rrrr/!r�z
Enum.valueN)r+r(r,r-rqr>r�r?rtrur�rvr�r'rrr/rrrrr�s .


r)�	metaclassc@seZdZdZdS)rz.Enum where members are also (and must be) intsN)r+r(r,r-rrrrr'srcCr�rkrr$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	CsX|s
|dur|SdSt|�D]}zt|�}Wnty%td|�d�wd|dS)r�NrzInvalid Flag value: %rr)r��	_high_bitr�r#)rr�r�r�r�Zhigh_bitrrrr>3s	�zFlag._generate_next_value_cCs.|}|dkr	|}|�|�}|dkr|}|S)�V
        Returns member (possibly creating it) if one can be found for value.
        r)r=)r)r/Zoriginal_valueZpossible_memberrrrr?Fs
zFlag._missing_cCsb|j�|d�}|dur/t||�\}}|rtd||jf��t�|�}d|_||_|j�	||�}|S)�L
        Create a composite member iff value contains only members.
        Nr�)
rr��
_decomposerHr,r�rqr�rsrw)r)r/�
pseudo_memberr�extra_flagsrrrr=Ss
zFlag._create_pseudo_member_cCs8t||j�stdt|�j|jjf��|j|j@|jkS)zP
        Returns True if self has at least the same flags set as other.
        r�)rJr9r#r�r,rs�r%�otherrrrr�gs��zFlag.__contains__cCsV|j}|jdurd|j|j|jfSt||j�\}}d|jd�dd�|D��|jfS)Nr��|cS�g|]
}t|jp
|j��qSr�rKr�rsrmrrrr�xr�z!Flag.__repr__.<locals>.<listcomp>)r9r�r+rsr�r{�r%r)r��	uncoveredrrrrtqs
�z
Flag.__repr__cCs||j}|jdurd|j|jfSt||j�\}}t|�dkr/|djdur/d|j|djfSd|jd�dd�|D��fS)Nr�rrz%s.%rr�cSr�rr�rmrrrr��r�z Flag.__str__.<locals>.<listcomp>)r9r�r+r�rsrr{r�rrrru|s
�zFlag.__str__cCr�rk)�boolrsr7rrrr��r�z
Flag.__bool__cCs"t||j�stS|�|j|jB�Srk�rJr9�NotImplementedrsr�rrr�__or__��zFlag.__or__cCs"t||j�stS|�|j|j@�Srkr�r�rrr�__and__�r�zFlag.__and__cCs"t||j�stS|�|j|jA�Srkr�r�rrr�__xor__�r�zFlag.__xor__cCsNt|j|j�\}}|�d�}|jD]}||vr!|j|j@s!||B}q|�|�Sr�)r�r9rs)r%r�r�Zinvertedrnrrr�
__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�)rJ�intrHr,r=)r)r/Z
new_memberrrrr?�s

zIntFlag._missing_cCs�|j�|d�}|durU|g}t||�\}}|r;t|�}d|}||jvr-||vr-|�|�||kr5d}n||N}|st|�D]}t�||�}d|_||_	|j�
||�}q?|S)r�Nrr)rr�r�r�rPr�r�rqr�rsrw)r)r/r�Zneed_to_createrr�Zbit�
flag_valuerrrr=�s(


�zIntFlag._create_pseudo_member_cCs0t||jtf�s
tS|�|j|�|�jB�}|Srk�rJr9r�r�rs)r%r�r�rrrr��szIntFlag.__or__cCs,t||jtf�s
tS|�|j|�|�j@�Srkr�r�rrrr���zIntFlag.__and__cCs,t||jtf�s
tS|�|j|�|�jA�Srkr�r�rrrr��rzIntFlag.__xor__cCs|�|j�}|Srkr�)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)r/rrrr��sr�cCs^g}|j��D]\}}||jkr|�||jf�q|r-d�dd�|D��}td||f��|S)zI
    Class decorator for enumerations ensuring unique member values.
    z, cSsg|]
\}}d||f�qS)z%s -> %sr)r]�aliasrrrrr��r�zunique.<locals>.<listcomp>z duplicate values found in %r: %s)r�rdrrPr{rH)ZenumerationZ
duplicatesrr�Z
alias_detailsrrrr
�s
���r
c	Cs�|}|dk}g}|D]}|j}|r!||@|kr!|�|�||M}q
|sG|}|rGdt|�}||jvr@|�|j|�||M}||M}|s(|sV||jvrV|�|j|�|jdd�dd�t|�dkrq|dj|krq|�d�||fS)z-
    Extract all members from the value.
    rrcSr�rkr�)rnrrrr�sz_decompose.<locals>.<lambda>T)rR�reverser)r/rPr�rr�rrx)	Zflagr/Znot_covered�negativer�r�r�Ztmpr�rrrr�s0

�


�
r�)r��typesrr�__all__rrrr"r*r�r.r	�dictr0rr�rr�rr�rrr�r
r�rrrr�<module>s4
	TvI