/snap/core24/1643/usr/lib/python3.12/__pycache__
NameSizeModeActions
abc.cpython-312.pyc80550644editdlrm
aifc.cpython-312.pyc428630644editdlrm
antigravity.cpython-312.pyc10030644editdlrm
argparse.cpython-312.pyc1016820644editdlrm
ast.cpython-312.pyc1002790644editdlrm
base64.cpython-312.pyc244080644editdlrm
bdb.cpython-312.pyc373590644editdlrm
bisect.cpython-312.pyc36410644editdlrm
bz2.cpython-312.pyc151330644editdlrm
calendar.cpython-312.pyc396210644editdlrm
cgi.cpython-312.pyc402280644editdlrm
cgitb.cpython-312.pyc173320644editdlrm
chunk.cpython-312.pyc73100644editdlrm
cmd.cpython-312.pyc186190644editdlrm
code.cpython-312.pyc130510644editdlrm
codecs.cpython-312.pyc422740644editdlrm
codeop.cpython-312.pyc69160644editdlrm
colorsys.cpython-312.pyc46420644editdlrm
compileall.cpython-312.pyc204970644editdlrm
configparser.cpython-312.pyc635820644editdlrm
contextlib.cpython-312.pyc303760644editdlrm
contextvars.cpython-312.pyc2610644editdlrm
copy.cpython-312.pyc98000644editdlrm
copyreg.cpython-312.pyc74140644editdlrm
cProfile.cpython-312.pyc85930644editdlrm
crypt.cpython-312.pyc53610644editdlrm
csv.cpython-312.pyc177880644editdlrm
dataclasses.cpython-312.pyc446780644editdlrm
datetime.cpython-312.pyc4090644editdlrm
decimal.cpython-312.pyc4060644editdlrm
difflib.cpython-312.pyc754990644editdlrm
dis.cpython-312.pyc345600644editdlrm
doctest.cpython-312.pyc1056860644editdlrm
enum.cpython-312.pyc807080644editdlrm
filecmp.cpython-312.pyc146610644editdlrm
fileinput.cpython-312.pyc202800644editdlrm
fnmatch.cpython-312.pyc64950644editdlrm
fractions.cpython-312.pyc366670644editdlrm
ftplib.cpython-312.pyc426360644editdlrm
functools.cpython-312.pyc405060644editdlrm
genericpath.cpython-312.pyc68220644editdlrm
getopt.cpython-312.pyc83630644editdlrm
getpass.cpython-312.pyc68500644editdlrm
gettext.cpython-312.pyc221510644editdlrm
glob.cpython-312.pyc98410644editdlrm
graphlib.cpython-312.pyc103270644editdlrm
gzip.cpython-312.pyc320150644editdlrm
hashlib.cpython-312.pyc80870644editdlrm
heapq.cpython-312.pyc179560644editdlrm
hmac.cpython-312.pyc106980644editdlrm
imaplib.cpython-312.pyc628890644editdlrm
imghdr.cpython-312.pyc69440644editdlrm
inspect.cpython-312.pyc1334460644editdlrm
io.cpython-312.pyc41390644editdlrm
ipaddress.cpython-312.pyc907620644editdlrm
keyword.cpython-312.pyc10410644editdlrm
linecache.cpython-312.pyc64010644editdlrm
locale.cpython-312.pyc595360644editdlrm
lzma.cpython-312.pyc158550644editdlrm
mailbox.cpython-312.pyc1116180644editdlrm
mailcap.cpython-312.pyc111550644editdlrm
mimetypes.cpython-312.pyc241850644editdlrm
modulefinder.cpython-312.pyc279440644editdlrm
netrc.cpython-312.pyc89030644editdlrm
nntplib.cpython-312.pyc449390644editdlrm
ntpath.cpython-312.pyc260330644editdlrm
nturl2path.cpython-312.pyc30340644editdlrm
numbers.cpython-312.pyc139670644editdlrm
opcode.cpython-312.pyc147160644editdlrm
operator.cpython-312.pyc173640644editdlrm
optparse.cpython-312.pyc675460644editdlrm
os.cpython-312.pyc434740644editdlrm
pathlib.cpython-312.pyc620980644editdlrm
pdb.cpython-312.pyc849190644editdlrm
pickle.cpython-312.pyc761760644editdlrm
pickletools.cpython-312.pyc811280644editdlrm
pipes.cpython-312.pyc109140644editdlrm
pkgutil.cpython-312.pyc199590644editdlrm
platform.cpython-312.pyc416000644editdlrm
plistlib.cpython-312.pyc412860644editdlrm
poplib.cpython-312.pyc184460644editdlrm
posixpath.cpython-312.pyc182360644editdlrm
pprint.cpython-312.pyc294740644editdlrm
profile.cpython-312.pyc225400644editdlrm
pstats.cpython-312.pyc379220644editdlrm
pty.cpython-312.pyc73630644editdlrm
pyclbr.cpython-312.pyc148870644editdlrm
pydoc.cpython-312.pyc1429550644editdlrm
py_compile.cpython-312.pyc100780644editdlrm
queue.cpython-312.pyc147320644editdlrm
quopri.cpython-312.pyc93230644editdlrm
random.cpython-312.pyc331530644editdlrm
reprlib.cpython-312.pyc99090644editdlrm
rlcompleter.cpython-312.pyc82820644editdlrm
runpy.cpython-312.pyc143850644editdlrm
sched.cpython-312.pyc77350644editdlrm
secrets.cpython-312.pyc25560644editdlrm
selectors.cpython-312.pyc261280644editdlrm
shelve.cpython-312.pyc129130644editdlrm
shlex.cpython-312.pyc141620644editdlrm
shutil.cpython-312.pyc681130644editdlrm
signal.cpython-312.pyc44480644editdlrm
site.cpython-312.pyc290630644editdlrm
sitecustomize.cpython-312.pyc3000644editdlrm
smtplib.cpython-312.pyc482210644editdlrm
sndhdr.cpython-312.pyc107120644editdlrm
socket.cpython-312.pyc418170644editdlrm
socketserver.cpython-312.pyc342580644editdlrm
sre_compile.cpython-312.pyc6250644editdlrm
sre_constants.cpython-312.pyc6280644editdlrm
sre_parse.cpython-312.pyc6210644editdlrm
ssl.cpython-312.pyc630110644editdlrm
stat.cpython-312.pyc52310644editdlrm
statistics.cpython-312.pyc554230644editdlrm
string.cpython-312.pyc114820644editdlrm
stringprep.cpython-312.pyc251600644editdlrm
struct.cpython-312.pyc3250644editdlrm
subprocess.cpython-312.pyc791870644editdlrm
sunau.cpython-312.pyc254230644editdlrm
symtable.cpython-312.pyc187810644editdlrm
sysconfig.cpython-312.pyc300010644editdlrm
tabnanny.cpython-312.pyc121560644editdlrm
tarfile.cpython-312.pyc1233880644editdlrm
telnetlib.cpython-312.pyc284230644editdlrm
tempfile.cpython-312.pyc473390644editdlrm
textwrap.cpython-312.pyc182930644editdlrm
this.cpython-312.pyc14080644editdlrm
threading.cpython-312.pyc653460644editdlrm
timeit.cpython-312.pyc148640644editdlrm
token.cpython-312.pyc35570644editdlrm
tokenize.cpython-312.pyc247750644editdlrm
trace.cpython-312.pyc330240644editdlrm
traceback.cpython-312.pyc515230644editdlrm
tracemalloc.cpython-312.pyc269070644editdlrm
tty.cpython-312.pyc26680644editdlrm
turtle.cpython-312.pyc1846320644editdlrm
types.cpython-312.pyc149390644editdlrm
typing.cpython-312.pyc1418600644editdlrm
uu.cpython-312.pyc78160644editdlrm
uuid.cpython-312.pyc330070644editdlrm
warnings.cpython-312.pyc237920644editdlrm
wave.cpython-312.pyc320840644editdlrm
weakref.cpython-312.pyc313480644editdlrm
webbrowser.cpython-312.pyc263530644editdlrm
xdrlib.cpython-312.pyc118410644editdlrm
zipapp.cpython-312.pyc99770644editdlrm
zipimport.cpython-312.pyc244750644editdlrm
_aix_support.cpython-312.pyc47590644editdlrm
_collections_abc.cpython-312.pyc459120644editdlrm
_compat_pickle.cpython-312.pyc72210644editdlrm
_compression.cpython-312.pyc74970644editdlrm
_distutils_system_mod.cpython-312.pyc78180644editdlrm
_markupbase.cpython-312.pyc122790644editdlrm
_osx_support.cpython-312.pyc177310644editdlrm
_pydatetime.cpython-312.pyc941930644editdlrm
_pydecimal.cpython-312.pyc2278070644editdlrm
_pyio.cpython-312.pyc1102690644editdlrm
_pylong.cpython-312.pyc99830644editdlrm
_py_abc.cpython-312.pyc70540644editdlrm
_sitebuiltins.cpython-312.pyc47600644editdlrm
_strptime.cpython-312.pyc241160644editdlrm
_sysconfigdata__linux_x86_64-linux-gnu.cpython-312.pyc586510644editdlrm
_sysconfigdata__x86_64-linux-gnu.cpython-312.pyc586450644editdlrm
_threading_local.cpython-312.pyc82950644editdlrm
_weakrefset.cpython-312.pyc117510644editdlrm
__future__.cpython-312.pyc47040644editdlrm
__hello__.cpython-312.pyc8700644editdlrm
Edit: /snap/core24/1643/usr/lib/python3.12/__pycache__/functools.cpython-312.pyc (40506B)
ЦidZgdZddlmZddlmZddlmZddlm Z ddl m Z dZ d Z e e fd Ze e fd Zd Zd ZdZdZdZdZdZdZdZdZdZdZdefdefdefgdefdefdefgdefdefdefgdefdefdefgdZdZdZ ddlmZe!Z"e"fd Z# dd!lm#Z#Gd"d#Z$ dd$lm$Z$Gd%d&e!Z%d'Z&ed(gd)Z'Gd*d+e(Z)e!fe*e+he,e-e.fd,Z/d;d-Z0d.Z1 dd/lm1Z1d0Z2d1Z3d7$g 77c`t|j||}|tur|S| xr||k7S)zIReturn a > b. Computed by @total_ordering from (not a < b) and (a != b).type__lt__NotImplementedselfother op_results r) _gt_from_ltr6Y7T !!$.IN"= *TU]*r,c^t|j||}|tur|S|xs||k(S)zEReturn a <= b. Computed by @total_ordering from (a < b) or (a == b).r.r2s r) _le_from_ltr9`5T !!$.IN"  % %r,cRt|j||}|tur|S| S)z=Return a >= b. Computed by @total_ordering from (not a < b).r.r2s r) _ge_from_ltr<g.T !!$.IN"=r,c`t|j||}|tur|S| xs||k(S)zJReturn a >= b. Computed by @total_ordering from (not a <= b) or (a == b).r/__le__r1r2s r) _ge_from_lerAn7T !!$.IN"= )DEM)r,c^t|j||}|tur|S|xr||k7S)zFReturn a < b. Computed by @total_ordering from (a <= b) and (a != b).r?r2s r) _lt_from_lerDu5T !!$.IN"  &&r,cRt|j||}|tur|S| S)z=Return a > b. Computed by @total_ordering from (not a <= b).r?r2s r) _gt_from_lerG|r=r,c`t|j||}|tur|S| xr||k7S)zIReturn a < b. Computed by @total_ordering from (not a > b) and (a != b).r/__gt__r1r2s r) _lt_from_gtrKr7r,c^t|j||}|tur|S|xs||k(S)zEReturn a >= b. Computed by @total_ordering from (a > b) or (a == b).rIr2s r) _ge_from_gtrMr:r,cRt|j||}|tur|S| S)z=Return a <= b. Computed by @total_ordering from (not a > b).rIr2s r) _le_from_gtrOr=r,c`t|j||}|tur|S| xs||k(S)zJReturn a <= b. Computed by @total_ordering from (not a >= b) or (a == b).r/__ge__r1r2s r) _le_from_gerSrBr,c^t|j||}|tur|S|xr||k7S)zFReturn a > b. Computed by @total_ordering from (a >= b) and (a != b).rQr2s r) _gt_from_gerUrEr,cRt|j||}|tur|S| S)z=Return a < b. Computed by @total_ordering from (not a >= b).rQr2s r) _lt_from_gerWr=r,rJr@rRr0)r0r@rJrRc tDchc]#}t||dtt|dus"|%}}|s tdt |}t|D]\}}||vs ||_t ||| |Scc}w)z6Class decorator that fills in missing ordering methodsNz6must define at least one ordering operation: < > <= >=)_convertrobject ValueErrormaxrr)clsoprootsrootopnameopfuncs r)rrs# ^Bgc2t&.Kobjc||_yNrf)r3rfs r)__init__zcmp_to_key..K.__init__s DHr,cD|j|jdkSNrrir3r4mycmps r)r0zcmp_to_key..K.__lt__599-1 1r,cD|j|jdkDSrlrirms r)rJzcmp_to_key..K.__gt__ror,cD|j|jdk(Srlrirms r)__eq__zcmp_to_key..K.__eq__599-2 2r,cD|j|jdkSrlrirms r)r@zcmp_to_key..K.__le__rsr,cD|j|jdk\Srlrirms r)rRzcmp_to_key..K.__ge__rsr,N) rrr __slots__rjr0rJrrr@rR__hash__)rnsr)Kres-G   2 2 3 3 3r,rx)rZ)rnrxs` r)rrsF Hr,)rct|}|tur t|}n|}|D] }|||} |S#t$r t ddwxYw)a reduce(function, iterable[, initial]) -> value Apply a function of two arguments cumulatively to the items of a sequence or iterable, from left to right, so as to reduce the iterable to a single value. For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates ((((1+2)+3)+4)+5). If initial is present, it is placed before the items of the iterable in the calculation, and serves as a default when the iterable is empty. z0reduce() of empty iterable with no initial valueN)iter_initial_missingnext StopIteration TypeError)functionsequenceinitialitr(elements r)r r sv hB"" NHE )() L NBDIM N Ns 5A )r cReZdZdZdZfdZdZedZdZ dZ xZ S)r zSNew function with partial application of the given arguments and keywords. )funcargskeywordsr __weakref__ct|s tdt|dr+|j|z}i|j|}|j }t t|#|}||_||_||_|S)Nz#the first argument must be callabler) callabler~hasattrrrrsuperr __new__)r]rrrr3 __class__s r)rzpartial.__new__su~AB B 4 99t#D4$--484H99DWc*3/     r,cdi|j|}|jg|j|i|Srhrrr)r3rrs r)__call__zpartial.__call__+s70dmm0x0tyy7$))7d7h77r,ct|j}t|jg}|j d|j D|j d|j jDt|jdk(rd|ddj|dS|ddj|dS)Nc32K|]}t|ywrh)repr).0xs r) z#partial.__repr__..3s/DG/sc30K|]\}}|d|yw)=Nrkvs r)rz#partial.__repr__..4sEVaqc1%LEs functoolsz functools.(, )) r/rrrextendrritemsrjoin)r3qualnamers r)__repr__zpartial.__repr__/s:**TYY  /TYY// Et}}/B/B/DEE : K /z499T?*;1= =1TYYt_-Q//r,ct||jf|j|j|jxsd|jxsdffSrh)r/rrrrr3s r) __reduce__zpartial.__reduce__9sCDzDII<$))TYY}}$dmm&;t*== =r,ct|ts tdt|dk7rtdt||\}}}}t |r4t|tr$|t|t r|t|t s tdt|}|i}nt |t ur t |}|i}||_||_||_ ||_ y)Nz(argument to __setstate__ must be a tuplezexpected 4 items in state, got zinvalid partial state) isinstancetupler~lenrdictr/rrrr)r3staterrkwds namespaces r) __setstate__zpartial.__setstate__=s%'FG G u:?=c%j\JK K&+#dD)ju&=  Zd%;  !*Y*E34 4T{ <D $Zt #:D  I!    r,) rrrrrvrrrrrr __classcell__)rs@r)r r s;FI 800=r,r )r cJeZdZdZdZdZdZddZedZ e e Z y) r zMethod descriptor with partial application of the given arguments and keywords. Supports wrapping existing descriptors and handles non-descriptor callables as instance methods. c&t|s&t|dstdj|t |t r;|j |_|j|z|_i|j||_y||_||_||_y)N__get__z${!r} is not callable or a descriptor) rrr~formatrr rrr)r3rrrs r)rjzpartialmethod.__init__cs~~gdI&>B"(&,0 0 dM * DI D(DI9t}}99DMDIDI$DMr,cHdjtt|j}djd|jj D}d}|j |jj|jj|j||S)Nrc3FK|]\}}dj||yw)z{}={!r}N)rrs r)rz)partialmethod.__repr__..xs+D%)Q'--a3Ds!z*{module}.{cls}({func}, {args}, {keywords}))moduler]rrr) rmaprrrrrrrrr)r3rr format_strings r)rzpartialmethod.__repr__vsyyT499-.99D-1]]-@-@-BDDD ##4>>+D+D(,(C(C)-)--5 $7 7r,cBfd}j|_|_|S)Nchij|}j|gj|i|Srhr) cls_or_selfrrr3s r)_methodz3partialmethod._make_unbound_method.._methods:4$--484H499[H499HtHxH Hr,)__isabstractmethod___partialmethod)r3rs` r)_make_unbound_methodz"partialmethod._make_unbound_methods& I(,'@'@$!%r,Nc6t|jdd}d}|L|||}||jur5t|g|ji|j} |j |_| |jj||}|S#t $rY/wxYw)Nr) rrr rr__self__r rr)r3rfr]getresultnew_funcs r)rzpartialmethod.__get__sdiiD1 ?3}Htyy(!GDIIGG&.&7&7FO >..088cBF &sB BBc0t|jddSNrFrrrs r)rz"partialmethod.__isabstractmethod__tyy"8%@@r,rh) rrrrrjrrrpropertyr classmethodr__class_getitem__rr,r)r r [s>%& 7&AA$L1r,r c`t|tr|j}t|tr|Srh)rr rrs r)_unwrap_partialrs& T7 #yy T7 # Kr, CacheInfo)hitsmissesmaxsizecurrsizec$eZdZdZdZefdZdZy) _HashedSeqz This class guarantees that hash() will be called no more than once per element. This is important because the lru_cache() will hash the key multiple times on a cache miss. hashvaluec(||dd|||_yrhr)r3tuphashs r)rjz_HashedSeq.__init__sQcr,c|jSrhrrs r)rwz_HashedSeq.__hash__s ~~r,N)rrrrrvrrjrwrr,r)rrs I!%#r,rc$|}|r||z }|jD]} || z } |rC||fd|Dz }|rJ||fd|jDz }t|S||dk(r|d|vr|dSt|S)aMake a cache key from optionally typed positional and keyword arguments The key is constructed in a way that is flat as possible rather than as a nested structure that would take more memory. If there is only a single argument and its data type is known to cache its hash value, then that argument is returned without a wrapper. This saves space and improves lookup speed. c3.K|] }|ywrhrrrr/s r)rz_make_key..s+T!W+c3.K|] }|ywrhrrs r)rz_make_key..s8Qa8rr)rvaluesr) rrtypedkwd_mark fasttypesrr/rkeyitems ` r) _make_keyrs$ C  xJJL D 4KC   u+d+++  58$++-88 8C c? SQ4A<941v c?r,cttrdkrYdnVtr>ttr.dc}t |t }fd|_t||S tdfd}|S)aLeast-recently-used cache decorator. If *maxsize* is set to None, the LRU features are disabled and the cache can grow without bound. If *typed* is True, arguments of different types will be cached separately. For example, f(3.0) and f(3) will be treated as distinct calls with distinct results. Arguments to the cached function must be hashable. View the cache statistics named tuple (hits, misses, maxsize, currsize) with f.cache_info(). Clear the cache and statistics with f.cache_clear(). Access the underlying function with f.__wrapped__. See: https://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU) rcdSNrrrrsr)zlru_cache.. %,Pr,z=Expected first argument to be an integer, a callable, or NonecVt|t}fd|_t||S)NcdSrrrsr)rz8lru_cache..decorating_function..rr,)_lru_cache_wrapper _CacheInfocache_parametersr) user_functionr#rrs r)decorating_functionz&lru_cache..decorating_functions($]GUJO#P g}55r,) rintrboolrrrrr~)rrrr#rs`` r)r r s2'3 Q;G ' z%6!(# w$]GUJO#P g}55   KM M6 r,cd ttd\  i dxd j j t gddgdddk(rfd}n# fd}n fd} fd} fd}||_||_|S) N)rrrFc"dz |i|}|SNrr)rrrrrs r)r#z#_lru_cache_wrapper..wrappers" aKF"D1D1FMr,ch|| }| }| urdz |Sdz  |i|}||<|Srr) rrrrr cache_getrmake_keyrsentinelrrs r)r#z#_lru_cache_wrapper..wrapper's[4u-CsH-FX%  aKF"D1D1FE#JMr,c||}5|}|:|\}}}}|| <||<}|x| <<||<| <dz |cdddSdz ddd|i|}5|vrnTr.} || <|| <|  } } dx <<| =| |<n$}|||g}|x| <x<|<k\ddd|S#1swYwxYw#1swY|SxYwrr)rrrlink link_prev link_next_keyrlastoldrootoldkey oldresultKEYNEXTPREVRESULTrr cache_lenfullrlockrrrr`rrs r)r#z#_lru_cache_wrapper..wrapper6s4u-C  ~#9=6Iy$&/IdO&/IdO:D.22DJd!%DJ!%DJAID!  !  #D1D1F# 4%< "G#&GCL&,GFO#4=D!#YF $V I/33DIV f ")E#J :D $V4D;??DJ?deCj&K72DG# 4HMg  # 4HMs;CC*ACCC$cT5cdddS#1swYyxYw)zReport cache statisticsNr)rrrrrrsr) cache_infoz&_lru_cache_wrapper..cache_infoos/  BdFGY[A B B Bs'cr5jddgdddxddddy#1swYyxYw)z$Clear the cache and cache statisticsNrF)clear)rrrrrr`sr) cache_clearz'_lru_cache_wrapper..cache_cleartsG  KKMT4.DG D6D    s -6)rZrr__len__rrr)rrrrr#rrrrrrrrrrrrrrr`rs```` @@@@@@@@@@@@@@r)rr sxHH(D$V ED6 D I I 7D DT4&DG!|    7 7 7 rBB $G%G Nr,)rc&td|S)z@Simple lightweight unbounded cache. Sometimes called "memoize".N)r)r )rs r)rrs "9T "= 11r,cg} |Dcgc]}|s| }}|s|S|D]}|d}|D] }||ddvs d}n td|j||D]}|d|k(s |d=gcc}w)zMerges MROs in *sequences* to a single MRO using the C3 algorithm. Adapted from https://www.python.org/download/releases/2.3/mro/. rrNzInconsistent hierarchy) RuntimeErrorappend) sequencesrss1 candidates2seqs r) _c3_merger's F  )/1QQ/ /M B1I 12& $I     78 8 i  C1v"F ! /s A+A+Nctt|jD]+\}tdst |j|z }nd}|r t |ng}t |jd|}g}t |j|d}|D]?t |stfd|jDr/|jA|D]|j|Dcgc]}t||}}|Dcgc]}t||} }|Dcgc]}t||} }t|gg|z| z| z|gz|gz|gzScc}wcc}wcc}w)aComputes the method resolution order using extended C3 linearization. If no *abcs* are given, the algorithm works exactly like the built-in C3 linearization used for method resolution. If given, *abcs* is a list of abstract base classes that should be inserted into the resulting MRO. Unrelated ABCs are ignored and don't end up in the result. The algorithm inserts ABCs where their functionality is introduced, i.e. issubclass(cls, abc) returns True for the class itself but returns False for all its direct base classes. Implicit ABCs for a given class (either registered or inferred from the presence of a special method like __len__) are inserted directly after the last ABC explicitly listed in the MRO of said class. If two implicit ABCs end up next to each other in the resulting MRO, their ordering depends on the order of types in *abcs*. __abstractmethods__rNc36K|]}t|ywrh) issubclass)rbbases r)rz_c3_mro..s-() 1d#-sabcs) enumeratereversed __bases__rrlistr+anyr remove_c3_mror') r]r/iboundaryexplicit_basesabstract_bases other_basesr-explicit_c3_mrosabstract_c3_mros other_c3_mross ` r)r6r6s"Xcmm454 4. /3==)A-H  4:2D#-- 23NNs}}XY/0K( c4 --0]]-*  ! !$ ' ( D=KLT40LL=KLT40LL:EF$WT-FMF   + ,.; <  *+ ,/:m < MLFs1E E"%E'c X tj fd}Dcgc] }||s |c}fd}Dcgc] }||r |c}t}g}D]}g}|jD]B} | vst| s|j | jD cgc] } | |vs|  c} D|s|j |n|j t d|D]} | D]} | |vs|j | !t|Scc}wcc}wcc} w)zCalculates the method resolution order for a given class *cls*. Includes relevant abstract base classes (with their respective bases) from the *types* iterable. Uses a modified C3 linearization algorithm. cj|vxr-t|dxrt|t xr t|S)N__mro__)rrrr+)typbasesr]s r) is_relatedz _compose_mro..is_relateds?5 :WS)%<:)3C)F%F:%/S%9 ;r,c@D]}||k7s ||jvsyy)NTF)rA)rBr4typess r)is_strict_basez$_compose_mro..is_strict_bases, Ee|u}} 4 r,T)rreverser.)setrA__subclasses__r+r sortrr6) r]rFrDnrGtype_setmrorBfoundsubr"subclsrCs `` @r) _compose_mrorRs2  E; /1AQ /E  71^A%6Q 7E5zH C '%%' HC%JsC$8 FAX aFG H JJsO  sD ) 'C '$JJv& ' ' ' 3S !!7 0 8Gs" DD D"D"( D' 2D' ct||j}d}|D]T}|I||vrC||jvr5||jvr't||st dj ||n ||vsS|}V|j |S)a^Returns the best matching implementation from *registry* for type *cls*. Where there is no registered implementation for a specific type, its method resolution order is used to find a more generic implementation. Note: if *registry* does not contain an implementation for the base *object* type, this function may return None. NzAmbiguous dispatch: {} or {})rRkeysrAr+rrr)r]registryrNmatchts r) _find_implrXs sHMMO ,C E    X !3;;"6"'s{{":&0&:"#A#H#H1$  =E  << r,cB ddl ddl}i |jd fd fdfdd  fd fd}t|dd | t< |_|_ j |_j|_ t|||S) akSingle-dispatch generic function decorator. Transforms a function into a generic function, which can have different behaviours depending upon the type of its first argument. The decorated function acts as the default implementation, and additional implementations can be registered using the register() attribute of the generic function. rNc!t}|k7rj| |}|S#t$r+ |}n#t$rt|}YnwxYw||<Y|SwxYw)zgeneric_func.dispatch(cls) -> Runs the dispatch algorithm to return the best available implementation for the given *cls* registered on *generic_func*. )rrKeyErrorrX)r] current_tokenimpl cache_tokendispatch_cacherUs r)dispatchz singledispatch..dispatch2s  "+-Mm+$$&+  '!#&D  ' 1} 1!#x0 1"&N3   's/- A!=A!AA!AA! A!c@ddlm}m}|||jhvS)Nr) get_originUnion)typingrbrc UnionType)r]rbrcrFs r)_is_union_typez&singledispatch.._is_union_typeIs,#5%//":::r,cvt|tryddlm}|xrt d||DS)NTrget_argsc3<K|]}t|tywrh)rr/)rargs r)rzBsingledispatch.._is_valid_dispatch_type..RsCcJsD)Cs)rr/rdriall)r]rirfs r)_is_valid_dispatch_typez/singledispatch.._is_valid_dispatch_typeMs9 c4 #s#DCXc]CC Er,cr| fdS|tddtdi}|stdd}ddlm}t t ||j \}s,rtd |d d td |d d rdd lm}|D]}| |< n| < tdr t j|S)zgeneric_func.register(cls, func) -> func Registers a new implementation for the given *cls* on a *generic_func*. c|Srhr)fr]registers r)rz2singledispatch..register..]s#q!1r,z(Invalid first argument to `register()`. z is not a class or union type.rz(Invalid first argument to `register()`: zS. Use either `@register(some_class)` or plain `@register` on an annotated function.r)get_type_hintszInvalid annotation for z. z not all arguments are classes.z is not a class.rhr)) r~rrdrrr|rzrrirrr) r]rannrrargnamerirkrfrmr^r_rqrUs ` r)rqz singledispatch..registerTsQ #3 '|11>g;=#0"5C>sgF01 D .^D%9%?%?%A BCLGS*3/!#&#1'B'!@B $1'B'!13 #  '} % $  %!HSM  730E#F)+K r,cZ|std|dj|i|S)Nz( requires at least 1 positional argumentr)r~r)rkwr`funcnames r)r#zsingledispatch..wrappersDxj)445 5+xQ))*D7B77r,rzsingledispatch functionrh) rFweakrefWeakKeyDictionaryrrZrqr`MappingProxyTyperUr _clear_cacher) rrxr#rfrmr^r`r_rwrqrUrFs @@@@@@@@@r)r r sH..0NK.;E22h8tZ)BCHHVGG--h7G)//G7D! Nr,c6eZdZdZdZddZddZedZy)rzSingle-dispatch generic method descriptor. Supports wrapping existing descriptors and handles non-descriptor callables as instance methods. c|t|st|dst|dt||_||_y)Nrz is not callable or a descriptor)rrr~r dispatcherrr3rs r)rjzsingledispatchmethod.__init__s8~gdI&>th&FGH H(. r,Nc<|jj||S)zgeneric_method.register(cls, func) -> func Registers a new implementation for the given *cls* on a *generic_method*. r)r~rq)r3r]methods r)rqzsingledispatchmethod.registers ''&'99r,cfd}j|_j|_t|j|S)Ncjj|dj}|j|i|Srl)r~r`rr)rkwargsrr]rfr3s r)rz-singledispatchmethod.__get__.._methods>__--d1g.?.?@F+6>>#s+T3J3J2MNDDHMMCTT^` n$.  /s A6#B56rs:   ""=2,>)# 70+&*'+&*'+&+&+&(+&+&+&(+&+&+&(+&+&+&(  $ & %8'78 !??B " E2FE2T %N O "  st>,\rh -26+Z("T4vt!A!APX *2*2C  P  X  X   sH D'D2/D=2E'D/.D/2D:9D:=EEEE