grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026o ®û|j—›ã@sêddlZddlmZmZgd¢Zdd„Zdd„Zdd „Zd d „Zd d „Z e ƒZ Gdd„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/alt/python310/lib64/python3.10/enum.pyÚ_is_descriptor s ÿýrcCsLt|ƒdko%|dd…|dd…kodkno%|ddko%|ddkS)z= Returns True if a __dunder__ name, False otherwise. éNééþÿÿÿÚ__Ú_éýÿÿÿ©Ú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 ÿþür cCs^d|f}t|ƒ}t|ƒ|kr-| |¡r-|||d…dgkr-|ddks+|ddkr-dSdS)Nz_%s__rrrrTF)rÚ startswith)Úcls_namerÚpatternÚpat_lenrrrÚ _is_private,s  ÿr%cCsdd„}||_d|_dS)z, Make the given class un-picklable. cSs td|ƒ‚)Nz%r cannot be pickled)Ú TypeError©ÚselfÚprotorrrÚ_break_on_call_reduce>s z6_make_class_unpicklable.._break_on_call_reducez 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__rrr6Rs  z_EnumDict.__init__cs†t|j|ƒrddl}|jd|ftdd�t|ƒr_|dvr!tdƒ‚|dkr3|jr,td ƒ‚t |d |ƒn‡|d kr^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 userBz4_generate_next_value_ must be defined before membersÚ_generate_next_valuerDú,ú z-_ignore_ cannot specify already set names: %rÚ __order__r@zAttempted to reuse key: %rz%r already defined as: %rrT)r%Ú _cls_nameÚwarningsÚwarnÚDeprecationWarningr Ú ValueErrorr:r&ÚsetattrÚ isinstanceÚstrÚreplaceÚsplitÚlistr9Úsetr7rrr r3r2rErr8Úappendr5Ú __setitem__)r(Úkeyr3rJÚalreadyr<rrrVYsj ÿü ÿÿ€€      ü  z_EnumDict.__setitem__)r/r,r0r1r6rVÚ __classcell__rrr<rr4Ks r4csðeZdZdZedd„ƒZ‡fdd„Zdd„Zd-dddd d œd d „Zd d„Z ‡fdd„Z dd„Z dd„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)NrB)Ú_check_for_existing_membersr4rIÚ _get_mixins_Úgetattr)Úmetaclsr-ÚbasesÚkwdsÚ 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|_ ˆ|_d d „| ¡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)NrDcsi|]}|ˆ|“qSrr)Ú.0Úk)Ú classdictrrÚ Æsz$EnumMeta.__new__..r@ÚmroÚzInvalid enum member name: {0}rFr1zAn enumeration.cSs.h|]}|j ¡D] \}}t|tƒr |’q qSr)Ú__dict__ÚitemsrOr)rdÚcreÚvrrrÚ Þsþýÿz#EnumMeta.__new__..r+)Ú__getnewargs_ex__Ú__getnewargs__r+Ú __reduce__c3ó�|]}|ˆjvVqdS©N©rj©rdÚm)rarrÚ õó€z#EnumMeta.__new__..Ú__new__c3rrrsrtru)ÚbaserrrwrxFTÚ_value_)Ú__repr__Ú__str__Ú __format__r+rGz#member order does not match _order_)&Ú setdefaultrUÚpopr[Ú _find_new_r7rTrMÚformatÚjoinr5ryÚ_member_names_Ú _member_map_Ú _member_type_rhÚ_value2member_map_ÚobjectÚanyr.Ú__mro__rjrOÚtuplerr{Ú_name_Ú __objclass__r6rkrNr&r\rÚ__new_member__rPrQrR)r]r-r^rfr_ÚignorerWrbryÚsave_newÚuse_argsÚ enum_membersrr@Ú invalid_namesÚ enum_classÚdynamic_attributesÚmethodsÚsabotageÚchainÚ member_namer3ÚargsÚ enum_memberÚcanonical_memberÚ class_methodÚ obj_methodÚ enum_methodr<)rzrfrarry´sÐ ÿ  ÿÿ    ýÿ   €    þ    ÿ     €    zEnumMeta.__new__cCsdS)z6 classes/types should always be True. Trr;rrrÚ__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¡)ryÚ_create_)r-r3Ú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') rOrrJrKrLr&r¤r0r=rŒr…)r-rrJrrrÚ __contains__Œs üÿÿzEnumMeta.__contains__cs(||jvr td|jƒ‚tƒ |¡dS)Nz%s: cannot delete Enum member.)r…ÚAttributeErrorr/r5Ú __delattr__)r-Úattrr<rrr¬šs zEnumMeta.__delattr__cCsgd¢|jS)N)r=r1Ú __members__r,©r„r;rrrÚ__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|Srs©r…r²rrrÚ __getitem__·ó zEnumMeta.__getitem__cs‡fdd„ˆjDƒS)z6 Returns members in definition order. c3ó�|]}ˆj|VqdSrsr´©rdr©r-rrrw¾rxz$EnumMeta.__iter__..r¯r¹rr¹rÚ__iter__ºszEnumMeta.__iter__cCó t|jƒSrs)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 )r/r¹rrrr|Ír¶zEnumMeta.__repr__cs‡fdd„tˆjƒDƒS)z> Returns members in reverse definition order. c3r·rsr´r¸r¹rrrwÔrxz(EnumMeta.__reversed__..)Ú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)rjÚgetr«r5Ú __setattr__)r-rr3Ú member_mapr<rrrÀÖ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. NrFrGrrr/)r=r[rcrOrPrQrRr‹rSÚ enumeraterBrUryÚsysÚ _getframeÚ f_globalsr«rMr±r.r,r0)r-Ú class_namer§r¢r£r¤r¥r]r^rrbrfÚoriginal_namesÚ last_valuesÚcountrr3Ú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)rdrr3©ÚfilterrrÚ )s ýÿz&EnumMeta._convert_..cSs|d|dfS)Nrrr©ÚtrrrÚ/sz$EnumMeta._convert_..)rWcSs|dS©NrrrÏrrrrÑ2s)r¢) ÚvarsrÃÚmodulesrkÚsortr&Ú_reduce_ex_by_namer+Úupdater®)r-rr¢rÍÚsourceÚmodule_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Ær^r˜rzrrrrZ9s ÿÿ€þÿ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)Nryrz%r: too many data types: %r) rTrŠrˆrÜrr†Úaddrjrr&r€)r^Ú data_typesr˜Ú candidaterz©rÆrrÚ_find_data_typeNs.    þ   € z.EnumMeta._get_mixins_.._find_data_typerzZnew enumerations should be created as `EnumName([mixin_type, ...] [data_type,] enum_type)`zCannot extend enumerations)rˆrrÜr&r„)rÆr^rárbrarràrr[Cs   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__ ryN)rŽryFT)r¿r\ryrˆr) rfrarbryr�ÚmethodÚpossibleÚtargetr‘rrrr�rs.   üùÿ  zEnumMeta._find_new_rs)r/r,r0r1Ú classmethodrcryr r¨rªr¬r°r³rµrºr¼Úpropertyr®r|r¾rÀr¦rÛÚ staticmethodrZr[r�rYrrr<rr¡s8  .%     5!  .rc@steZdZdZdd„Zdd„Zedd„ƒZdd „Zd d „Z d d „Z dd„Z dd„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||j fƒ}|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¤r‡r±r&r…Úvaluesr{rCÚ ExceptionrOrMr0r/Ú __context__)r-r3ÚmemberÚexcÚresultÚeÚve_excrrrry¦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_valuerrrrBÔs  ÿzEnum._generate_next_value_cCsdSrsr)r-r3rrrrCåszEnum._missing_cCsd|jj|j|jfS)Nú <%s.%s: %r>)r=r/rŒr{r;rrrr|ésÿz Enum.__repr__cCsd|jj|jfS)Nú%s.%s)r=r/rŒr;rrrr}í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)rjr…)rdr-rvr;rrrÎôsýýz Enum.__dir__..cSsg|] }|ddkr|‘qSrõrrurrrrÎùó)r=r1r,)r=rhrj)r(Úadded_behaviorrr;rr°ð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¤r}rrr†rˆrPr{r~)r(Ú format_specÚstr_overriddenr-Úvalrrrr~üs   zEnum.__format__cCr»rs)ÚhashrŒr;rrrÚ__hash__r¶z Enum.__hash__cCs|j|jffSrs©r=r{r'rrrr+szEnum.__reduce_ex__cCó|jS)zThe name of the Enum member.)rŒr;rrrróz Enum.namecCrþ)zThe value of the Enum member.©r{r;rrrr3!rÿz Enum.valueN)r/r,r0r1ryrBrårCr|r}r°r~rür+rrr3rrrrr s .   r)Ú metaclassc@seZdZdZdS)rz.Enum where members are also (and must be) intsN)r/r,r0r1rrrrr'srcCrþrsrr'rrrrÖ+srÖc@speZdZdZdd„Zedd„ƒZedd„ƒZdd „Zd d „Z d d „Z dd„Z dd„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òÚhigh_bitrrrrB3s   ÿ zFlag._generate_next_value_cCs.|}|dkr |}| |¡}|dkr|}|S)úV Returns member (possibly creating it) if one can be found for value. r)rA)r-r3Úoriginal_valueÚpossible_memberrrrrCFs zFlag._missing_cCsb|j |d¡}|dur/t||ƒ\}}|rtd||jfƒ‚t |¡}d|_||_|j  ||¡}|S)úL Create a composite member iff value contains only members. Nrè) r‡r¿Ú _decomposerMr0rˆryrŒr{r)r-r3Ú pseudo_memberrÚ extra_flagsrrrrASs 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©)rOr=r&r¤r0r{©r(Úotherrrrrªgs ÿÿzFlag.__contains__cCsV|j}|jdurd|j|j|jfSt||jƒ\}}d|jd dd„|Dƒ¡|jfS)Nróú|cSóg|] }t|jp |jƒ‘qSr©rPrŒr{rurrrrÎxröz!Flag.__repr__..)r=rŒr/r{rrƒ©r(r-rÚÚ uncoveredrrrr|qs ýz Flag.__repr__cCs||j}|jdurd|j|jfSt||jƒ\}}t|ƒdkr/|djdur/d|j|djfSd|jd dd„|Dƒ¡fS)Nrôrrz%s.%rr cSrrrrurrrrΆröz Flag.__str__..)r=rŒr/rr{rrƒrrrrr}|s þz Flag.__str__cCr»rs)Úboolr{r;rrrr ‰r¶z Flag.__bool__cCs"t||jƒstS| |j|jB¡Srs©rOr=ÚNotImplementedr{r rrrÚ__or__Œó z Flag.__or__cCs"t||jƒstS| |j|j@¡Srsrr rrrÚ__and__‘rz Flag.__and__cCs"t||jƒstS| |j|jA¡Srsrr rrrÚ__xor__–rz Flag.__xor__cCsNt|j|jƒ\}}| d¡}|jD]}||vr!|j|j@s!||B}q| |¡SrÒ)rr=r{)r(rÚrÚinvertedrvrrrÚ __invert__›s  € zFlag.__invert__N)r/r,r0r1rBrårCrArªr|r}r rrrrrrrrr.s      rc@sTeZdZdZedd„ƒZedd„ƒZdd„Zdd „Zd d „Z eZ eZ e Z d d „Z dS)rz) Support for integer-based Flags cCs*t|tƒstd||jfƒ‚| |¡}|S)rrè)rOÚintrMr0rA)r-r3Ú new_memberrrrrC©s  zIntFlag._missing_cCs®|j |d¡}|durU|g}t||ƒ\}}|r;t|ƒ}d|}||jvr-||vr-| |¡|| kr5d}n||N}|st|ƒD]}t ||¡}d|_||_ |j  ||¡}q?|S)rNrr) r‡r¿rrrUr½rryrŒr{r)r-r3r Úneed_to_createrr ÚbitÚ flag_valuerrrrA³s(   õ zIntFlag._create_pseudo_member_cCs0t||jtfƒs tS| |j| |¡jB¡}|Srs©rOr=rrr{)r(r rîrrrrÔszIntFlag.__or__cCs,t||jtfƒs tS| |j| |¡j@¡Srsr r rrrrÚózIntFlag.__and__cCs,t||jtfƒs tS| |j| |¡jA¡Srsr r rrrrßr!zIntFlag.__xor__cCs| |j¡}|Srsrý)r(rîrrrrèszIntFlag.__invert__N)r/r,r0r1rårCrArrrÚ__ror__Ú__rand__Ú__rxor__rrrrrr¤s    rcCs | ¡dS)zJ returns index of highest bit, or -1 if value is zero or negative r)Ú bit_length)r3rrrrís rcCs^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)rdÚaliasrrrrrÎýrözunique..z duplicate values found in %r: %s)r®rkrrUrƒrM)Ú enumerationÚ duplicatesrrìÚ 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þrsr)rvrrrrÑsz_decompose..T)rWÚreverser)r3rUrr‡rÕrr€) Úflagr3Ú not_coveredÚnegativerÚrìrËÚtmprrrrrs0  €    û r)rÃÚtypesrrÚ__all__rrr r%r.rˆr2r Údictr4rr¤rrrrÖrrrr rrrrrÚs4    TvI