ok

Mini Shell

Direktori : /proc/thread-self/root/opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Current File : //proc/thread-self/root/opt/alt/python311/lib64/python3.11/__pycache__/enum.cpython-311.pyc

�

�f�6��B�ddlZddlZddlmZmZddlmZddl	m
Z
gd�ZdxZxZ
xZxZZGd�de��ZGd�d	e��Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�ZdCd�Zd�ZGd�d��Ze��ZGd�d��Z Gd�de��Z!Gd�d��Z"Gd�de#��Z$Gd�d e%��Z&e&Z'Gd!�d"e&�#��ZGd$�d%e��ZGd&�d'e(e��Z)Gd(�d)e*e��Z+d*�Z,e,Z-d+�Z.Gd,�d-e+��Z/e/\Z0Z1ZZ2Gd.�d/ee0�0��Z
Gd1�d2e(ee
e2�0��Z3d3�Z4d4�Z5d5�Z6d6�Z7d7�Z8d8�Z9dDd:�Z:efddd;�d<�Z;e;e+��Gd=�d>����Z<e<\Z=Z>Z?Gd?�d@��Z@dA�ZAdCdd0�dB�ZBe)e+e3fZdS)E�N)�MappingProxyType�DynamicClassAttribute)�or_)�reduce)�EnumType�EnumMeta�Enum�IntEnum�StrEnum�Flag�IntFlag�ReprEnum�auto�unique�property�verify�member�	nonmember�FlagBoundary�STRICT�CONFORM�EJECT�KEEP�global_flag_repr�global_enum_repr�
global_str�global_enum�	EnumCheck�
CONTINUOUS�NAMED_FLAGS�UNIQUE�pickle_by_global_name�pickle_by_enum_namec��eZdZdZd�ZdS)rzK
    Protects item from becoming an Enum member during class creation.
    c��||_dS�N��value��selfr(s  �+/opt/alt/python311/lib64/python3.11/enum.py�__init__znonmember.__init__�
����
�
�
�N��__name__�
__module__�__qualname__�__doc__r,�r.r+rr�-������������r.rc��eZdZdZd�ZdS)rzE
    Forces item to become an Enum member during class creation.
    c��||_dSr&r'r)s  r+r,zmember.__init__#r-r.Nr/r4r.r+rrr5r.rc�b�t|d��pt|d��pt|d��S)z?
    Returns True if obj is a descriptor, False otherwise.
    �__get__�__set__�
__delete__)�hasattr)�objs r+�_is_descriptorr>&s:��

�C��#�#�
'��C��#�#�
'��C��&�&�r.c��t|��dko7|dd�|dd�cxkodknco|ddko|ddkS)z=
    Returns True if a __dunder__ name, False otherwise.
    �N�����__�_�����len��names r+�
_is_dunderrJ0sl��

��I�I��M�
���!��H��R�S�S�	�)�)�)�)�T�)�)�)�)�
���G�s�N�
�
��H��O�	r.c��t|��dko7|d|dcxkodknco|dd�dko
|dd�dkS)z;
    Returns True if a _sunder_ name, False otherwise.
    rAr���rD�rBrFrHs r+�
_is_sunderrN;sn��

��I�I��M�
���G�t�B�x�&�&�&�&�3�&�&�&�&�
���1��I���
�
��B��K�3��	r.c��t|t��sdSt|dd��}|dzt|dd��z}d|z}||kp|�|��S)NFr2��.r0)�
isinstance�type�getattr�endswith)�cls_namer=�qualname�	s_pattern�	e_patterns     r+�_is_internal_classrZFsk���c�4� � ���u��s�N�B�/�/�H��3����j�"�!=�!=�=�I��i��I��y� �@�H�$5�$5�i�$@�$@�@r.c���d|�d�}t|��}t|��|krA|�|��r,|||dz�dgkr|ddks|ddkrdSdS)NrDrCrMrLrBTF)rG�
startswith)rVrI�pattern�pat_lens    r+�_is_privater_Os~���!���$�G��'�l�l�G���I�I��������(�(�
 ��W�W�Q�Y�&�'�C�5�0�0��b��S���D��H��O�O��t��ur.c�.�|dkrdS||dz
z}|dkS)z<
    True if only one bit set in num (should be an int)
    rFrMr4)�nums r+�_is_single_bitrb]s(���a�x�x��u��3��7�N�C��!�8�Or.c��d�}t|t��r||d<d|d<dSt|d|��t|dd��dS)z]
    Make the given obj un-picklable.

    obj should be either a dictionary, or an Enum
    c�&�td|z���)Nz%r cannot be pickled)�	TypeError�r*�protos  r+�_break_on_call_reducez6_make_class_unpicklable.<locals>._break_on_call_reducels���.��5�6�6�6r.�
__reduce_ex__z	<unknown>r1N)rR�dict�setattr)r=rhs  r+�_make_class_unpicklablerlfsh��7�7�7��#�t���0�4��O��'��L������_�&;�<�<�<���\�;�/�/�/�/�/r.c#�K�|}t|t��r|j}|dkrtd|z���|r||dzz}|V�||z}|�dSdS)Nrz%r is not a positive integerrM)rRr	r(�
ValueError)ra�original�bs   r+�_iter_bits_lsbrqus������H��#�t�����i��
�Q�w�w��7�(�B�C�C�C�

���C�4�!�8��������q��������r.c�:�tt|����Sr&)�listrqr's r+�show_flag_valuesrt�s����u�%�%�&�&�&r.c�`�d|���z}|dkr-tj||z���ddd��}ntj||dz
|zz��}|dd�}|dd�}|�*t	|��|kr|d|z|z|d�}|�d	|��S)
z�
    Like built-in bin(), except negative values are represented in
    twos-compliment, and the leading bit always indicates sign
    (0=positive, 1=negative).

    >>> bin(10)
    '0b0 1010'
    >>> bin(~10)   # ~10 is -11
    '0b1 0101'
    rAr�1�0rMN�rL� )�
bit_length�bltns�bin�replacerG)ra�max_bits�ceiling�s�sign�digitss      r+r|r|�s����C�#�#�%�%�%�G�
�a�x�x��I�c�G�m�$�$�,�,�S�#�q�9�9����I�s�d�g��k�W�4�4�5�5���R�a�R�5�D�
�q�r�r�U�F����v�;�;��!�!��2�h��)�F�2�X�I�J�J�?�F��d�d�F�F�#�#r.c���|�d��}d}t|d��D]
\}}|dkrn�t|��D]\}}||d�||<�d�|��S)zM
    Like textwrap.dedent.  Rewritten because we cannot import textwrap.
    �
rryN)�split�	enumerate�join)�text�lines�blanks�i�ch�j�ls       r+�_dedentr��s���
�J�J�t���E�
�F��5��8�$�$�����2�
��9�9��E���%� � �����1��Q�R�R�5��a����9�9�U���r.c��eZdZd�ZdS)�
_auto_nullc��dS)Nr�r4�r*s r+�__repr__z_auto_null.__repr__�s���|r.N)r0r1r2r�r4r.r+r�r��s#����������r.r�c�"�eZdZdZefd�Zd�ZdS)rzP
    Instances are replaced with an appropriate value in Enum class suites.
    c��||_dSr&r'r)s  r+r,z
