/snap/core20/2769/usr/lib/python3.8/__pycache__
NameSizeModeActions
abc.cpython-38.pyc53340644editdlrm
aifc.cpython-38.pyc254740644editdlrm
antigravity.cpython-38.pyc7970644editdlrm
argparse.cpython-38.pyc625910644editdlrm
ast.cpython-38.pyc167630644editdlrm
asynchat.cpython-38.pyc68510644editdlrm
asyncore.cpython-38.pyc160280644editdlrm
base64.cpython-38.pyc170710644editdlrm
bdb.cpython-38.pyc249210644editdlrm
binhex.cpython-38.pyc121340644editdlrm
bisect.cpython-38.pyc23540644editdlrm
bz2.cpython-38.pyc114450644editdlrm
calendar.cpython-38.pyc270640644editdlrm
cgi.cpython-38.pyc265440644editdlrm
cgitb.cpython-38.pyc101500644editdlrm
chunk.cpython-38.pyc48390644editdlrm
cmd.cpython-38.pyc126260644editdlrm
code.cpython-38.pyc99130644editdlrm
codecs.cpython-38.pyc339560644editdlrm
codeop.cpython-38.pyc64170644editdlrm
colorsys.cpython-38.pyc32400644editdlrm
compileall.cpython-38.pyc94100644editdlrm
configparser.cpython-38.pyc457180644editdlrm
contextlib.cpython-38.pyc202290644editdlrm
contextvars.cpython-38.pyc2430644editdlrm
copy.cpython-38.pyc69870644editdlrm
copyreg.cpython-38.pyc43180644editdlrm
cProfile.cpython-38.pyc54800644editdlrm
crypt.cpython-38.pyc33870644editdlrm
csv.cpython-38.pyc119100644editdlrm
dataclasses.cpython-38.pyc236530644editdlrm
datetime.cpython-38.pyc571730644editdlrm
decimal.cpython-38.pyc3590644editdlrm
difflib.cpython-38.pyc594380644editdlrm
dis.cpython-38.pyc158080644editdlrm
doctest.cpython-38.pyc759740644editdlrm
dummy_threading.cpython-38.pyc11100644editdlrm
enum.cpython-38.pyc259620644editdlrm
filecmp.cpython-38.pyc84270644editdlrm
fileinput.cpython-38.pyc133730644editdlrm
fnmatch.cpython-38.pyc33550644editdlrm
formatter.cpython-38.pyc175450644editdlrm
fractions.cpython-38.pyc187390644editdlrm
ftplib.cpython-38.pyc280070644editdlrm
functools.cpython-38.pyc279010644editdlrm
genericpath.cpython-38.pyc40010644editdlrm
getopt.cpython-38.pyc62710644editdlrm
getpass.cpython-38.pyc41780644editdlrm
gettext.cpython-38.pyc180000644editdlrm
glob.cpython-38.pyc43430644editdlrm
gzip.cpython-38.pyc181840644editdlrm
hashlib.cpython-38.pyc67270644editdlrm
heapq.cpython-38.pyc140700644editdlrm
hmac.cpython-38.pyc63880644editdlrm
imaplib.cpython-38.pyc414640644editdlrm
imghdr.cpython-38.pyc41180644editdlrm
imp.cpython-38.pyc98090644editdlrm
inspect.cpython-38.pyc805930644editdlrm
io.cpython-38.pyc34540644editdlrm
ipaddress.cpython-38.pyc628290644editdlrm
keyword.cpython-38.pyc9980644editdlrm
linecache.cpython-38.pyc38670644editdlrm
locale.cpython-38.pyc346740644editdlrm
lzma.cpython-38.pyc120180644editdlrm
mailbox.cpython-38.pyc602640644editdlrm
mailcap.cpython-38.pyc72060644editdlrm
mimetypes.cpython-38.pyc160310644editdlrm
modulefinder.cpython-38.pyc161150644editdlrm
netrc.cpython-38.pyc37770644editdlrm
nntplib.cpython-38.pyc339740644editdlrm
ntpath.cpython-38.pyc140910644editdlrm
nturl2path.cpython-38.pyc17440644editdlrm
numbers.cpython-38.pyc122020644editdlrm
opcode.cpython-38.pyc54200644editdlrm
operator.cpython-38.pyc136910644editdlrm
optparse.cpython-38.pyc480570644editdlrm
os.cpython-38.pyc313970644editdlrm
pathlib.cpython-38.pyc442090644editdlrm
pdb.cpython-38.pyc472260644editdlrm
pickle.cpython-38.pyc469080644editdlrm
pickletools.cpython-38.pyc672040644editdlrm
pipes.cpython-38.pyc77950644editdlrm
pkgutil.cpython-38.pyc163090644editdlrm
platform.cpython-38.pyc243260644editdlrm
plistlib.cpython-38.pyc273740644editdlrm
poplib.cpython-38.pyc135560644editdlrm
posixpath.cpython-38.pyc104610644editdlrm
pprint.cpython-38.pyc162810644editdlrm
profile.cpython-38.pyc147580644editdlrm
pstats.cpython-38.pyc220660644editdlrm
pty.cpython-38.pyc39550644editdlrm
pyclbr.cpython-38.pyc104510644editdlrm
pydoc.cpython-38.pyc836460644editdlrm
py_compile.cpython-38.pyc73520644editdlrm
queue.cpython-38.pyc106260644editdlrm
quopri.cpython-38.pyc57480644editdlrm
random.cpython-38.pyc201080644editdlrm
re.cpython-38.pyc144220644editdlrm
reprlib.cpython-38.pyc53030644editdlrm
rlcompleter.cpython-38.pyc57550644editdlrm
runpy.cpython-38.pyc81810644editdlrm
sched.cpython-38.pyc65320644editdlrm
secrets.cpython-38.pyc21900644editdlrm
selectors.cpython-38.pyc169350644editdlrm
shelve.cpython-38.pyc94900644editdlrm
shlex.cpython-38.pyc75360644editdlrm
shutil.cpython-38.pyc372190644editdlrm
signal.cpython-38.pyc28430644editdlrm
site.cpython-38.pyc171680644editdlrm
sitecustomize.cpython-38.pyc2200644editdlrm
smtpd.cpython-38.pyc264630644editdlrm
smtplib.cpython-38.pyc355320644editdlrm
sndhdr.cpython-38.pyc69890644editdlrm
socket.cpython-38.pyc277870644editdlrm
socketserver.cpython-38.pyc253610644editdlrm
sre_compile.cpython-38.pyc151420644editdlrm
sre_constants.cpython-38.pyc63590644editdlrm
sre_parse.cpython-38.pyc216470644editdlrm
ssl.cpython-38.pyc450370644editdlrm
stat.cpython-38.pyc43720644editdlrm
statistics.cpython-38.pyc336530644editdlrm
string.cpython-38.pyc73000644editdlrm
stringprep.cpython-38.pyc110170644editdlrm
struct.cpython-38.pyc3300644editdlrm
subprocess.cpython-38.pyc419670644editdlrm
sunau.cpython-38.pyc170800644editdlrm
symbol.cpython-38.pyc24040644editdlrm
symtable.cpython-38.pyc113220644editdlrm
sysconfig.cpython-38.pyc158370644editdlrm
tabnanny.cpython-38.pyc70300644editdlrm
tarfile.cpython-38.pyc630430644editdlrm
telnetlib.cpython-38.pyc182370644editdlrm
tempfile.cpython-38.pyc266530644editdlrm
textwrap.cpython-38.pyc135190644editdlrm
this.cpython-38.pyc12610644editdlrm
threading.cpython-38.pyc399760644editdlrm
timeit.cpython-38.pyc117770644editdlrm
token.cpython-38.pyc24850644editdlrm
tokenize.cpython-38.pyc171600644editdlrm
trace.cpython-38.pyc200260644editdlrm
traceback.cpython-38.pyc199380644editdlrm
tracemalloc.cpython-38.pyc173630644editdlrm
tty.cpython-38.pyc10760644editdlrm
turtle.cpython-38.pyc1300220644editdlrm
types.cpython-38.pyc91770644editdlrm
typing.cpython-38.pyc624200644editdlrm
uu.cpython-38.pyc36050644editdlrm
uuid.cpython-38.pyc236830644editdlrm
warnings.cpython-38.pyc136520644editdlrm
wave.cpython-38.pyc181490644editdlrm
weakref.cpython-38.pyc195180644editdlrm
webbrowser.cpython-38.pyc171200644editdlrm
xdrlib.cpython-38.pyc82210644editdlrm
zipapp.cpython-38.pyc58540644editdlrm
zipfile.cpython-38.pyc593360644editdlrm
zipimport.cpython-38.pyc172750644editdlrm
_bootlocale.cpython-38.pyc12430644editdlrm
_collections_abc.cpython-38.pyc287410644editdlrm
_compat_pickle.cpython-38.pyc55010644editdlrm
_compression.cpython-38.pyc41460644editdlrm
_dummy_thread.cpython-38.pyc60370644editdlrm
_markupbase.cpython-38.pyc77900644editdlrm
_osx_support.cpython-38.pyc115930644editdlrm
_pydecimal.cpython-38.pyc1607350644editdlrm
_pyio.cpython-38.pyc740790644editdlrm
_py_abc.cpython-38.pyc46700644editdlrm
_sitebuiltins.cpython-38.pyc34810644editdlrm
_strptime.cpython-38.pyc160440644editdlrm
_sysconfigdata__linux_x86_64-linux-gnu.cpython-38.pyc211210644editdlrm
_sysconfigdata__x86_64-linux-gnu.cpython-38.pyc211150644editdlrm
_threading_local.cpython-38.pyc64460644editdlrm
_weakrefset.cpython-38.pyc76000644editdlrm
__future__.cpython-38.pyc41580644editdlrm
__phello__.foo.cpython-38.pyc1270644editdlrm
Edit: /snap/core20/2769/usr/lib/python3.8/__pycache__/enum.cpython-38.pyc (25962B)
U yi@sddlZddlmZmZddddddd gZd d Zd d ZddZddZe Z GdddZ Gddde Z dZGdddeZGdddedZGdddeeZddZGdddeZGdddeeZddZdd Zd d!Zd"d#ZdS)$N)MappingProxyTypeDynamicClassAttributeEnumMetaEnumIntEnumFlagIntFlagautouniquecCst|dpt|dpt|dS)z? Returns True if obj is a descriptor, False otherwise. __get____set__ __delete__)hasattr)objr/usr/lib/python3.8/enum.py_is_descriptor s  rcCsLt|dkoJ|dd|ddko.dknoJ|ddkoJ|ddkS)z= Returns True if a __dunder__ name, False otherwise. N___lennamerrr _is_dunders &  rcCsLt|dkoJ|d|dko&dknoJ|dddkoJ|dddkS)z; Returns True if a _sunder_ name, False otherwise. rrrrrrrrr _is_sunder!s r cCsdd}||_d|_dS)z, Make the given class un-picklable. cSstd|dS)Nz%r cannot be pickled) TypeErrorselfprotorrr_break_on_call_reduce0sz6_make_class_unpicklable.._break_on_call_reducez N) __reduce_ex__ __module__)clsr%rrr_make_class_unpicklable,sr)c@seZdZdZeZdS)r zP Instances are replaced with an appropriate value in Enum class suites. N)__name__r' __qualname____doc__ _auto_nullvaluerrrrr 6scs,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__rrr1Ds  z_EnumDict.__init__csdt|r|dkrtd|dkr<|jr.tdt|d|nV|dkrt|tr`|dd}nt |}||_ t |t |j @}|rtd |fnt |r|d krd }n||j krtd |n||j krnt|sR||krtd |||ft|tr:|jtkr4||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. )_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: %r __order__r9zAttempted to reuse key: %rz%r already defined as: %rrNT)r ValueErrorr5r!setattr isinstancestrreplacesplitlistr4setr2rrr r.r-r>rr3appendr0 __setitem__)r#keyr.alreadyr7rrrKKsT          z_EnumDict.__setitem__)r*r'r+r,r1rK __classcell__rrr7rr/=s r/cseZdZdZeddZfddZddZd/dddd d d d Zd dZ fddZ ddZ ddZ ddZ ddZddZeddZddZdd Zfd!d"Zdddd d d#d$Zd0d%d&Zd'd(Zed)d*Zed+d,Zed-d.ZZS)1rz Metaclass for Enum cCs>|||t}|||\}}|dk r:t|dd|d<|S)Nr;)_check_for_existing_membersr/ _get_mixins_getattr)metaclsr(bases enum_dict member_type first_enumrrr __prepare__s zEnumMeta.__prepare__c sdgdd}|D]}|dq|||\}||\}}} fddjD} jD] } | =qndd} t| ddh@} | rtdd | d krd d <t |||}g|_ i|_ |_d d |D}i|_d kr2tk r2d}tfdd|Ds2t|jD]*}| |}t|tsZ|f}n|}tkrn|f}| s||}t|ds||_n6||f|}t|dsƈtkr||_n ||_|j}||_||_|j||j D]"\} }|j|jkr|}qq|j |||kr2t|||||j |<z||j|<Wntk r`YnXq8dD]V} | kr|qjt|| }t| d}t|| d}|dk rj||krjt|| |qjtdk r|r||_ tj |_ | dk rt| t!r| "dd#} | |j krtd|S)Nr=csi|]}||qSrr).0k) classdictrr sz$EnumMeta.__new__..r9mrozInvalid enum member name: {0}r?r,zAn enumeration.cSs.h|]&}|jD]\}}t|tr|qqSr)__dict__itemsrDr)rXcrYvrrr s   z#EnumMeta.__new__..r&)__getnewargs_ex____getnewargs__r& __reduce__c3s|]}|jkVqdSN)r^rXm)rUrr sz#EnumMeta.__new__.._value_)__repr____str__ __format__r&r@z#member order does not match _order_)$ setdefaultrJpoprP _find_new_r2rIrBformatjoinr0__new___member_names_ _member_map_ _member_type_r\_value2member_map_objectanyr)rDtuplerrj_name_ __objclass__r1r_rCr!rQr__new_member__rErFrG)rRr(rSrZignorerLrVrssave_newuse_args enum_membersrr9 invalid_names enum_classdynamic_attributesmethods member_namer.args enum_membercanonical_member class_method obj_method enum_methodr7)rZrUrrss                           zEnumMeta.__new__cCsdS)z6 classes/types should always be True. Trr6rrr__bool__3szEnumMeta.__bool__NrmodulequalnametypestartcCs*|dkr|||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)rs_create_)r(r.namesrrrrrrr__call__9s zEnumMeta.__call__cCs:t|ts$tdt|j|jjft||o8|j|jkS)N3unsupported operand type(s) for 'in': '%s' and '%s')rDrr!rr+r8r{ru)r(memberrrr __contains__^s zEnumMeta.__contains__cs(||jkrtd|jt|dS)Nz%s: cannot delete Enum member.)ruAttributeErrorr*r0 __delattr__)r(attrr7rrres zEnumMeta.__delattr__cCsddddg|jS)Nr8r, __members__r'rtr6rrr__dir__ls zEnumMeta.__dir__cCs@t|rt|z |j|WStk r:t|dYnXdS)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)rrruKeyErrorr(rrrr __getattr__rs  zEnumMeta.__getattr__cCs |j|Srfrurrrr __getitem__szEnumMeta.__getitem__csfddjDS)z6 Returns members in definition order. c3s|]}j|VqdSrfrrXrr(rrrisz$EnumMeta.__iter__..rrrrr__iter__szEnumMeta.__iter__cCs t|jSrf)rrtrrrr__len__szEnumMeta.__len__cCs t|jS)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. )rrurrrrrszEnumMeta.__members__cCs d|jS)Nz )r*rrrrrkszEnumMeta.__repr__csfddtjDS)z> Returns members in reverse definition order. c3s|]}j|VqdSrfrrrrrrisz(EnumMeta.__reversed__..)reversedrtrrrr __reversed__szEnumMeta.__reversed__cs0|jdi}||krtdt||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. ruzCannot reassign members.N)r^getrr0 __setattr__)r(rr. member_mapr7rrrszEnumMeta.__setattr__c Cs~|j}|dkr|fn||f}|||\} } |||} t|trR|dd}t|ttfr|rt|dtr|g} }g} t | D]8\}}| |||| dd}| || ||fq|D].}t|tr|||}}n|\}}|| |<q| |||| }|dkrPzt djd}Wn*tttfk rN}zW5d}~XYnX|dkrdt|n||_|dk rz||_|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?r@rrr*)r8rPrWrDrErFrGrzrH enumerater;rJrssys _getframe f_globalsrrBrr)r'r+)r( class_namerrrrrrRrSrrVrZoriginal_names last_valuescountrr.itemr member_valuerexcrrrrs<            zEnumMeta._create_csttj|}|rt|}n|}fdd|D}z|jdddWn$tk rn|jdddYnX||||d}t|_||j |||<|S)z[ Create a new Enum subclass that replaces a collection of global constants cs g|]\}}|r||fqSrr)rXrr.filterrr sz&EnumMeta._convert_..cSs|d|dfS)Nrrrtrrrz$EnumMeta._convert_..)rLcSs|dSNrrrrrrrr)r) varsrmodulesr_sortr!_reduce_ex_by_namer&updater)r(rrrsourcemodule_globalsmembersrrr _convert_s    zEnumMeta._convert_cOs$ddl}|jdtdd|j||S)NrzI_convert is deprecated and will be removed in 3.9, use _convert_ instead.r) stacklevel)warningswarnDeprecationWarningr)r(rkwargsrrrr_converts zEnumMeta._convertcCs<|D]2}|jD]&}t|tr|jrtd||jfqqdS)Nz %s: cannot extend enumeration %r)__mro__ issubclassrrtr!r*)rrSchainbaserrrrO s z$EnumMeta._check_for_existing_memberscsT|s ttfSfdd}|d}t|ts2td||p._find_data_typerzZnew enumerations should be created as `EnumName([mixin_type, ...] [data_type,] enum_type)`zCannot extend enumerations)rxrrr!rt)rrSrrVrUrrrrPs   zEnumMeta._get_mixins_c Cs|dd}|dk }|dkrpdD]H}||fD].}t||d}|ddjtjtjhkr,|}q\q,|dk r qpq tj}|tjkrd}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__ rsN)r}rsFT)rrQrsrxr) rZrUrVrsrmethodpossibletargetrrrrrpCs*    zEnumMeta._find_new_)N)N)r*r'r+r, classmethodrWrsrrrrrrrrrpropertyrrkrrrrr staticmethodrOrPrprNrrr7rrs8 %   5 !  .c@steZdZdZddZddZeddZdd Zd d Z d d Z ddZ ddZ ddZ eddZeddZdS)rzV Generic enumeration. Derive from this class to define new enumerations. c Cst||kr|Sz |j|WStk r0Yn:tk rh|jD]}|j|krH|YSqHYnXzd}||}Wn*tk r}z |}d}W5d}~XYnXzdt ||r|WTSt d||j f}|dkr|dkr|n|dkrtd|j |f}||_ |W5d}d}XdS)N%r is not a valid %szDerror in %s._missing_: returned %r instead of None or a valid member) rrwrr!ruvaluesrjr< ExceptionrDrBr* __context__)r(r.rrresulteve_excrrrrsws@     z Enum.__new__c Cs6t|D](}z|dWStk r.YqXq|S) Generate the next value when not given. name: the name of the member start: the initial start value or None count: the number of existing members last_value: the last value assigned or None rN)rr!)rrrr last_valuerrrr;s zEnum._generate_next_value_cCsdSrfr)r(r.rrrr<szEnum._missing_cCsd|jj|j|jfS)N <%s.%s: %r>)r8r*r{rjr6rrrrks z Enum.__repr__cCsd|jj|jfS)N%s.%s)r8r*r{r6rrrrlsz Enum.__str__cs6fddjDddjD}dddg|S)z< Returns all members and all public methods cs2g|]*}|jD]}|ddkr|jkr|qqSrr)r^ru)rXr(rhr6rrrs  z Enum.__dir__..cSsg|]}|ddkr|qSrrrgrrrrs r8r,r')r8r\r^)r#added_behaviorrr6rrs  z Enum.__dir__cCsJt|jtjtjfk}|jtks$|r2t}t|}n |j}|j}|||S)z\ Returns format using actual value type unless __str__ has been overridden. ) rrlrrrvrxrErjrm)r# format_specstr_overriddenr(valrrrrms  zEnum.__format__cCs t|jSrf)hashr{r6rrr__hash__sz Enum.__hash__cCs|j|jffSrfr8rjr"rrrr&szEnum.__reduce_ex__cCs|jS)zThe name of the Enum member.)r{r6rrrrsz Enum.namecCs|jS)zThe value of the Enum member.rjr6rrrr.sz Enum.valueN)r*r'r+r,rsr;rr<rkrlrrmrr&rrr.rrrrrqs-    ) metaclassc@seZdZdZdS)rz.Enum where members are also (and must be) intsN)r*r'r+r,rrrrrscCs|jSrfrr"rrrrsrc@speZdZdZddZeddZeddZdd Zd d Z d d Z ddZ ddZ ddZ ddZddZdS)rz Support for flags c Csd|s|dk r|SdSt|D]:}zt|}WqXWqtk rTtd|dYqXqd|dS)rNrzInvalid Flag value: %rr)r _high_bitrr!)rrrrrhigh_bitrrrr;s   zFlag._generate_next_value_cCs.|}|dkr|}||}|dkr*|}|S)V Returns member (possibly creating it) if one can be found for value. r)r:)r(r.original_valuepossible_memberrrrr<s zFlag._missing_cCsb|j|d}|dkr^t||\}}|r:td||jft|}d|_||_|j ||}|S)L Create a composite member iff value contains only members. Nr) rwr _decomposerBr*rxrsr{rjrn)r(r. pseudo_memberr extra_flagsrrrr:#s zFlag._create_pseudo_member_cCs8t||js&tdt|j|jjf|j|j@|jkS)zP Returns True if self has at least the same flags set as other. r)rDr8r!rr+rjr#otherrrrr7s zFlag.__contains__cCsV|j}|jdk r$d|j|j|jfSt||j\}}d|jddd|D|jfS)Nr|cSsg|]}t|jp|jqSrrEr{rjrgrrrrHsz!Flag.__repr__..)r8r{r*rjrrrr#r(r uncoveredrrrrkAs z Flag.__repr__cCs|j}|jdk r d|j|jfSt||j\}}t|dkr^|djdkr^d|j|djfSd|jddd|DfSdS)Nrrrz%s.%rrcSsg|]}t|jp|jqSrrrgrrrrVsz Flag.__str__..)r8r{r*rrjrrrrrrrrlLs z Flag.__str__cCs t|jSrf)boolrjr6rrrrYsz Flag.__bool__cCs"t||jstS||j|jBSrfrDr8NotImplementedrjrrrr__or__\s z Flag.__or__cCs"t||jstS||j|j@Srfrrrrr__and__as z Flag.__and__cCs"t||jstS||j|jASrfrrrrr__xor__fs z Flag.__xor__cCsNt|j|j\}}|d}|jD] }||kr"|j|j@s"||B}q"||Sr)rr8rj)r#rrinvertedrhrrr __invert__ks    zFlag.__invert__N)r*r'r+r,r;rr<r:rrkrlrrrrrrrrrrs     c@sTeZdZdZeddZeddZddZdd Zd d Z eZ eZ e Z d d Z dS)rz) Support for integer-based Flags cCs*t|tstd||jf||}|S)rr)rDintrBr*r:)r(r. new_memberrrrr<ys  zIntFlag._missing_cCs|j|d}|dkr|g}t||\}}|rtt|}d|}||jkrZ||krZ|||| krjd}q*||N}q*t|D]*}t||}d|_||_ |j ||}q||S)rNrr) rwrrrrJrr rsr{rjrn)r(r.rneed_to_createrrbit flag_valuerrrr:s(      zIntFlag._create_pseudo_member_cCs0t||jtfstS||j||jB}|SrfrDr8r rrj)r#rrrrrrszIntFlag.__or__cCs,t||jtfstS||j||j@SrfrrrrrrszIntFlag.__and__cCs,t||jtfstS||j||jASrfrrrrrrszIntFlag.__xor__cCs||j}|Srfr)r#rrrrrszIntFlag.__invert__N)r*r'r+r,rr<r:rrr__ror____rand____rxor__rrrrrrts  cCs |dS)zJ returns index of highest bit, or -1 if value is zero or negative r) bit_lengthr.rrrrsrcCs^g}|jD]"\}}||jkr|||jfq|rZddd|D}td||f|S)zI Class decorator for enumerations ensuring unique member values. z, cSsg|]\}}d||fqS)z%s -> %sr)rXaliasrrrrrszunique..z duplicate values found in %r: %s)rr_rrJrrrB) enumeration duplicatesrr alias_detailsrrrr s  cCs|}|dk}|r*ddt|jD}nddt|jD}g}|D],\}}|rJ||@|krJ||||M}qJ|s||jkr||j||jddddt|d kr|dj|kr|d||fS) z- Extract all members from the value. rcSs"g|]\}}|jdk r||fqSrfrrXrarhrrrrs z_decompose..cSs*g|]"\}}|jdk st|r||fqSrf)r _power_of_tworrrrrs cSs|jSrfr)rhrrrrrz_decompose..T)rLreverser)rHrwr_rJrrr.ro)flagr. not_coverednegativeflags_to_checkrrrrrrrs(      rcCs|dkr dS|dt|kS)NrFr)rrrrrrsr)rtypesrr__all__rrr r)rxr-r dictr/rrrr rrrrrr rrrrrrs>    LivI%