/snap/core22/2437/usr/lib/python3.10/__pycache__
NameSizeModeActions
abc.cpython-310.pyc67510644editdlrm
aifc.cpython-310.pyc246850644editdlrm
antigravity.cpython-310.pyc8220644editdlrm
argparse.cpython-310.pyc635390644editdlrm
ast.cpython-310.pyc557390644editdlrm
asynchat.cpython-310.pyc70250644editdlrm
asyncore.cpython-310.pyc160020644editdlrm
base64.cpython-310.pyc171620644editdlrm
bdb.cpython-310.pyc258320644editdlrm
binhex.cpython-310.pyc128700644editdlrm
bisect.cpython-310.pyc25880644editdlrm
bz2.cpython-310.pyc108700644editdlrm
calendar.cpython-310.pyc263030644editdlrm
cgi.cpython-310.pyc267230644editdlrm
cgitb.cpython-310.pyc99980644editdlrm
chunk.cpython-310.pyc48600644editdlrm
cmd.cpython-310.pyc127070644editdlrm
code.cpython-310.pyc99570644editdlrm
codecs.cpython-310.pyc332190644editdlrm
codeop.cpython-310.pyc55950644editdlrm
colorsys.cpython-310.pyc32650644editdlrm
compileall.cpython-310.pyc127330644editdlrm
configparser.cpython-310.pyc454580644editdlrm
contextlib.cpython-310.pyc208950644editdlrm
contextvars.cpython-310.pyc2460644editdlrm
copy.cpython-310.pyc69960644editdlrm
copyreg.cpython-310.pyc46830644editdlrm
cProfile.cpython-310.pyc51130644editdlrm
crypt.cpython-310.pyc35500644editdlrm
csv.cpython-310.pyc117980644editdlrm
dataclasses.cpython-310.pyc265780644editdlrm
datetime.cpython-310.pyc565330644editdlrm
decimal.cpython-310.pyc3620644editdlrm
difflib.cpython-310.pyc589050644editdlrm
dis.cpython-310.pyc156560644editdlrm
doctest.cpython-310.pyc761750644editdlrm
enum.cpython-310.pyc260630644editdlrm
filecmp.cpython-310.pyc87490644editdlrm
fileinput.cpython-310.pyc140720644editdlrm
fnmatch.cpython-310.pyc42440644editdlrm
fractions.cpython-310.pyc186000644editdlrm
ftplib.cpython-310.pyc289770644editdlrm
functools.cpython-310.pyc283350644editdlrm
genericpath.cpython-310.pyc39070644editdlrm
getopt.cpython-310.pyc63390644editdlrm
getpass.cpython-310.pyc42100644editdlrm
gettext.cpython-310.pyc182210644editdlrm
glob.cpython-310.pyc58520644editdlrm
graphlib.cpython-310.pyc76160644editdlrm
gzip.cpython-310.pyc185460644editdlrm
hashlib.cpython-310.pyc68450644editdlrm
heapq.cpython-310.pyc138650644editdlrm
hmac.cpython-310.pyc69730644editdlrm
imaplib.cpython-310.pyc423120644editdlrm
imghdr.cpython-310.pyc39050644editdlrm
imp.cpython-310.pyc97860644editdlrm
inspect.cpython-310.pyc851530644editdlrm
io.cpython-310.pyc36630644editdlrm
ipaddress.cpython-310.pyc626700644editdlrm
keyword.cpython-310.pyc9270644editdlrm
linecache.cpython-310.pyc41420644editdlrm
locale.cpython-310.pyc461540644editdlrm
lzma.cpython-310.pyc121000644editdlrm
mailbox.cpython-310.pyc600910644editdlrm
mailcap.cpython-310.pyc73200644editdlrm
mimetypes.cpython-310.pyc176190644editdlrm
modulefinder.cpython-310.pyc161660644editdlrm
netrc.cpython-310.pyc39330644editdlrm
nntplib.cpython-310.pyc316230644editdlrm
ntpath.cpython-310.pyc147040644editdlrm
nturl2path.cpython-310.pyc17470644editdlrm
numbers.cpython-310.pyc118660644editdlrm
opcode.cpython-310.pyc54470644editdlrm
operator.cpython-310.pyc135080644editdlrm
optparse.cpython-310.pyc477540644editdlrm
os.cpython-310.pyc315990644editdlrm
pathlib.cpython-310.pyc420520644editdlrm
pdb.cpython-310.pyc474400644editdlrm
pickle.cpython-310.pyc468820644editdlrm
pickletools.cpython-310.pyc677600644editdlrm
pipes.cpython-310.pyc77690644editdlrm
pkgutil.cpython-310.pyc183610644editdlrm
platform.cpython-310.pyc274290644editdlrm
plistlib.cpython-310.pyc237650644editdlrm
poplib.cpython-310.pyc135730644editdlrm
posixpath.cpython-310.pyc105600644editdlrm
pprint.cpython-310.pyc178750644editdlrm
profile.cpython-310.pyc143910644editdlrm
pstats.cpython-310.pyc236210644editdlrm
pty.cpython-310.pyc41430644editdlrm
pyclbr.cpython-310.pyc97750644editdlrm
pydoc.cpython-310.pyc856450644editdlrm
py_compile.cpython-310.pyc73390644editdlrm
queue.cpython-310.pyc107920644editdlrm
quopri.cpython-310.pyc57940644editdlrm
random.cpython-310.pyc227480644editdlrm
re.cpython-310.pyc142270644editdlrm
reprlib.cpython-310.pyc52500644editdlrm
rlcompleter.cpython-310.pyc59540644editdlrm
runpy.cpython-310.pyc94110644editdlrm
sched.cpython-310.pyc61150644editdlrm
secrets.cpython-310.pyc21750644editdlrm
selectors.cpython-310.pyc171050644editdlrm
shelve.cpython-310.pyc94920644editdlrm
shlex.cpython-310.pyc77820644editdlrm
shutil.cpython-310.pyc385360644editdlrm
signal.cpython-310.pyc29350644editdlrm
site.cpython-310.pyc179220644editdlrm
sitecustomize.cpython-310.pyc2250644editdlrm
smtpd.cpython-310.pyc261470644editdlrm
smtplib.cpython-310.pyc357660644editdlrm
sndhdr.cpython-310.pyc69620644editdlrm
socket.cpython-310.pyc289630644editdlrm
socketserver.cpython-310.pyc253470644editdlrm
sre_compile.cpython-310.pyc151940644editdlrm
sre_constants.cpython-310.pyc63570644editdlrm
sre_parse.cpython-310.pyc217550644editdlrm
ssl.cpython-310.pyc452710644editdlrm
stat.cpython-310.pyc42730644editdlrm
statistics.cpython-310.pyc370510644editdlrm
string.cpython-310.pyc71020644editdlrm
stringprep.cpython-310.pyc170750644editdlrm
struct.cpython-310.pyc3070644editdlrm
subprocess.cpython-310.pyc447410644editdlrm
sunau.cpython-310.pyc164820644editdlrm
symtable.cpython-310.pyc128350644editdlrm
sysconfig.cpython-310.pyc181510644editdlrm
tabnanny.cpython-310.pyc69500644editdlrm
tarfile.cpython-310.pyc706740644editdlrm
telnetlib.cpython-310.pyc185060644editdlrm
tempfile.cpython-310.pyc273390644editdlrm
textwrap.cpython-310.pyc138120644editdlrm
this.cpython-310.pyc12640644editdlrm
threading.cpython-310.pyc449690644editdlrm
timeit.cpython-310.pyc117690644editdlrm
token.cpython-310.pyc27380644editdlrm
tokenize.cpython-310.pyc171940644editdlrm
trace.cpython-310.pyc198700644editdlrm
traceback.cpython-310.pyc217120644editdlrm
tracemalloc.cpython-310.pyc175250644editdlrm
tty.cpython-310.pyc10790644editdlrm
turtle.cpython-310.pyc1288570644editdlrm
types.cpython-310.pyc95250644editdlrm
typing.cpython-310.pyc852770644editdlrm
uu.cpython-310.pyc38670644editdlrm
uuid.cpython-310.pyc224980644editdlrm
warnings.cpython-310.pyc136460644editdlrm
wave.cpython-310.pyc175940644editdlrm
weakref.cpython-310.pyc203430644editdlrm
webbrowser.cpython-310.pyc170000644editdlrm
xdrlib.cpython-310.pyc78800644editdlrm
zipapp.cpython-310.pyc60130644editdlrm
zipfile.cpython-310.pyc618450644editdlrm
zipimport.cpython-310.pyc170330644editdlrm
_aix_support.cpython-310.pyc28790644editdlrm
_bootsubprocess.cpython-310.pyc22940644editdlrm
_collections_abc.cpython-310.pyc329250644editdlrm
_compat_pickle.cpython-310.pyc58720644editdlrm
_compression.cpython-310.pyc45120644editdlrm
_distutils_system_mod.cpython-310.pyc54220644editdlrm
_markupbase.cpython-310.pyc75720644editdlrm
_osx_support.cpython-310.pyc115350644editdlrm
_pydecimal.cpython-310.pyc1577360644editdlrm
_pyio.cpython-310.pyc736540644editdlrm
_py_abc.cpython-310.pyc46830644editdlrm
_sitebuiltins.cpython-310.pyc35470644editdlrm
_strptime.cpython-310.pyc159450644editdlrm
_sysconfigdata__linux_x86_64-linux-gnu.cpython-310.pyc353850644editdlrm
_sysconfigdata__x86_64-linux-gnu.cpython-310.pyc353790644editdlrm
_threading_local.cpython-310.pyc65390644editdlrm
_weakrefset.cpython-310.pyc76080644editdlrm
__future__.cpython-310.pyc41310644editdlrm
__phello__.foo.cpython-310.pyc1300644editdlrm
Edit: /snap/core22/2437/usr/lib/python3.10/__pycache__/enum.cpython-310.pyc (26063B)
o p̦i@sddlZddlmZmZgdZddZddZdd Zd d Zd d Z e Z GdddZ Gddde ZdZGdddeZGdddedZGdddeeZddZGdddeZGdddeeZdd Zd!d"Zd#d$ZdS)%N)MappingProxyTypeDynamicClassAttribute)EnumMetaEnumIntEnumFlagIntFlagautouniquecCst|dpt|dpt|dS)z? Returns True if obj is a descriptor, False otherwise. __get____set__ __delete__)hasattr)objr/usr/lib/python3.10/enum.py_is_descriptor s rcCsLt|dko%|dd|ddkodkno%|ddko%|ddkS)z= Returns True if a __dunder__ name, False otherwise. N___lennamerrr _is_dunders &  rcCsLt|dko%|d|dkodkno%|dddko%|dddkS)z; Returns True if a _sunder_ name, False otherwise. rrrrrrrrr _is_sunder!s r cCs^d|f}t|}t||kr-||r-|||ddgkr-|ddks+|ddkr-dSdS)Nz_%s__rrrrTF)r startswith)cls_namerpatternpat_lenrrr _is_private,s  r%cCsdd}||_d|_dS)z, Make the given class un-picklable. cSs td|)Nz%r cannot be pickled) TypeErrorselfprotorrr_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_nullvaluerrrrr Dsr cs,eZdZdZfddZfddZZS) _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&tg|_g|_g|_d|_dS)NF)super__init__ _member_names _last_values_ignore _auto_calledr( __class__rrr6Rs  z_EnumDict.__init__cst|j|rddl}|jd|ftddt|r_|dvr!td|dkr3|jr,td t |d |n|d kr^t |t rE| d d  }nt|}||_t|t|j@}|r^td|fn[t|rj|dkrid}nP||jvrutd|||jvr{n?t|s||vrtd|||ft |tr|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_namewarningswarnDeprecationWarningr ValueErrorr:r&setattr isinstancestrreplacesplitlistr9setr7rrr r3r2rErr8appendr5 __setitem__)r(keyr3rJalreadyr<rrrVYsj          z_EnumDict.__setitem__)r/r,r0r1r6rV __classcell__rrr<rr4Ks r4cseZdZdZeddZfddZddZd-dddd d d d Zd dZ fddZ ddZ ddZ ddZ ddZddZeddZddZdd Zfd!d"Zdddd d d#d$Zd-d%d&Zed'd(Zed)d*Zed+d,ZZS).rz Metaclass for Enum cKsD|||t}||_|||\}}|dur t|dd|d<|S)NrB)_check_for_existing_membersr4rI _get_mixins_getattr)metaclsr-baseskwds enum_dict member_type first_enumrrr __prepare__s zEnumMeta.__prepare__c sdgdd}|D]}|dq|||\}||\}} } fddjD} jD]} | =q7dd} t| ddh@}|rWtdd |d vr_d d <t j |||fi|}g|_ i|_ |_d d |D}i|_d vrՈturd}tfdd|Dsdvrt|n6d}|D]+}|jD]turqtfdd|Drd}n djvrd}nq|durnq|rt|jD]}| |}t|ts|f}n|}tur|f}| s||}t|ds||_n||g|R}t|dstur||_n||_|j}||_||_|j||j D]\} }|j|jkr=|}nq.|j |||vrPt|||||j |<z||j|<WqtyfYqwdD]+} | vrrqit || }t | d}t || d}|dur||urt|| |qit!dur| r||_"t!j |_ | durt| t#r| $dd%} | |j krtd|S)NrDcsi|]}||qSrr).0k) classdictrr sz$EnumMeta.__new__..r@mrozInvalid enum member name: {0}rFr1zAn enumeration.cSs.h|]}|jD] \}}t|tr |q qSr)__dict__itemsrOr)rdcrevrrr sz#EnumMeta.__new__..r+)__getnewargs_ex____getnewargs__r+ __reduce__c3|]}|jvVqdSNrjrdm)rarr z#EnumMeta.__new__..__new__c3rrrsrtru)baserrrwrxFT_value_)__repr____str__ __format__r+rGz#member order does not match _order_)& setdefaultrUpopr[ _find_new_r7rTrMformatjoinr5ry_member_names_ _member_map_ _member_type_rh_value2member_map_objectanyr.__mro__rjrOtuplerr{_name_ __objclass__r6rkrNr&r\r__new_member__rPrQrR)r]r-r^rfr_ignorerWrbrysave_newuse_args enum_membersrr@ invalid_names enum_classdynamic_attributesmethodssabotagechain member_namer3args enum_membercanonical_member class_method obj_method enum_methodr<)rzrfrarrys                           zEnumMeta.__new__cCsdS)z6 classes/types should always be True. Trr;rrr__bool__aszEnumMeta.__bool__NrmodulequalnametypestartcCs*|dur |||S|j||||||dS)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-r3namesrrrrrrr__call__gs zEnumMeta.__call__cCsRt|tsddl}|jdtddtdt|j|jjft||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&rr0r=rr)r-rrJrrr __contains__s zEnumMeta.__contains__cs(||jvr td|jt|dS)Nz%s: cannot delete Enum member.)rAttributeErrorr/r5 __delattr__)r-attrr<rrrs zEnumMeta.__delattr__cCsgd|jS)N)r=r1 __members__r,rr;rrr__dir__szEnumMeta.__dir__cCs6t|rt|z|j|WStyt|dw)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)rrrKeyErrorr-rrrr __getattr__s    zEnumMeta.__getattr__cCs |j|Srsrrrrr __getitem__ zEnumMeta.__getitem__csfddjDS)z6 Returns members in definition order. c3|]}j|VqdSrsrrdrr-rrrwrxz$EnumMeta.__iter__..rrrrr__iter__szEnumMeta.__iter__cC t|jSrs)rrrrrr__len__rzEnumMeta.__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. )rrrrrrrs zEnumMeta.__members__cCs d|jS)Nz )r/rrrrr|rzEnumMeta.__repr__csfddtjDS)z> Returns members in reverse definition order. c3rrsrrrrrrwrxz(EnumMeta.__reversed__..)reversedrrrrr __reversed__szEnumMeta.__reversed__cs0|jdi}||vrtdt||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. rzCannot reassign members.N)rjgetrr5 __setattr__)r-rr3 member_mapr<rrrszEnumMeta.__setattr__c Csf|j}|dur |fn||f}|||\} } |||} t|tr)|dd}t|ttfra|rat|dtra|g} }g} t | D]\}}| |||| dd}| || ||fqD|D]}t|trr|||}}n|\}}|| |<qc| |||| }|durz t djd}Wn tttfyYnw|durt|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[rcrOrPrQrRrrS enumeraterBrUrysys _getframe f_globalsrrMrr.r,r0)r- class_namerrrrrr]r^rrbrforiginal_names last_valuescountrr3itemr member_valuerrrrrs>         zEnumMeta._create_csttj|}|rt|}n|}fdd|D}z |jdddWnty6|jdddYnw||||d}t|_||j |||<|S)z[ Create a new Enum subclass that replaces a collection of global constants cs g|] \}}|r||fqSrr)rdrr3filterrr )s z&EnumMeta._convert_..cSs|d|dfS)Nrrrtrrr/sz$EnumMeta._convert_..)rWcSs|dSNrrrrrrr2s)r) varsrmodulesrksortr&_reduce_ex_by_namer+updater)r-rrrsourcemodule_globalsmembersrrr _convert_s"     zEnumMeta._convert_cCs<|D]}|jD]}t|tr|jrtd||jfqqdS)Nz %s: cannot extend enumeration %r)r issubclassrrr&r/)rr^rrzrrrrZ9s z$EnumMeta._check_for_existing_memberscsT|sttfSfdd}|d}t|tstd||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__ cst}|D]:}d}|jD]2}|turq t|tr&|jtur%||jnq d|jvr:t|tr1q ||p6|n|p=|}q qt|dkrNt d|f|rT| SdS)Nryrz%r: too many data types: %r) rTrrrrraddrjrr&r)r^ data_typesr candidaterzrrr_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)rrrr&r)rr^rrbrarrrr[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)rryFT)rr\ryrr) rfrarbryrmethodpossibletargetrrrrrrs.     zEnumMeta._find_new_rs)r/r,r0r1 classmethodrcryrrrrrrrrrpropertyrr|rrrr staticmethodrZr[rrYrrr<rrs8  .%     5!  .rc@steZdZdZddZddZeddZdd Zd d Z d d Z ddZ ddZ ddZ eddZeddZdS)rzV Generic enumeration. Derive from this class to define new enumerations. c Cst||ur|Sz|j|WStyYnty2|jD] }|j|kr/|YSq"Ynwz d}||}WntyR}z |}d}WYd}~nd}~wwz6t ||r`|Wd}d}St d||j f}|durs|durs||durtd|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)rrrr&rvaluesr{rC ExceptionrOrMr0r/ __context__)r-r3memberexcresulteve_excrrrrysP        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)rr&)rrrr last_valuerrrrBs  zEnum._generate_next_value_cCsdSrsr)r-r3rrrrCszEnum._missing_cCsd|jj|j|jfS)N <%s.%s: %r>)r=r/rr{r;rrrr|sz Enum.__repr__cCsd|jj|jfS)N%s.%s)r=r/rr;rrrr}sz Enum.__str__cs4fddjDddjD}gd|S)z< Returns all members and all public methods cs2g|]}|jD]}|ddkr|jvr|qqSrr)rjr)rdr-rvr;rrrsz Enum.__dir__..cSsg|] }|ddkr|qSrrrurrrr)r=r1r,)r=rhrj)r(added_behaviorrr;rrs  z Enum.__dir__cCsJt|jtjtjfv}|jtus|rt}t|}n|j}|j}|||S)z\ Returns format using actual value type unless __str__ has been overridden. ) rr}rrrrrPr{r~)r( format_specstr_overriddenr-valrrrr~s   zEnum.__format__cCrrs)hashrr;rrr__hash__rz Enum.__hash__cCs|j|jffSrsr=r{r'rrrr+szEnum.__reduce_ex__cC|jS)zThe name of the Enum member.)rr;rrrrz Enum.namecCr)zThe value of the Enum member.r{r;rrrr3!rz Enum.valueN)r/r,r0r1ryrBrrCr|r}rr~rr+rrr3rrrrrs .   r) metaclassc@seZdZdZdS)rz.Enum where members are also (and must be) intsN)r/r,r0r1rrrrr'srcCrrsrr'rrrr+src@speZdZdZddZeddZeddZdd Zd d Z d d Z ddZ ddZ ddZ ddZddZdS)rz Support for flags c CsX|s |dur|SdSt|D]}zt|}Wnty%td|dwd|dS)rNrzInvalid Flag value: %rr)r _high_bitrr&)rrrrrhigh_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-r3original_valuepossible_memberrrrrCFs zFlag._missing_cCsb|j|d}|dur/t||\}}|rtd||jft|}d|_||_|j ||}|S)L Create a composite member iff value contains only members. Nr) rr _decomposerMr0rryrr{r)r-r3 pseudo_memberr extra_flagsrrrrASs zFlag._create_pseudo_member_cCs8t||jstdt|j|jjf|j|j@|jkS)zP Returns True if self has at least the same flags set as other. r)rOr=r&rr0r{r(otherrrrrgs zFlag.__contains__cCsV|j}|jdurd|j|j|jfSt||j\}}d|jddd|D|jfS)Nr|cSg|] }t|jp |jqSrrPrr{rurrrrxrz!Flag.__repr__..)r=rr/r{rrr(r-r uncoveredrrrr|qs z Flag.__repr__cCs||j}|jdurd|j|jfSt||j\}}t|dkr/|djdur/d|j|djfSd|jddd|DfS)Nrrrz%s.%rr cSrrrrurrrrrz Flag.__str__..)r=rr/rr{rrrrrrr}|s z Flag.__str__cCrrs)boolr{r;rrrrrz Flag.__bool__cCs"t||jstS||j|jBSrsrOr=NotImplementedr{r rrr__or__ z Flag.__or__cCs"t||jstS||j|j@Srsrr rrr__and__rz Flag.__and__cCs"t||jstS||j|jASrsrr rrr__xor__rz Flag.__xor__cCsNt|j|j\}}|d}|jD]}||vr!|j|j@s!||B}q||Sr)rr=r{)r(rrinvertedrvrrr __invert__s   zFlag.__invert__N)r/r,r0r1rBrrCrArr|r}rrrrrrrrrr.s      rc@sTeZdZdZeddZeddZddZdd Zd d Z eZ eZ e Z d d Z dS)rz) Support for integer-based Flags cCs*t|tstd||jf||}|S)rr)rOintrMr0rA)r-r3 new_memberrrrrCs  zIntFlag._missing_cCs|j|d}|durU|g}t||\}}|r;t|}d|}||jvr-||vr-|||| kr5d}n||N}|st|D]}t||}d|_||_ |j ||}q?|S)rNrr) rrrrrUrrryrr{r)r-r3r need_to_createrr bit flag_valuerrrrAs(    zIntFlag._create_pseudo_member_cCs0t||jtfs tS||j||jB}|SrsrOr=rrr{)r(r rrrrrszIntFlag.__or__cCs,t||jtfs tS||j||j@Srsr r rrrrzIntFlag.__and__cCs,t||jtfs tS||j||jASrsr r rrrrr!zIntFlag.__xor__cCs||j}|Srsr)r(rrrrrszIntFlag.__invert__N)r/r,r0r1rrCrArrr__ror____rand____rxor__rrrrrrs    rcCs |dS)zJ returns index of highest bit, or -1 if value is zero or negative r) bit_length)r3rrrrs rcCs^g}|jD]\}}||jkr|||jfq|r-ddd|D}td||f|S)zI Class decorator for enumerations ensuring unique member values. z, cSsg|] \}}d||fqS)z%s -> %sr)rdaliasrrrrrrzunique..z duplicate values found in %r: %s)rrkrrUrrM) 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||jddddt|dkrq|dj|krq|d||fS)z- Extract all members from the value. rrcSrrsr)rvrrrrsz_decompose..T)rWreverser)r3rUrrrrr) flagr3 not_coverednegativerrrtmprrrrrs0       r)rtypesrr__all__rrr r%r.rr2r dictr4rrrrrrrrrr rrrrrs4    TvI