auto.__init__�r-r.c��d|jzS)Nzauto(%r)r'r�s r+r�z
auto.__repr__�s���D�J�&�&r.N)r0r1r2r3r�r,r�r4r.r+rr�sF��������(�����'�'�'�'�'r.rc�,�eZdZdZdd�Zd�Zd�Zd�ZdS)raI
    This is a descriptor, used to define attributes that act differently
    when accessed through an enum member and through an enum class.
    Instance access is the same as property(), but access to an attribute
    through the enum class will instead look in the class' _member_map_ for
    a corresponding enum member.
    Nc�(�|�:	|j|jS#t$rt|�d|j�����wxYw|j�;	|j|jS#t$rt|�d|j����d�wxYw|�|��S)Nz has no attribute )�_member_map_rI�KeyError�AttributeError�fget)r*�instance�
ownerclasss   r+r9zproperty.__get__�s�����
�!�.�t�y�9�9���
�
�
�$�4>�J�J��	�	�J����
����
�y� �(�%�2�4�9�=�=���(�(�(�(�8B�
�
�D�I�I�N���#'�(�(����
�y�y��*�*�*s��$:�A�%A<c�z�|j�td|j�d|j�����|�||��S)N�<enum z> cannot set attribute )�fsetr��clsnamerI)r*r�r(s   r+r:zproperty.__set__�sF���9�� �.�;?�<�<�<����S���
��9�9�X�u�-�-�-r.c�x�|j�td|j�d|j�����|�|��S)Nr�z> cannot delete attribute )�fdelr�r�rI)r*r�s  r+r;zproperty.__delete__�sD���9�� �.�>B�l�l�l�D�I�I�V���
��9�9�X�&�&�&r.c�,�||_|j|_dSr&)rIr0r�)r*r�rIs   r+�__set_name__zproperty.__set_name__�s����	�!�*����r.r&)r0r1r2r3r9r:r;r�r4r.r+rr�s_��������+�+�+�+�(.�.�.�'�'�'�+�+�+�+�+r.rc��eZdZdZd�Zd�ZdS)�
_proto_memberzW
    intermediate step for enum members between class execution and final creation
    c��||_dSr&r'r)s  r+r,z_proto_member.__init__�r-r.c��t||��|j}t|t��s|f}n|}|jtur|f}|js|�|��}n|j|g|�R�}t|d��sQ|jtur||_	n;	|j|�|_	n*#t$r}td��}||_|�d}~wwxYw|j	}||_
||_|j|�t!|j��|_t&�}t)|t&��rht|t*��r/|xj|zc_t/|��r|xj|zc_d|j���zdz
|_		|j|}nE#t$r8|j���D]\}}	|	j	|kr|	}n�t<�YnwxYwn�#t<$r�t&�t)|t&��s|j�|��nZt&�St)|t&��r>t|t*��r)t/|��r|j�|��YnwxYwd}
|j dd�D]q}|j!�"|��}|�St|tFtHf��r|}
n4t|d��r#t|d��rt|d��r|}
�q�r|
ratG��}
||
_%|
�&||��|
j'|
_'|
j(|
_(|
j)|
_)tU|||
��ntU|||��||j|<	|j�+||��dS#t$r|j,�|��YdSwxYw)	zR
        convert each quasi-member into an instance of the new enum class
        �_value_z/_value_ not set in __new__, unable to create itNrArMr�r�r�)-�delattrr(rR�tuple�
_member_type_�
_use_args_�_new_member_r<�objectr��	Exceptionre�	__cause__�_name_�__objclass__r,rG�_member_names_�_sort_order_r�
issubclass�int�_flag_mask_rb�_singles_mask_rz�
_all_bits_�_value2member_map_r��itemsr��append�__mro__�__dict__�getrrrr�r�r�r�rk�
setdefault�_unhashable_values_)r*�
enum_class�member_namer(�args�enum_member�exc�new_excrI�canonical_member�found_descriptor�base�
descriptor�redirects              r+r�z_proto_member.__set_name__�s���
	�
�K�(�(�(��
���%��'�'�	��9�D�D��D��#�u�,�,��8�D��$�	E�$�1�1�*�=�=�K�K�1�*�1�*�D�t�D�D�D�K��{�I�.�.�	"��'�6�1�1�&+��#�#�"�*B�*�*B�D�*I�K�'�'�� �"�"�"�'�M���G�),�G�%�!�M�����"�����#��(���#-�� ����d�#�#�#&�z�'@�#A�#A�� ���
�:�t� <� <���%��%�%�
7��&�&�%�/�&�&�!�%�(�(�7��-�-��6�-�-�$%�:�+A�*M�*M�*O�*O�$P�ST�$T�J�!�	>�	
#�(�;�E�B�����
#�
#�
#�.8�.E�.K�.K�.M�.M�#�#�*�D�*�'�/�5�8�8�&6����9�#�N���	
#�������	>�	>�	>��L�%�j�$�7�7�!��)�0�0��=�=�=�=��$�"�:�t�4�4�%�"�5�#�.�.�%�'�u�-�-�%��)�0�0��=�=�=���!	>����$ ���&�q�r�r�*�	�	�D���*�*�;�7�7�J��%��j�8�5J�*K�L�L�	�'1�$��E��
�F�3�3���
�F�3�3�� �
�F�3�3��
(2�$����
	:��z�z�H�)�H�O��!�!�*�k�:�:�:�,�1�H�M�,�1�H�M�,�1�H�M��J��X�6�6�6�6��J��[�9�9�9�/:�
���,�	9�
�)�4�4�U�K�H�H�H�H�H���	9�	9�	9��*�1�1�%�8�8�8�8�8�8�	9���s[�B&�&
C
�0C�C
�
F�G"�?G�G"�G�G"�"BJ�?J�N"�"$O
�	O
N)r0r1r2r3r,r�r4r.r+r�r��sA�����������l9�l9�l9�l9�l9r.r�c�2��eZdZdZ�fd�Z�fd�Zd�Z�xZS)�	_EnumDictz�
    Track enum member order and ensure member names are not reused.

    EnumType will use the names found in self._member_names as the
    enumeration member names.
    c���t�����i|_g|_g|_d|_dS)NF)�superr,�
_member_names�_last_values�_ignore�_auto_called)r*�	__class__s �r+r,z_EnumDict.__init__hs>���
�����������������!����r.c	���t|j|��r!ddl}|�dtd���t|j|��r�n�t
|��r�|dvrtd|�d����|d	krG|jrtd
���t|t��r|jn|}t|d|���nx|dkr�t|t��r)|�d
d�����}nt#|��}||_t'|��t'|j��z}|rtd|������n�t+|��r
|dkrd}�n�||jvrt|�d||�����||jvr�n�t|t,��r	|j}�nt1|��r�nn||vrt|�d||�����t|t2��r|j}d}d}t|t4��rd}|f}t7|��t8ur�t;d�|D����r�g}|D]�}	t|	t4��rvd}|	jt<krC|�|dtA|j��|j!dd���|	_d|_|	j}	|j!�"|	��|�"|	����|r	|d}nt9|��}d|j|<|r|j!�"|��tG���$||��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.
        rNzzIn 3.13 classes created inside an enum will not become a member.  Use the `member` decorator to keep the current behavior.rA��
stacklevel)�_order_�_generate_next_value_�_numeric_repr_�	_missing_�_ignore_�
_iter_member_�_iter_member_by_value_�_iter_member_by_def_z_sunder_ names, such as z", are reserved for future Enum user�z4_generate_next_value_ must be defined before members�_generate_next_valuer��,ryz+_ignore_ cannot specify already set names: �	__order__r�z already defined as TFc3�@K�|]}t|t��V��dSr&)rRr)�.0�vs  r+�	<genexpr>z(_EnumDict.__setitem__.<locals>.<genexpr>�s,����+O�+O�A�J�q�$�,?�,?�+O�+O�+O�+O�+O�+Or.rM)%rZ�	_cls_name�warnings�warn�DeprecationWarningr_rNrnr�rerR�staticmethod�__func__rk�strr}r�rsr��setr�rJrr(r>rrrSr��anyr�r�rGr�r�r��__setitem__)r*�keyr(r��_gnv�already�non_auto_store�single�auto_valuedr�r�s          �r+r�z_EnumDict.__setitem__os�����d�n�e�4�4�	��O�O�O��M�M�O�&� �	
�
�
�
��t�~�s�+�+�Q	0��
��_�_�N	0�����
!�j��3�3�"�����-�-�-��$�\�#�$Z�[�[�[�)3�E�<�)H�)H�S�u�~�~�e����4�d�;�;�;�;��
�"�"��e�S�)�)�(�!�M�M�#�c�2�2�8�8�:�:�E�E� ��K�K�E�$����e�*�*�s�4�+=�'>�'>�>����$�*�&�w�*�������_�_�2	0��k�!�!����
�D�&�
&�
&��#�#�#�t�C�y�y�I�J�J�J�
�D�L�
 �
 ��
��y�
)�
)�*	0��K�E�E�
�E�
"�
"�'	0���d�{�{��c�c�c�4��9�9� M�N�N�N��E�6�*�*�
$����!�N��F��%��&�&�
"����	���E�{�{�e�#�#��+O�+O��+O�+O�+O�(O�(O�#�!���
*�
*�A�!�!�T�*�*�4�).���7�j�0�0�&*�&?�&?�$'��C��0B�,C�,C�T�EV�WX�WX�WX�EY�'&�'&�A�G�15�D�-��G���)�0�0��3�3�3��&�&�q�)�)�)�)��/�'��N�E�E�!�+�.�.�E�&*�D��s�#��
0��!�(�(��/�/�/�
�����C��'�'�'�'�'r.c���	|���D]
}||||<�n#t$r|D]
\}}|||<�YnwxYw|���D]
\}}|||<�dSr&)�keysr�r�)r*�members�more_membersrIr(s     r+�updatez_EnumDict.update�s���	#������
+�
+��$�T�]��T�
�
�
+���	#�	#�	#�&�
#�
#���e�"��T�
�
�
#�
#�	#����(�-�-�/�/�	�	�K�D�%��D��J�J�	�	s�"%�?�?)r0r1r2r3r,r�r�
__classcell__�r�s@r+r�r�asp���������"�"�"�"�"�c(�c(�c(�c(�c(�J������r.r�c�R��eZdZdZed���Zddd��fd�
Zd�Zddddddd	�d
�Zd�Z	�fd�Z
d
�Zd�Zd�Z
d�Zd�Zejd���Zd�Zd�Z�fd�Zdddddd	�d�Zdddd�d�Zed���Zed���Zed���Zed���Zed���Z�xZS)rz
    Metaclass for Enum
    c��|�||��t��}||_|�||��\}}|�t	|dd��|d<|S)Nr�)�_check_for_existing_members_r�r��_get_mixins_rT)�metacls�cls�bases�kwds�	enum_dict�member_type�
first_enums       r+�__prepare__zEnumType.__prepare__�sp��	�,�,�S�%�8�8�8��K�K�	�!�	��")�"6�"6�s�E�"B�"B���Z��!�18�� 7��2�2�I�-�.��r.NF��boundary�_simplec�2	���|rt��j||||fi|��S|�dg���d��|d}|D]}|�|d���|j}	t
|	��ddhz}
|
r/tdd�d�|
D����z���|�dd��}t|�
����}|�||��\}}
|�|||
��\}}}||d<||d	<|	D]}||}t|��||<�g|d
<i|d<i|d<g|d
<||d<|�||��|d<|pt|
dd��|d<d|d<d|d<d|d<d|d<	d}t��j||||fi|���n #t $r}|jp|}Yd}~nd}~wwxYw|�|�|��j��t(�lt(|vrc|t*urt-d���d|vr|j�_�j|d<d|vr-|j}|t*jur|j}|�_�j|d<dD]b}||vr\t|
|��}t�|��}tt*|��}t||��}|||fvrt5�||���ct6�It9�t6��r4dD]1}||vr+tt6|��}t5�||��|||<�2t:�|r|�_t:j�_|�=t?|t@��r(|�!dd���"��}t6�|dkst6�ft9�t6��sQtG�d��tG�d��tG�d��tG�d��tG�d��nWt6�Pt9�t6��r;d��D��}|tI|��kr�j%�_&|r�fd�|D��}|r3�fd�|D��}|�j'krt-d �j'�d!|������S)"Nr��mrorPzinvalid enum member name(s) %sr�c3�4K�|]}t|��V��dSr&)�repr)r��ns  r+r�z#EnumType.__new__.<locals>.<genexpr>	s(����<�<��T�!�W�W�<�<�<�<�<�<r.r�r�r�r�r�r�r�r��_value_repr_�
_boundary_rr�r�r��
_inverted_zOReprEnum subclasses must be mixed with a data type (i.e. int, str, float, etc.)�
__format__�__str__�r�rrri)�__or__�__and__�__xor__�__ror__�__rand__�__rxor__�
__invert__ryrc��g|]	}|j��
Sr4�r��r��ms  r+�
<listcomp>z$EnumType.__new__.<locals>.<listcomp>����9�9�9��1�9�9�9�9r.c�Z��g|]'}|�jvst�|j���%|��(Sr4)r�rbr��r��or�s  �r+r(z$EnumType.__new__.<locals>.<listcomp>�sF��������J�$;�;�;�~�j�YZ�m�Nc�?d�?d�;��;�;�;r.c�J��g|]}|�jvs|�jv�|�jv�|�� Sr4)r�r�r+s  �r+r(z$EnumType.__new__.<locals>.<listcomp>�sO���������!8�8�8��j�5�5�5�!�z�?X�:X�:X��
;Y�:X�:Xr.z'member order does not match _order_:
  z
  )(r��__new__r�r��popr�r�rnr�rjr�r�
_find_new_r��_find_data_repr_rT�RuntimeErrorr�rr�rr�rerrr�rkrr�r	�__new_member__rRr�r}r�r��sortedr�r�r�)rrr	�	classdictrrr
�ignorer��member_names�
invalid_namesr�rr
r.�save_new�use_argsrIr(r��e�method�enum_method�found_method�
object_method�data_type_method�member_listr�r�s                           @�r+r.zEnumType.__new__�s������	K�"�5�7�7�?�7�C��	�J�J�T�J�J�J�	���Z��,�,�3�3�J�?�?�?��:�&���	%�	%�C��M�M�#�t�$�$�$�$�!�.���L�)�)�U�B�K�7�
��	��=��H�H�<�<�m�<�<�<�<�<����
�
�-�-�	�4�0�0������*�*�+�+�	�#*�"6�"6�s�E�"B�"B���Z�&-�&8�&8��;�
�'�'�#���8�%,�	�.�!�"*�	�,��!�	3�	3�D��d�O�E�+�E�2�2�I�d�O�O�')�	�"�#�$&�	�.�!�*,�	�&�'�+-�	�'�(�%0�	�/�"�$+�$<�$<�S�%�$H�$H�	�.�!��;��:�|�T�:�:�	�,��$%�	�-� �&'�	�"�#�"#�	�,��"&�	�,��	#��C�(������#�u�i�P�P�4�P�P�J�J���	#�	#�	#��+�"��C�C�C�C�C�C�����	#�����?��I�	����,�-�-�-���H��$5�$5��f�$�$��2�����9�,�,�(3�(>�
�%�*4�*?�	�,�'��	�)�)�$�,���V�^�+�+�)�1�F�%+�
�"�'1�'9�	�)�$�J�	;�	;�D��9�$�$�%�j�$�7�7��&�z�4�8�8�� '��� 5� 5�
�#*�;��#=�#=� ��$4�m�#D�D�D��J��k�:�:�:����
�:�t� <� <���
2�
2��
�y�(�(�")�$��"5�"5�K��J��k�:�:�:�&1�I�d�O�����
4�,3�
�)�!%��J�����'�3�'�'�
<�!�/�/�#�s�3�3�9�9�;�;���������#�J�z�4�,H�,H�#��J��-�-�-��J�
�.�.�.��J� 0�1�1�1��J��-�-�-��J��-�-�-�-�
�
�*�Z��">�">�
�9�9�j�9�9�9�K��f�[�1�1�1�1�+5�+J�
�(��
�����!(������	�����$����G��*�3�3�3��i�%�4�4�4�g�g�?����
�s�+G�
G(�	G#�#G(c��dS)z6
        classes/types should always be True.
        Tr4�rs r+�__bool__zEnumType.__bool__�s	���tr.rM��modulerWrS�startrc	�j�|�|�||��S|�|||||||���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.
        NrE)r.�_create_)rr(�namesrFrWrSrGrs        r+�__call__zEnumType.__call__�sM��2�=��;�;�s�E�*�*�*��|�|����!���!����	r.c��t|t��sSddl}|�dtd���tdt
|��j�d|jj�d����t||��o
|j	|j
vS)	a
        Return True if member is a member of this enum
        raises TypeError if member is not an enum member

        note: in 3.12 TypeError will no longer be raised, and True will also be
        returned if member is the value of a member in this enum
        rNz�in 3.12 __contains__ will no longer raise TypeError, but will return True or
False depending on whether the value is a member or the value of a memberrAr�z'unsupported operand type(s) for 'in': 'z' and '�')rRr	r�r�r�rerSr2r�r�r�)rrr�s   r+�__contains__zEnumType.__contains__�s����&�$�'�'�
	L��O�O�O��M�M�`�&� �	
�
�
�
��)���L�L�-�-�-�s�}�/I�/I�/I�K�L�L�
L��&�#�&�&�L�6�=�C�<L�+L�Lr.c���||jvrt|j�d|�d����t���|��dS)Nz cannot delete member rQ)r�r�r0r��__delattr__)r�attrr�s  �r+rPzEnumType.__delattr__�sQ����3�#�#�#� �#�,�,�,�PT�PT�PT�!U�V�V�V�
�����D�!�!�!�!�!r.c�p�tgd�|jz��}|jtjur|�d��|jtjur|�d��|jturt|��Sttt|j����|z��S)N)
r�rNr3�__getitem__�__iter__�__len__�__members__r1r0r2r.�__init_subclass__)
r�r�r�r�r.�addrWr�r4�dir)r�interestings  r+�__dir__zEnumType.__dir__�s�������
�$�%������6�>�1�1��O�O�I�&�&�&�� ��(@�@�@��O�O�/�0�0�0����&�&��+�&�&�&��#�c�#�"3�4�4�5�5��C�D�D�Dr.c��t|��rt|���	|j|S#t$rt|��d�wxYw)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)rJr�r�r��rrIs  r+�__getattr__zEnumType.__getattr__s`���d���	'� ��&�&�&�	1��#�D�)�)���	1�	1�	1� ��&�&�D�0�	1���s	�-�Ac��|j|S)z4
        Return the member matching `name`.
        �r�r]s  r+rSzEnumType.__getitem__s�����%�%r.c�*���fd��jD��S)z5
        Return members in definition order.
        c3�2�K�|]}�j|V��dSr&r`�r�rIrs  �r+r�z$EnumType.__iter__.<locals>.<genexpr>s+�����F�F�4�� ��&�F�F�F�F�F�Fr.)r�rCs`r+rTzEnumType.__iter__s#���G�F�F�F�3�3E�F�F�F�Fr.c�*�t|j��S)z;
        Return the number of members (no aliases)
        )rGr�rCs r+rUzEnumType.__len__ s���3�%�&�&�&r.c�*�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�rCs r+rVzEnumType.__members__&s�� �� 0�1�1�1r.c�b�t�t|t��r
d|jzSd|jzS)Nz	<flag %r>z	<enum %r>)rr�r0rCs r+r�zEnumType.__repr__0s1����
�3�� 5� 5�����-�-����-�-r.c�D���fd�t�j��D��S)z=
        Return members in reverse definition order.
        c3�2�K�|]}�j|V��dSr&r`rcs  �r+r�z(EnumType.__reversed__.<locals>.<genexpr>:s+�����P�P�4�� ��&�P�P�P�P�P�Pr.)�reversedr�rCs`r+�__reversed__zEnumType.__reversed__6s+���Q�P�P�P�8�C�<N�3O�3O�P�P�P�Pr.c���|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 member N)r�r�r�r��__setattr__)rrIr(�
member_mapr�s    �r+rlzEnumType.__setattr__<s\����\�%�%�n�b�9�9�
��:��� �.���!G�H�H�H�
�����D�%�(�(�(�(�(r.c	��|j}|�|fn||f}	|�||	��\}
}|�||	��}t|t��r(|�dd�����}t|ttf��r�|r�t|dt��rg|g}}
g}t|
��D]Q\}}|�
||||dd���}|�|��|�||f���R|�d}|D],}t|t��r|||}}n|\}}|||<�-|�>	tj
d��jd}n#tt t"f$rYnwxYw|�t%|��n||d<|�||d	<|�|||	||�
��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.
        Nr�ryrr4rAr0r1r2�r)r�rrrRr�r}r�r�rsr�r�r��sys�	_getframe�	f_globalsr�rnr�rlr.)r�
class_namerJrFrWrSrGrrr	rDr
r5�original_names�last_values�countrIr(�itemr��member_values                     r+rIzEnumType._create_Is���-���<����d�C�[���(�(��U�;�;�
��:��'�'�
�E�:�:�	��e�S�!�!�	4��M�M�#�s�+�+�1�1�3�3�E��e�e�T�]�+�+�	,��	,�*�U�1�X�s�:S�:S�	,�$)�2�E�N��K�(��8�8�
,�
,���t�"�8�8��u�e�[�YZ�YZ�YZ�^�\�\���"�"�5�)�)�)����d�E�]�+�+�+�+��=��E��	2�	2�D��$��$�$�
1�,0�%��+�\���,0�)��\�%1�I�k�"�"��>�
���q�)�)�3�J�?����"�J��9�
�
�
���
�����>�#�I�.�.�.�.�&,�I�l�#���(0�I�n�%����w�
�E�9�x��X�X�Xs�E3�3F
�F
)r�	as_globalc�6��tj|j}|r|j}n|}�fd�|���D��}	|�d����n'#t
$r|�d����YnwxYwd�|D��}	||	d<t
|tf|	��}
t||pt���|
��}|rt|��n4tj|jj�|j
��|||<|S)z[
        Create a new Enum subclass that replaces a collection of global constants
        c�4��g|]\}}�|���||f��Sr4r4�r�rIr(�filters   �r+r(z&EnumType._convert_.<locals>.<listcomp>�s?���!�!�!��D�%��6�$�<�<�!��u�
�!�!�!r.c�"�|d|dfS�NrMrr4��ts r+�<lambda>z$EnumType._convert_.<locals>.<lambda>�s���!��a��d�|�r.�r�c��|dS�Nrr4r�s r+r�z$EnumType._convert_.<locals>.<lambda>�s
��q��t�r.c�,�i|]}|d|d��S)rrMr4)r�r�s  r+�
<dictcomp>z&EnumType._convert_.<locals>.<dictcomp>�s"��,�,�,�q��!��a��d�,�,�,r.r1)�etyper)rp�modulesr�r��sortrerSr��_simple_enumrrr1rrV)rrIrFr}�sourcerry�module_globalsr��body�tmp_clss   `       r+�	_convert_zEnumType._convert_sO�����V�,�5���	$��_�F�F�#�F�!�!�!�!�#)�<�<�>�>�!�!�!��	-��L�L�3�3�L�4�4�4�4���	-�	-�	-��L�L�^�^�L�,�,�,�,�,�	-����-�,�G�,�,�,��#��\���t�f�Z��.�.��@�l��x�/?�4�@�@�@��I�I���	I��������K���'�0�7�7���H�H�H�"��t���
��A�!B�Bc��|D]=}|jD]3}t|t��r|jrt	d|�d|������4�>dS)Nr�z> cannot extend )r�rRrr�re��mclsrsr	�chainr�s     r+rz%EnumType._check_for_existing_members_�sr���	�	�E��
�
�
���d�H�-�-��$�2E��#�)�)�z�z�4�4�1�����
�	�	r.c���|sttfS|�||��|d}t|t��std���|�||��pt}||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__
        rLzZnew enumerations should be created as `EnumName([mixin_type, ...] [data_type,] enum_type)`)r�r	rrRrre�_find_data_type_)r�rsr	r
rs     r+rzEnumType._get_mixins_�s����	 ��4�<���)�)�*�e�<�<�<��2�Y�
��*�h�/�/�	L��K�L�L�
L��+�+�J��>�>�H�&���J�&�&r.c��|D]P}|jD]F}|tur�t|t��r|jccSd|jvr|jdccS�G�QdS)Nr�)r�r�rRrrr�r�s     r+r1zEnumType._find_data_repr_�s����		5�		5�E��
�
5�
5���6�>�>����h�/�/�5��,�,�,�,�,�,��4�=�0�0��=��4�4�4�4�4�4�1�

5��tr.c�$�t��}t��}|D]�}d}|jD]�}|�|��|tur�!t	|t
��r+|jtur|�|j��nG�ad|jvs	d|jvr/t	|t
��r��|�|p|��n|p|}����t|��dkrtd|�d|�����|r|�
��SdS)Nr.�__dataclass_fields__rMztoo many data types for �: )r�r�rXr�rRrr�r�rGrer/)r�rsr	�
data_types�
base_chainr��	candidater�s        r+r�zEnumType._find_data_type_�s;���U�U�
��U�U�
��	2�	2�E��I��
�
2�
2�����t�$�$�$��6�>�>����h�/�/�
2��)��7�7�"���t�'9�:�:�:���8��$�-�/�/�3I�T�]�3Z�3Z�!�$��1�1�!� ��N�N�9�#4��5�5�5��E� )� 1�T�I�I���z�?�?�Q����)�
�
�
�J�J�W�X�X�X�
�	��>�>�#�#�#��4r.c�2�|�dd��}|duo|du}|�RdD]C}||fD]8}t||d��}|ddjtjtjhvr|}n�9|�n
�Dtj}|�|tjtjfvrd}	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__
        r.N)r3r.FT)r�rTr.r�r	)
r�r5rr
r.r9r<�possible�targetr:s
          r+r0zEnumType._find_new_�s����-�-�	�4�0�0���T�)�A�g�T�.A���?�8�
)�
)��!,�j� 9�	�	�H�$�X�v�t�<�<�F�� � �L�"�N� �L�	&���#)������&��E�'�!�.��
���T�\�6�>�,J�!J�!J��H�H��H���(�*�*r.r&)r0r1r2r3�classmethodrr.rDrKrNrPr[r^rSrTrUr{rrVr�rjrlrIr�rrr1r�r0rrs@r+rr�s]�������������[��=A�%�u�u�u�u�u�u�u�n���$�4�$�T�YZ�ei�$�$�$�$�$�LM�M�M�*"�"�"�"�"�E�E�E�$1�1�1� &�&�&�G�G�G�'�'�'��^�2�2��^�2�.�.�.�Q�Q�Q�)�)�)�)�)�48�$�T�YZ�ei�4Y�4Y�4Y�4Y�4Y�l$�d�V[�$�$�$�$�$�L����[���'�'��[�'�*����[������[��8�*+�*+��[�*+�*+�*+�*+�*+r.rc��eZdZdZd�Zd�Zd�Zed���Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zed���Zed���ZdS)r	a�
    Create a collection of name/value pairs.

    Example enumeration:

    >>> class Color(Enum):
    ...     RED = 1
    ...     BLUE = 2
    ...     GREEN = 3

    Access them by:

    - attribute access::

    >>> Color.RED
    <Color.RED: 1>

    - value lookup:

    >>> Color(1)
    <Color.RED: 1>

    - name lookup:

    >>> Color['RED']
    <Color.RED: 1>

    Enumerations can be iterated over, and know how many members they have:

    >>> len(Color)
    3

    >>> list(Color)
    [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

    Methods can be added to enumerations, and members can have their own
    attributes -- see the documentation for details.
    c���t|��|ur|S	|j|S#t$rYn<t$r0|j���D]}|j|kr|ccYS�YnwxYw|jstd|z���	d}|�|��}n#t$r}|}d}Yd}~nd}~wwxYw	t||��r|d}d}St�>t|t��r)|jturt|t��r|d}d}St|�d|j����}|�|�|�|�td|j�d|�d���}t|t��s||_|�#d}d}wxYw)Nz%r has no members defined� is not a valid z	error in z._missing_: returned z" instead of None or a valid member)rSr�r�rer��valuesr�r�r�rRrr�rrr�rnr2r0�__context__)rr(rr��resultr;�ve_excs       r+r.zEnum.__new__Gs����;�;�#����L�		"��)�%�0�0���	�	�	��D��	"�	"�	"��*�1�1�3�3�
"�
"���>�U�*�*�!�M�M�M�M�M�+�
"�
"�	"������	?��7�#�=�>�>�>�	��C��]�]�5�)�)�F�F���	�	�	��C��F�F�F�F�F�F�����	����	��&�#�&�&�
��(�C��F�F�'�$��C��)>�)>�$���%�/�/�J�v�s�4K�4K�/���C��F�F�$�e�e�e�S�EU�EU�$V�W�W���>�c�k� �L��[�#�)�"�|�|�|�V�V�V�5���C�"�#�z�2�2�-�&,�C�O��	���C��F�M�M�M�MsL�"�
A'�3A'�#A'�&A'�B�
B4�&B/�/B4�8E-�AE-�AE-�-E3c��dSr&r4)r*r�r
s   r+r,z
Enum.__init__s���r.c�0�|s|S	|d}|���||dkr|dzSt�#t$rQddl}|�dtd���t|��D]}	|dzccYS#t$rY�wxYw|cYSwxYw)z�
        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_values: the list of values assigned
        rLrMrNz�In 3.13 the default `auto()`/`_generate_next_value_` will require all values to be sortable and support adding +1
and the value returned will be the largest value in the enum incremented by 1rxr�)r�rer�r�r�ri)rIrGrvru�lastr�r�s       r+r�zEnum._generate_next_value_�s����	��L�	��r�?�D��������{�2��&�&��a�x�� ����
	�
	�
	��O�O�O��M�M�d�&� �	
�
�
�
��k�*�*�
�
����q�5�L�L�L�L�L�� �����D������L�L�L�
	���s7�,:�:�<B�7B�;B�
B
�
B�B
�
B�Bc��dSr&r4�rr(s  r+r�zEnum._missing_�s���tr.c�z�|jjpt}d|jj�d|j�d||j���d�S)N�<rQr��>)r�rrr0r�r�)r*�v_reprs  r+r�z
Enum.__repr__�sC����,�4���� $�� 7� 7� 7�����f�f�T�\�FZ�FZ�FZ�FZ�[�[r.c�.�|jj�d|j��S)NrQ)r�r0r�r�s r+rzEnum.__str__�s���.�1�1�1�4�;�;�A�Ar.c���t��}|jjtur'tt�|����}t|dg��D],}|ddkr||jvr|�|���-|j���D]�}|j	�
��D]�\}}|ddkr�t|t��r<|j
�	||jvr|�|���M|�|���c||jvr|�|������ttgd���|z��}|S)zJ
        Returns public methods and other interesting attributes.
        r�rrDN)r�r3�__eq__�__hash__r1)r�r�r�r�r[rTr�rXrr�r�rRrr��discardr4)r*rZrIrr=rJs      r+r[zEnum.__dir__�sy���e�e���>�'�v�5�5��f�n�n�T�2�2�3�3�K��D�*�b�1�1�	&�	&�D��A�w�#�~�~�$�d�.?�"?�"?�����%�%�%���>�%�%�'�'�	*�	*�C� �\�/�/�1�1�
*�
*�	��c���7�c�>�>���c�8�,�,�*��x�+�t�4�;L�/L�/L�#����-�-�-�-�$�+�+�D�1�1�1�1���!2�2�2��O�O�D�)�)�)��
*���P�P�P�Q�Q�������r.c�R�t�t|��|��Sr&)r�r)r*�format_specs  r+rzEnum.__format__�s���~�~�c�$�i�i��5�5�5r.c�*�t|j��Sr&)�hashr�r�s r+r�z
Enum.__hash__�s���D�K� � � r.c� �|j|jffSr&)r�r�rfs  r+rizEnum.__reduce_ex__�s���~���/�/�/r.c��|Sr&r4)r*�memos  r+�__deepcopy__zEnum.__deepcopy__�����r.c��|Sr&r4r�s r+�__copy__z
Enum.__copy__�r�r.c��|jS)zThe name of the Enum member.�r�r�s r+rIz	Enum.name�s���{�r.c��|jS)zThe value of the Enum member.r%r�s r+r(z
Enum.value�s���|�r.N)r0r1r2r3r.r,r�r�r�r�rr[rr�rir�r�rrIr(r4r.r+r	r	s������%�%�N6�6�6�p
�
�
�!�!�!�F����[��\�\�\�B�B�B����:6�6�6�!�!�!�0�0�0�����������X������X���r.r	)�	metaclassc��eZdZdZdS)rzS
    Only changes the repr(), leaving str() and format() to the mixed-in type.
    N�r0r1r2r3r4r.r+rr�����������r.rc��eZdZdZdS)r
z8
    Enum where members are also (and must be) ints
    Nr�r4r.r+r
r
�r�r.r
c��eZdZdZd�Zd�ZdS)rz;
    Enum where members are also (and must be) strings
    c�J�t|��dkrtd|�����t|��dkr3t|dt��st|d�d����t|��dkr3t|dt��std|d�����t|��dkr3t|dt��std|dz���t|�}t�||��}||_|S)	z$values must already be of type `str`rxztoo many arguments for str(): rMrz is not a stringrAzencoding must be a string, not zerrors must be a string, not %r)rGrerRr�r.r�)rr�r(rs    r+r.zStrEnum.__new__s���v�;�;��?�?��)�&�&�K�L�L�L��v�;�;�!����f�Q�i��-�-�
F���q�	�	�	� D�E�E�E��v�;�;�!����f�Q�i��-�-�
U��i�v�a�y�y� S�T�T�T��v�;�;�!����f�Q�i��-�-�
Q�� A�V�A�Y� O�P�P�P��V������S�%�(�(������
r.c�*�|���S)zD
        Return the lower-cased version of the member name.
        )�lower)rIrGrvrus    r+r�zStrEnum._generate_next_value_s���z�z�|�|�r.N)r0r1r2r3r.r�r4r.r+rr�s<�����������*����r.rc��|jSr&rHrfs  r+r"r"s
���9�r.c�,�t|j|jffSr&)rTr�r�rfs  r+r#r#!s���T�^�T�[�1�1�1r.c�b�eZdZdZe��Ze��Ze��Ze��ZdS)ra
    control how out of range values are handled
    "strict" -> error is raised             [default for Flag]
    "conform" -> extra bits are discarded
    "eject" -> lose flag status
    "keep" -> keep flag status and all bits [default for IntFlag]
    N)	r0r1r2r3rrrrrr4r.r+rr%sF���������T�V�V�F��d�f�f�G��D�F�F�E��4�6�6�D�D�Dr.rc��eZdZdZeZd�Zed���ZeZ	ed���Z
ed���Zd�Zd�Z
d�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�ZeZeZeZdS)rz
    Support for flags
    c��|s|�|ndSt|��}	t|��}n!#t$rtd|z��d�wxYwd|dzzS)z�
        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_values: the last value assigned or None
        NrMzinvalid flag value %rrA)�max�	_high_bitr�re)rIrGrvru�
last_value�high_bits      r+r�zFlag._generate_next_value_;s����	5�!�-�5�5�1�4���%�%�
�	L� ��,�,�H�H���	L�	L�	L��3�j�@�A�A�t�K�	L�����X�a�Z� � s	�)�Ac#�vK�t||jz��D]}|j�|��V��dS)za
        Extract all members from the value in definition (i.e. increasing value) order.
        N)rqr�r�r�)rr(�vals   r+r�zFlag._iter_member_by_value_MsP����
"�%�#�/�"9�:�:�	2�	2�C��(�,�,�S�1�1�1�1�1�1�	2�	2r.c#�`K�t|�|��d����Ed{V��dS)zI
        Extract all members from the value in definition order.
        c��|jSr&)r�)r's r+r�z+Flag._iter_member_by_def_.<locals>.<lambda>^s��a�n�r.r�N)r4r�r�s  r+r�zFlag._iter_member_by_def_Ws^����
��*�*�5�1�1�,�,����	�	�	�	�	�	�	�	�	r.c��t|t��st|�d|j�����|j}|j}|j}d}||cxkr|krnn|||zzr�|jturjt|�
��|�
����}t|�d|�dt||���dt||�������|jtur||z}ni|jtur|S|jtur2|dkr+t|dzd|�
��z��|z}nt|�d	|j�����|dkr
|}|dz|z}||z}||z}||z}	|r;|jtur-t|j�d
|�d|�dt|���d
����|jt"urt"�|��}
n|j�||��}
t'|
d��s||
_|	s|�rg}d}|�|	��D]!}
|�|
��||
jz}�"|ra|	|z}|j���D]B\}}||vr9|jr2|j|z|jkr|�|��||jz}�C||z}d�d�|D����|
_|sd|
_nT|r"|jturt|�d|�����|r&|
xjd|�|��zz
c_nd|
_|j�||
��}
|�
|
|j|<|
S)z�
        Create a composite member containing all canonical members present in `value`.

        If non-member values are present, result depends on `_boundary_` setting.
        r�Nz invalid value z
    given z
  allowed rrMrAz unknown flag boundary �(z) -->  unknown values z [�]r��|c��g|]	}|j��
Sr4r�r&s  r+r(z"Flag._missing_.<locals>.<listcomp>�s��,G�,G�,G�!�Q�X�,G�,G�,Gr.z: no members with value z|%s)rRr�rnr2r�r�r�rrr�rzr|rrrr0r�r�r.r<r�r�r�r�r�r�r�r�r�r�)rr(�	flag_mask�singles_mask�all_bits�	neg_valuer~�unknown�aliasesrx�
pseudo_memberr��combined_valuer'r�pms                r+r�zFlag._missing_as,���%��%�%�	��.3�e�e�S�5E�5E�F���
��O�	��)���>���	��I��2�2�2�2�(�2�2�2�2�2��H�y�0�1�3��~��'�'��u�/�/�1�1�9�3G�3G�3I�3I�J�J�� ��C�C�����E�8�(<�(<�(<�(<�c�)�X�>V�>V�>V�������7�*�*��	�)�����5�(�(�����4�'�'��1�9�9����
�A��0@�0@�0B�0B�,C�D�D�#�$���
!�9<���c�n�n�O�����1�9�9��I��q�L�5�(�E��9�*�$���<�-�'���|�+���	�s�~�T�1�1���|�|�|�U�U�U�G�G�G�S��\�\�\�\�C���
�
���&�&�"�N�N�3�/�/�M�M��-�5�5�c�5�A�A�M��}�i�0�0�	*�$)�M�!��	(�7�	(��G��N��&�&�|�4�4�
,�
,�����q�!�!�!��!�)�+����
5�$�w�.�� �-�3�3�5�5�5�5�E�A�r���(�(�R�Z�(�B�J��<N�RT�R\�<\�<\����r�*�*�*�&�"�*�4����n�,�G�#&�8�8�,G�,G�w�,G�,G�,G�#H�#H�M� �!�
L�'+�
�$�$��
L�S�^�v�5�5� �3�3�3���!P�Q�Q�Q��
L��$�$���0B�0B�7�0K�0K�(K�K�$�$��#'�M� ��.�9�9�%��O�O�
�� �0=�C�"�9�-��r.c��t||j��s1tdt|��j�d|jj�����|j|jz|jkS)zP
        Returns True if self has at least the same flags set as other.
        z&unsupported operand type(s) for 'in': � and )rRr�rerSr2r�)r*�others  r+rNzFlag.__contains__�sj���%���0�0�	L��)���K�K�,�,�,�d�n�.I�.I�K�L�L�
L��}�t�|�+�u�}�<�<r.c#�JK�|�|j��Ed{V��dS)z4
        Returns flags in definition order.
        N)r�r�r�s r+rTz
Flag.__iter__�s6�����%�%�d�l�3�3�3�3�3�3�3�3�3�3�3r.c�4�|j���Sr&)r��	bit_countr�s r+rUzFlag.__len__�s���|�%�%�'�'�'r.c��|jj}|jjpt}|j�d|�d||j���d�Sd|�d|j�d||j���d�S)Nr�r�r�rQ)r�r0rrr�r�)r*rVr�s   r+r�z
Flag.__repr__�sw���>�*����,�4����;���!)���6�6�$�,�+?�+?�+?�+?�@�@��%-�H�H�d�k�k�k�6�6�$�,�;O�;O�;O�;O�P�Pr.c�Z�|jj}|j�
|�d|j�d�S|�d|j��S)Nr��)rQ)r�r0r�r��r*rVs  r+rzFlag.__str__�s<���>�*���;��'�x�x�����6�6�&�h�h����4�4r.c�*�t|j��Sr&)�boolr�r�s r+rDz
Flag.__bool__�s���D�L�!�!�!r.c��t||j��r|jS|jturt||j��r|St
Sr&)rRr�r�r�r��NotImplemented)r*�flags  r+�
_get_valuezFlag._get_value�sI���d�D�N�+�+�	��<��
�
�v�
-�
-�*�T�4�CU�2V�2V�
-��K��r.c���|�|��}|turtS||fD]*}|�|���td|�d�����+|j}|�||z��S)NrMz,' cannot be combined with other flags with |�r�r�rer�r��r*r��other_valuer�r(s     r+rzFlag.__or__�����o�o�e�,�,���.�(�(�!�!��%�K�	X�	X�D����t�$�$�,�� V�D� V� V� V�W�W�W�-�����~�~�e�k�1�2�2�2r.c���|�|��}|turtS||fD]*}|�|���td|�d�����+|j}|�||z��S)NrMz,' cannot be combined with other flags with &r�r�s     r+rzFlag.__and__�r�r.c���|�|��}|turtS||fD]*}|�|���td|�d�����+|j}|�||z��S)NrMz,' cannot be combined with other flags with ^r�r�s     r+rzFlag.__xor__r�r.c�*�|�|���td|�d����|j�^|jtt
fvr!|�|j��|_n(|�|j|jz��|_|jS)NrMz' cannot be inverted)	r�rerrrrr�r�r�r�s r+r#zFlag.__invert__s����?�?�4� � �(��:��:�:�:�;�;�;��?�"���5�$�-�/�/�"&�.�.�$�,��"?�"?����"&�.�.��1D���}�1T�"U�"U�����r.N)r0r1r2r3rr�r�r�r�r�r�r�rNrTrUr�rrDr�rrrr#r!r r"r4r.r+rr4sA���������N�!�!�!�$�2�2��[�2�+�M�����[���Z�Z��[�Z�x=�=�=�4�4�4�(�(�(�Q�Q�Q�5�5�5�"�"�"����	3�	3�	3�	3�	3�	3�	3�	3�	3�	�	�	��H��G��H�H�Hr.rroc��eZdZdZdS)r
z)
    Support for integer-based Flags
    Nr�r4r.r+r
r
r�r.r
c�0�|���dz
S)zJ
    returns index of highest bit, or -1 if value is zero or negative
    rM)rzr's r+r�r�!s��������!�!r.c��g}|j���D],\}}||jkr|�||jf���-|r4d�d�|D����}td|�d|�����|S)zI
    Class decorator for enumerations ensuring unique member values.
    �, c�"�g|]\}}|�d|����
S�z -> r4�r��aliasrIs   r+r(zunique.<locals>.<listcomp>1s'��L�L�L�
���u�u�u�d�d�+�L�L�Lr.zduplicate values found in r�)rVr�rIr�r�rn)�enumeration�
duplicatesrIr�
alias_detailss     r+rr's����J�#�/�5�5�7�7�3�3���f��6�;������t�V�[�1�2�2�2���.��	�	�L�L��L�L�L�N�N�
��j����m�m�-�.�.�	.��r.c�>�|dkrdS|dt|��zkS)NrMFrA)r�r's r+�
_power_of_twor6s(���q�y�y��u��A��5�)�)�)�)�)r.c�d�|jj�d��d}|�d|j��S)z{
    use module.enum_name instead of class.enum_name

    the module is the last module in case of a multi-module name
    rQrL)r�r1r�r�)r*rFs  r+rr;s4���^�
&�
,�
,�S�
1�
1�"�
5�F��f�f�d�k�k�*�*r.c�h��|jj�d��d�|jj}|j���d|�d|j�d�St
|j��r��d|j��S|jtj	ur9d�
�fd�|j�d��D����Sg}|j�d��D]L}|d���r|�
|���2|�
��d|�����Md�
|��S)	z{
    use module.flag_name instead of class.flag_name

    the module is the last module in case of a multi-module name
    rQrLNr�r�r�c���g|]	}��d|����
S)rQr4)r�rIrFs  �r+r(z$global_flag_repr.<locals>.<listcomp>Qs$���S�S�S�d�F�F�F�D�D�1�S�S�Sr.r)r�r1r�r0r�r�rbrrrr�rI�isdigitr�)r*rVrIrrFs    @r+rrDs2����^�
&�
,�
,�S�
1�
1�"�
5�F��~�&�H��{��$�f�f�h�h�h�����=�=��d�l�#�#�/� �&�&�$�+�+�.�.���l�/�/�/��x�x�S�S�S�S�d�i�o�o�c�>R�>R�S�S�S�T�T�T�����"�"�3�'�'�	3�	3�A���t�|�|�~�~�
3����A��������v�v�v�q�q�1�2�2�2�2��x�x��~�~�r.c�P�|j�|jj}|�d|j�d�S|jS)z2
    use enum_name instead of class.enum_name
    Nr�r�)r�r�r0r�r�s  r+rr[s3���{���>�*��#�8�8�T�\�\�\�2�2��{�r.Fc��t|t��r
t|_nt|_t|t
��r|rt|_tj	|j
j�|j
��|S)z�
    decorator that makes the repr() of an enum member reference its module
    instead of its class; also exports all members to the enum's module's
    global namespace
    )r�rrr�rrrrrpr�r1r�rrV)r�
update_strs  r+rresm���#�t���(�'����'����c�8�$�$�!�
�!� ����K����(�/�/���@�@�@��Jr.)rr:c��������fd�}|S)a�
    Class decorator that converts a normal class into an :class:`Enum`.  No
    safety checks are done, and some advanced behavior (such as
    :func:`__init_subclass__`) is not available.  Enum creation can be faster
    using :func:`simple_enum`.

        >>> from enum import Enum, _simple_enum
        >>> @_simple_enum(Enum)
        ... class Color:
        ...     RED = auto()
        ...     GREEN = auto()
        ...     BLUE = auto()
        >>> Color
        <enum 'Color'>
    c���|j}���j�|j�d��}|�|j}n�jj}i}i}|�||d<||d<�|d<�jx|d<}gx|d<}ix|d<}ix|d<}	g|d	<�jx|d
<}
�j|d<t�t��r��p�j|d<d|d
<d|d<d|d<d|d<tj|d<tj
|d<tj|d<tj|d<tj|d<tj|d<tj|d<|j���D]R\}}|dvr�
t)|��s.t+||��st-|��st/|��r|||<�M|||<�S|j�d���d|d<t1|�f|�d���}
dD]b}||vr\t3�|��}t3|
|��}t3t4|��}t3|
|��}|||fvrt7|
||���cg}t|
t���rdx}}|���D�]�\}}t9|t:��r.t:jt>ur||dtA|��|��}||	vrAtC��}|�"|
|��t7|
||��|	|||<���r*t9|tF��s|f}||
g|�R�}|d}n||
��}|�||_$||_%|
|_&|�'|��tC��}|�"|
|��t7|
||��|||<tA|��|_(||	|<tS|��r|�*|��||z}n||z}|�*|�����||z|
_+||
_,d ||z�-��zdz
|
_.d!�|
D��}|t_|��kr|
j0|
_1�n�|���D�]u\}}t9|t:��r5|jt>ur ||dtA|��|��|_|j}||	vrAtC��}|�"|
|��t7|
||��|	|||<���r*t9|tF��s|f}||
g|�R�}|d}n||
��}|�||_$||_%|
|_&|�'|��tA|��|_(tC��}|�"|
|��t7|
||��|||<||	|<|�*|��|�*|����wd|vr|
j|
_2tfj|
_|
S)"Nr.r3r�r�r�r�r�r�r�r�rrr�r�r�rrrrr r"r!r#)r��__weakref__r3zAn enumeration.TrrrrMrAc��g|]	}|j��
Sr4r%r&s  r+r(z7_simple_enum.<locals>.convert_class.<locals>.<listcomp>�r)r.)4r0r�r�r�r�r�r.r�rr�rrrrrr r"r!r#r�rJr_rNr>rSrTr�rkrRrr(r�rGrr�r�r�r�r�r,r�rbr�r�r�rzr�r4r�r�r3r	)rrVr.�
new_member�attrsr��gnvr7rm�value2member_maprrIr=r�r=r>r?r@�gnv_last_values�single_bits�
multi_bitsr(r�rrArr�r:s                         ���r+�
convert_classz#_simple_enum.<locals>.convert_class�s�����<�����'�H��,�"�"�9�-�-���� �)�J�J��,�4�J�������%/�D�!�"�)��^��%��\��.3�.I�I��
$�%��02�2��
���,.�.��^��z�8:�:��
!�"�%5�&(��
"�#�.3�.A�A��_���$�1��^���e�T�"�"�	1�!)�!=�U�-=�D���"&�D���!%�D���%)�D�!�"�!%�D���!�[�D��N�"�l�D��O�"�l�D��O�"�l�D��O�#�}�D���#�}�D���!%��D�����+�+�-�-�	"�	"�I�D�#��2�2�2���$���
"�;�x��#>�#>�
"�*�T�BR�BR�
"�Vd�eh�Vi�Vi�
"� ��T�
�
�!��d����<���I�&�&�.�/�D��O��(�U�I�t�h�PT�U�U�U�
�J�	;�	;�D��4���%�e�T�2�2��&�z�4�8�8�� '��� 5� 5�
�#*�;��#=�#=� ��$4�m�#D�D�D��J��k�:�:�:�����j�$�'�'�P	2�'(�(�K�*�$�{�{�}�}�#
2�#
2���e��e�T�*�*�M�t�z�Z�/G�/G��C��a��\�):�):�O�L�L�E��,�,�,�'�z�z�H��)�)�*�d�;�;�;��J��h�7�7�7�'7��'>�J�t�$�$� �8�)�%��7�7�.�%*�I�E�!+��J�!?��!?�!?�!?�� %�a����!+��J�!7�!7����).���$(�F�M�*4�F�'��O�O�E�*�*�*�'�z�z�H��)�)�*�d�;�;�;��J��h�7�7�7�'-�J�t�$�*-�l�*;�*;�F�'�.4�$�U�+�%�e�,�,�,�$�+�+�D�1�1�1�#�u�,���"�e�+�
�#�*�*�5�1�1�1�1�%0�:�%=�J�"�(3�J�%�$%�;�z�+A�*M�*M�*O�*O�$P�ST�$T�J�!�9�9�j�9�9�9�K��f�[�1�1�1�1�+5�+J�
�(�� %�{�{�}�}� 
2� 
2���e��e�T�*�*�(��{�j�0�0�&)�c�$��3�|�3D�3D�o�&V�&V���!�K�E��,�,�,�'�z�z�H��)�)�*�d�;�;�;��J��h�7�7�7�'7��'>�J�t�$�$� �8�)�%��7�7�.�%*�I�E�!+��J�!?��!?�!?�!?�� %�a����!+��J�!7�!7����).���$(�F�M�*4�F�'��O�O�E�*�*�*�*-�l�*;�*;�F�'�'�z�z�H��)�)�*�d�;�;�;��J��h�7�7�7�'-�J�t�$�.4�$�U�+� �'�'��-�-�-�#�*�*�5�1�1�1�1�����(2�(:�J�%�!�\�
���r.r4)r�rr:r!s``` r+r�r�ts8����� Q�Q�Q�Q�Q�Q�Q�d�r.c��eZdZdZdZdZdZdS)rz8
    various conditions to check an enumeration for
    zno skipped integer valuesz0multi-flag aliases may not contain unnamed flagszone name per valueN)r0r1r2r3rr r!r4r.r+rrs)��������-�J�D�K�
!�F�F�Fr.rc��eZdZdZd�Zd�ZdS)rzG
    Check an enumeration for various constraints. (see EnumCheck)
    c��||_dSr&)�checks)r*r%s  r+r,zverify.__init__'s
������r.c���|j}|j}t�t|t��rd}n't|t��rd}ntd���|D�]�}|turg}|j���D],\}}||j	kr|�
||j	f���-|r4d�d�|D����}	td|�d|	�������|tu�r,td�|D����}
t|
��d	kr��t!|
��t#|
��}}g}
|dkrPt%t'|��d
zt'|����D]!}d	|z|
vr|
�
d	|z���"nH|dkr0t%|d
z|��D]}||
vr|
�
|���nt)d|z���|
r=td|�d
|�dd�d�|
D������dd�������|t*u�r#|j}d�|D���g}d}|j���D]t\}}||vr�
|jdkr�t3t5|j����}
�fd�|
D��}|r-|�
|��|t7t8|��z}�u|r|t|��d
krd|dz}n*dd�|dd����d|d�d�}t;|��rd|z}nd|z}td|�d|�d
|�d�������|S)Nr��enumz4the 'verify' decorator only works with Enum and Flagrc�"�g|]\}}|�d|����
Srr4rs   r+r(z#verify.__call__.<locals>.<listcomp>;s'��X�X�X�M�U�D�5�5�5�$�$�7�X�X�Xr.zaliases found in r�c3�$K�|]}|jV��dSr&r')r�r;s  r+r�z"verify.__call__.<locals>.<genexpr>?s$����:�:��Q�W�:�:�:�:�:�:r.rArMzverify: unknown type %rzinvalid ryz: missing values c3�4K�|]}t|��V��dSr&)r�r&s  r+r�z"verify.__call__.<locals>.<genexpr>Rs(����;T�;T�q�C��F�F�;T�;T�;T�;T�;T�;Tr.�c��g|]	}|j��
Sr4r'r&s  r+r(z#verify.__call__.<locals>.<listcomp>Xs�� >� >� >�Q��� >� >� >r.rc���g|]}|�v�|��	Sr4r4)r�r��
member_valuess  �r+r(z#verify.__call__.<locals>.<listcomp>cs#���J�J�J�A�1�M�3I�3I�a�3I�3I�3Ir.zalias %s is missingzaliases rLr�z are missingz
value 0x%xzcombined values of 0x%xz
invalid Flag z/ [use enum.show_flag_values(value) for details])r%r0rr�r	rer!rVr�rIr�r�rnrr�rG�minr��ranger�r�r r�r�r(rsrqr�_or_rb)r*r
r%rV�	enum_type�checkrrIrrr��low�high�missingr�r7�
missing_names�
missing_valuer	�missedr(r.s                     @r+rKzverify.__call__)s"�������'����
�;�� =� =���I�I�
��T�
*�
*�	T��I�I��R�S�S�S��C	�C	�E������
�$/�$;�$A�$A�$C�$C�?�?�L�D�&��v�{�*�*�"�)�)�4���*=�>�>�>���:�$(�I�I�X�X�Z�X�X�X�%Z�%Z�M�$�*�(�[�[�-�-�&9�:�:�:�:�
�*�$�$��:�:�k�:�:�:�:�:���v�;�;��?�?����K�K��V���T������&�&�"�9�S�>�>�!�#3�Y�t�_�_�E�E�1�1���a�4�v�-�-�#�N�N�1�a�4�0�0�0��1��&�(�(�"�3�q�5�$�/�/�.�.���F�?�?�#�N�N�1�-�-�-��.�$�$=�	�$I�J�J�J��%�$�*�%�I�I�x�x�x����;T�;T�G�;T�;T�;T�1U�1U�1U�'W�"�s�d�&$�%�%�%�%�
�+�%�%�*�9�� >� >�+� >� >� >�
� "�
� !�
�#.�#;�#A�#A�#C�#C�>�>�K�D�%��|�+�+� ��{�Q��� �!�.���"=�"=�>�>�F�J�J�J�J��J�J�J�F��>�%�,�,�T�2�2�2�%���f�)=�)=�=�
�� ���=�)�)�Q�.�.� 5�
�a�8H� H���/�!%�	�	�-����*<� =� =� =� =�}�R�?P�?P�?P�!"��&�m�4�4�J� ,�}� <��� 9�M� I��$�*�'�x�x�������7������r.N)r0r1r2r3r,rKr4r.r+rr#sA�����������M�M�M�M�Mr.rc
�B�g}|j|jk�r�|j}t|�����}|j}t|�����}tt|j�����t|j�����z��}t||z��D�]/}|dvr�||vr�
||vr|�d|�����*||vr|�d|�����G||}	||}
t
|	��st|	tj	��r��|dkr|	�
dd���
dd��}|
�
dd���
dd��}||kr#|�|�dd	|	���d
d|
��������|	|
kr#|�|�dd	|	���d
d|
��������1|���|D�]^}
g}|
|vr|�d|
z���n|
|vr|�d
|
z��n�||
j}t|�����}||
j}t|�����}t||z��D]�}|dvr�||vr|�d|�d|
�����'||vr|�d|�d|
�����G||}	||}
|	|
kr#|�|�dd|	���d
d|
��������|r-|�|
�dd�|��������`dD]~}||vr||vr�||vro||vrkt||d��}t||d��}t|d��r|j}|j}||kr$|�|�dd	|��d�dd|�������~�|r%t!dd�|��z���dS)a]
    A function that can be used to test an enum created with :func:`_simple_enum`
    against the version created by subclassing :class:`Enum`::

        >>> from enum import Enum, _simple_enum, _test_simple_enum
        >>> @_simple_enum(Enum)
        ... class Color:
        ...     RED = auto()
        ...     GREEN = auto()
        ...     BLUE = auto()
        >>> class CheckedColor(Enum):
        ...     RED = auto()
        ...     GREEN = auto()
        ...     BLUE = auto()
        >>> _test_simple_enum(CheckedColor, Color)

    If differences are found, a :exc:`TypeError` is raised.
    )r1r�r�r3z
missing key: z
extra key:   r3ryrP�	z:
         zchecked -> z

         zsimple  -> z#missing member from simple enum: %rzextra member in simple enum: %r)r1r�rzmissing key z not in the simple enum member z
extra key z in simple enum member zchecked member -> zsimple member  -> z member mismatch:
      z
      )rr�rir�__getnewargs_ex__�__getnewargs__ri�
__reduce__Nr�z:  �30z
simple -> zenum mismatch:
   %sz
   )r�rsr�r�r�r��callablerRr{rr}r�r�rTr<r�re)�checked_enum�simple_enum�failed�checked_dict�checked_keys�simple_dict�simple_keysr7r��
checked_value�simple_value�compressed_checked_value�compressed_simple_valuerI�
failed_member�checked_member_dict�checked_member_keys�simple_member_dict�simple_member_keysr<�checked_method�
simple_methods                      r+�_test_simple_enumrSxsd��&�F���� 4�4�4�#�,���L�-�-�/�/�0�0��!�*���;�+�+�-�-�.�.����\�.�3�3�5�5�6�6��{�/�4�4�6�6�7�7�8�����|�k�1�2�2�	�	�C��U�U�U����$�$���K�'�'��
�
�
�3�3�9�:�:�:�:��L�(�(��
�
�
�3�3�9�:�:�:�:� ,�S� 1�
�*�3�/���M�*�*��j����.W�.W����)�#�#�/<�/D�/D�S��/L�/L�/T�/T�UY�Z\�/]�/]�,�.:�.B�.B�3�r�.J�.J�.R�.R�SW�XZ�.[�.[�+�/�3J�J�J��
�
� #����3@�=� C� C� C� C�3?�<� B� B�'"�#�#�#��
#�l�2�2��M�M��C�C�C�/<�}�?�?�?�?�/;�|�>�>�#�����
	���
�
�
� �	�	�D��M��;�&�&��
�
�C�d�J�K�K�K�K��\�)�)��
�
�?�$�F�G�G�G�G�&2�4�&8�&A�#�&*�+>�+C�+C�+E�+E�&F�&F�#�%0��%6�%?�"�%)�*<�*A�*A�*C�*C�%D�%D�"��2�5G�G�H�H�'�'�C��J�J�J� ��$6�6�6�%�,�,�,�be�be�be�gk�gk�-l�m�m�m�m��$7�7�7�%�,�,�,�X[�X[�X[�]a�]a�-b�c�c�c�c�(;�C�(@�
�'9�#�'>��(�L�8�8�)�0�0�$'�C�C�C�>K�m�$N�$N�$N�$N�>J�l�$M�$M�2&�'�'�'��
�
��
�
����j�o�o�m�<�<�<�������	�	�F���$�$��<�)?�)?���{�*�*�v�\�/I�/I�!(��v�t�!D�!D�� '��V�T� B� B�
��>�:�6�6�;�%3�%<�N�$1�$:�M�!�]�2�2��M�M�"�F�F�F�/=�~�@�@�@�@�@�.;�m�>�>�#������
�H��/�'�,�,�v�2F�2F�F�G�G�G�H�Hr.c�:��tj|j}|r|j}n|}�fd�|���D��}	|�d����n'#t
$r|�d����YnwxYw|||||pt���}|S)zS
    Create a new Enum subclass that replaces a collection of global constants
    c�4��g|]\}}�|���||f��Sr4r4r|s   �r+r(z!_old_convert_.<locals>.<listcomp>s?��������e��v�d�|�|��
�5�M���r.c�"�|d|dfSrr4r�s r+r�z_old_convert_.<locals>.<lambda>s��A�a�D�!�A�$�<�r.r�c��|dSr�r4r�s r+r�z_old_convert_.<locals>.<lambda>s
��1�Q�4�r.)rFr)rpr�r�r�r�rer)	r�rIrFr}r�rr�r�rs	   `     r+�
_old_convert_rX�s�����[��(�1�N�
� �����������%�|�|�~�~����G�)����/�/��0�0�0�0���)�)�)�������(�(�(�(�(�)�����%��g�f�x�7G�4�
H�
H�
H�C��Jr�r&)F)Crp�builtinsr{�typesrr�operatorrr1�	functoolsr�__all__r	rr�
_stdlib_enumsrr�rrr>rJrNrZr_rbrlrqrtr|r�r�rrr�rjr�rSrrr�r
r�rr"�_reduce_ex_by_global_namer#rrrrr
r�rrrrrrr�rrr r!rrSrXr4r.r+�<module>r`s���
�
�
�
�����9�9�9�9�9�9�9�9� � � � � � �������
�
�
��26�5��5�t�5�e�5�m�h���������������V�������	�	�	�	�	�	�A�A�A�������
0�
0�
0�
�
�
�'�'�'�$�$�$�$�0������������Z�\�\�
�'�'�'�'�'�'�'�'�/+�/+�/+�/+�/+�$�/+�/+�/+�dt9�t9�t9�t9�t9�t9�t9�t9�n{�{�{�{�{��{�{�{�||+�|+�|+�|+�|+�t�|+�|+�|+�z��M�M�M�M�M�X�M�M�M�M�`�����t���������c�8���������c�8����B���2��2�2�2������7���� ,������d�d�d�d�d�4�&�d�d�d�d�N�����c�8�T�D�����"�"�"�
�
�
�*�*�*�
+�+�+����.���
�
�
�
��b���b�b�b�b�b�H��g���"�"�"�"�"�"�"���"�#,��
�K��S�S�S�S�S�S�S�S�jwH�wH�wH�r�������<��'�)�
�
�
r.

Zerion Mini Shell 1.0