Qf gdZddlmZddlmZddlmZddlmZddl m Z dZ dZ e e fd Z e e fd Zd Zd Zd ZdZdZdZdZdZdZdZdZdZdefdefdefgdefdefdefgdefdefdefgdefdefdefgdZdZdZ ddlmZe Z!e!fdZ" 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,Z/d-Z0 dd.lm0Z0d/Z1d0Z2d;d2Z3d3Z4d4Z5d5Z6Gd6d7Z7e Z8Gd8d9Z9y1#e$rYwxYw#e$rYwxYw#e$rYwxYw#e$rYWwxYw)<)update_wrapperwrapsWRAPPER_ASSIGNMENTSWRAPPER_UPDATEStotal_orderingcache cmp_to_key lru_cachereducepartial partialmethodsingledispatchsingledispatchmethodcached_property)get_cache_token) namedtuple)recursive_repr)RLock) GenericAlias) __module____name__ __qualname____doc____annotations____type_params__)__dict__c |D]} t||}t||||D](}t||jt||i*||_|S#t$rY`wxYwN)getattrsetattrAttributeErrorupdate __wrapped__)wrapperwrappedassignedupdatedattrvalues 0/opt/alt/python312/lib64/python3.12/functools.pyrr#s  *GT*E GT5 ) %%ggtR&@A"G N   s A A%$A%c* tt|||S)Nr%r&r')r rr,s r*rrAs >7$g 77cb t|j||}|tur|S| xr||k7Srtype__lt__NotImplementedselfother op_results r* _gt_from_ltr7Y:OT !!$.IN"= *TU]*r-c` t|j||}|tur|S|xs||k(Srr/r3s r* _le_from_ltr:`8KT !!$.IN"  % %r-cT t|j||}|tur|S| Srr/r3s r* _ge_from_ltr=g1CT !!$.IN"=r-cb t|j||}|tur|S| xs||k(Srr0__le__r2r3s r* _ge_from_lerBn:PT !!$.IN"= )DEM)r-c` t|j||}|tur|S|xr||k7Srr@r3s r* _lt_from_lerEu8LT !!$.IN"  &&r-cT t|j||}|tur|S| Srr@r3s r* _gt_from_lerH|r>r-cb t|j||}|tur|S| xr||k7Srr0__gt__r2r3s r* _lt_from_gtrLr8r-c` t|j||}|tur|S|xs||k(SrrJr3s r* _ge_from_gtrNr;r-cT t|j||}|tur|S| SrrJr3s r* _le_from_gtrPr>r-cb t|j||}|tur|S| xs||k(Srr0__ge__r2r3s r* _le_from_gerTrCr-c` t|j||}|tur|S|xr||k7SrrRr3s r* _gt_from_gerVrFr-cT t|j||}|tur|S| SrrRr3s r* _lt_from_gerXr>r-rKrArSr1)r1rArKrSc  tDchc]#}t||dtt|dus"|%}}|s tdt |}t|D]\}}||vs ||_t ||| |Scc}w)Nz6must define at least one ordering operation: < > <= >=)_convertrobject ValueErrormaxrr )clsoprootsrootopnameopfuncs r*rrs@" ^(Bgc2t&.Kobjc||_yrrg)r4rgs r*__init__zcmp_to_key..K.__init__s DHr-cD|j|jdkSNrrir4r5mycmps r*r1zcmp_to_key..K.__lt__599-1 1r-cD|j|jdkDSrlrirms r*rKzcmp_to_key..K.__gt__ror-cD|j|jdk(Srlrirms r*__eq__zcmp_to_key..K.__eq__599-2 2r-cD|j|jdkSrlrirms r*rAzcmp_to_key..K.__le__rsr-cD|j|jdk\Srlrirms r*rSzcmp_to_key..K.__ge__rsr-N) rrr __slots__rjr1rKrrrArS__hash__)rnsr*Krfs-G   2 2 3 3 3r-rx)r[)rnrxs` r*rrs6F Hr-)rc t|}|tur t|}n|}|D] }|||} |S#t$r t ddwxYw)Nz0reduce() of empty iterable with no initial value)iter_initial_missingnext StopIteration TypeError)functionsequenceinitialitr)elements r*r r sv  hB"" NHE ( L NBDIM N Ns 6A )r cPeZdZ dZfdZdZedZdZdZ xZ S)r )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^rrrr4 __class__s r*rzpartial.__new__su~AB B 4 99t#D4$--484H99DWc*3/     r-cdi|j|}|jg|j|i|Srrrr)r4rrs 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|ywr)repr).0xs r* z#partial.__repr__..3s/YDGYsc30K|]\}}|d|yw=Nrkvs r*rz#partial.__repr__..4s!E/DVaqc1%L/D functoolsz functools.(, )) r0rrrextendrritemsrjoin)r4qualnamers r*__repr__zpartial.__repr__/s:**TYY  /TYY// Et}}/B/B/DEE : K /z499T?*;1= =1TYYt_-Q//r-ct||jf|j|j|jxsd|jxsdffSr)r0rrrrr4s 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~lenrdictr0rrrr)r4staterrkwds namespaces r* __setstate__zpartial.__setstate__=s%'FG G u:?=c%j\JK K&+#dD)ju&=  Zd%;  !*Y*E34 4T{ <D $Zt #:D  I!    r-) rrrrvrrrrrr __classcell__)rs@r*r r s;FI 800=r-r )r cHeZdZ dZdZdZddZedZe e Z y)r 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)r4rrrs r*rjzpartialmethod.__init__cs~~gdI&>B"(&,0 0 dM * DI D(DI9t}}99DMDIDI$DMr-cZt|}|j}|j}t|jg}|j t t|j|j d|jjD|d|ddj|dS)Nc30K|]\}}|d|ywrrrs r*rz)partialmethod.__repr__..|s!C-BTQqc1%L-Br.rrr) r0rrrrrmaprrrr)r4r^modulerrs r*rzpartialmethod.__repr__vs4j##TYY  Cdii() CT]]-@-@-BCC8*Adiio%6a88r-cBfd}j|_|_|S)Nchij|}j|gj|i|Srr) cls_or_selfrrr4s r*_methodz3partialmethod._make_unbound_method.._methods:4$--484H499[H499HtHxH Hr-)__isabstractmethod___partialmethod)r4rs` 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)r4rgr^getresultnew_funcs r*rzpartialmethod.__get__sdiiD1 ?3}Htyy(!GDIIGG&.&7&7FO >..088cBF &sB BBc0t|jddSNrFrrrs r*rz"partialmethod.__isabstractmethod__tyy"8%@@r-r) rrrrjrrrpropertyr classmethodr__class_getitem__rr-r*r r [s>%&9&AA$L1r-r c`t|tr|j}t|tr|Sr)rr rrs r*_unwrap_partialrs& T7 #yy T7 # Kr- CacheInfo)hitsmissesmaxsizecurrsizec"eZdZ dZefdZdZy) _HashedSeq hashvaluec(||dd|||_yrr)r4tuphashs r*rjz_HashedSeq.__init__sQcr-c|jSrrrs r*rwz_HashedSeq.__hash__s ~~r-N)rrrrvrrjrwrr-r*rrs I!%#r-rc& |}|r||z }|jD]} || z } |rC||fd|Dz }|rJ||fd|jDz }t|S||dk(r|d|vr|dSt|S)Nc3.K|] }|ywrrrrr0s r*rz_make_key..s+dT!Wdc3.K|] }|ywrrrs r*rz_make_key..s8-Qa-rr)rvaluesr) rrtypedkwd_mark fasttypesrr0rkeyitems ` r* _make_keyrs  C  xJJLD 4KC!  u+d+++  58$++-88 8C c? SQ4A<941v c?r-c ttrdkrYdnVtr>ttr.dc}t |t }fd|_t||S tdfd}|S)NrcdSNrrrrsr*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 s0'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_lenfullrlockrrrrarrs r*r$z#_lru_cache_wrapper..wrapper4sz4u-C ~#9=6Iy$&/IdO&/IdO:D.22DJd!%DJ!%DJAID!  ! #D1D1F%< "G#&GCL&,GFO#4=D!#YF $V I/33DIV f ")E#J :D $V4D;??DJ?deCj&K72DGHMgHMs;CC*ACCC$cV 5cdddS#1swYyxYwrr)rrrrrrsr* cache_infoz&_lru_cache_wrapper..cache_infoms*% dFGY[A B BTTs(ct 5jddgdddxddddy#1swYyxYw)NrF)clear)rrrrrrasr* cache_clearz'_lru_cache_wrapper..cache_clearrs=2  KKMT4.DG D6D TTs .7)r[rr__len__rrr)rrrrr$rrrrrrrrrrrrrrrars```` @@@@@@@@@@@@@@r*rr sxHH(D$V ED6 D I I 7D DT4&DG!|    7 7 7 rBB $G%G Nr-)rc( td|S)N)r)r )rs r*rrsF "9T "= 11r-c g} |Dcgc]}|s| }}|s|S|D]}|d}|D] }||ddvs d}n td|j||D]}|d|k(s |d=gcc}w)NrrzInconsistent hierarchy) RuntimeErrorappend) sequencesrss1 candidates2seqs r* _c3_merger)s F  )/ 1QQ /MB1I12& $I   78 8 i C1v"F! /s A,A,Nc tt|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)N__abstractmethods__rc36K|]}t|ywr) issubclass)rbbases r*rz_c3_mro..s--: 1d#]sabcs) enumeratereversed __bases__rrlistr-anyr"remove_c3_mror)) r^r1iboundaryexplicit_basesabstract_bases other_basesr/explicit_c3_mrosabstract_c3_mros other_c3_mross ` r*r8r8s Xcmm454 4. /3==)A-H 6 4:2D#-- 23NNs}}XY/0K c4 --0]]-*  ! !$ '  D=KL^T40^L=KL^T40^L:EF+$WT-+MF   + ,.; <  *+ ,/:m < MLFs2E E#&E(c Z 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)Ncj|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)rC)rDr5typess r*is_strict_basez$_compose_mro..is_strict_bases'Ee|u}} 4r-T)rreverser0)setrC__subclasses__r-r"sortrr8) r^rHrFnrItype_setmrorDfoundsubr$subclsrEs `` @r* _compose_mrorTs-  E; /1AQ /E  71^A%6Q 7E5zH C%%'C%JsC$8 FAX aFG( JJsO  sD )C$JJv& 3S !!7 0 8Gs" DD D#D#) D( 3D( c t||j}d}|D]T}|I||vrC||jvr5||jvr't||st dj ||n ||vsS|}V|j |S)NzAmbiguous dispatch: {} or {})rTkeysrCr-r!rr)r^registryrPmatchts r* _find_implrZs sHMMO ,C E   X !3;;"6"'s{{":&0&:"#A#H#H1$  =E << r-cD ddl ddl}i |jd fd fdfdd  fd fd}t|dd| t< |_|_ j |_j|_ t|||S) Nrc !t}|k7rj| |}|S#t$r+ |}n#t$rt|}YnwxYw||<Y|SwxYwr)rrKeyErrorrZ)r^ current_tokenimpl cache_tokendispatch_cacherWs r*dispatchz singledispatch..dispatch0s   "+-Mm+$$&+  '!#&D  ' 1} 1!#x0 1"&N3   's/. A">A"AA"AA"!A"c@ddlm}m}|||jhvS)Nr) get_originUnion)typingrdre UnionType)r^rdrerHs r*_is_union_typez&singledispatch.._is_union_typeGs,#5%//":::r-cvt|tryddlm}|xrt d||DS)NTrget_argsc3<K|]}t|tywr)rr0)rargs r*rzBsingledispatch.._is_valid_dispatch_type..PsC]cJsD)]s)rr0rfrkall)r^rkrhs r*_is_valid_dispatch_typez/singledispatch.._is_valid_dispatch_typeKs9 c4 #s#DCXc]CC Er-c r| fdS|tddtdi}|stdd}ddlm}t t ||j \}s,rtd |d d td |d d rdd lm}|D]}| |< n| < tdr t j|S)Nc|Srr)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.rjr+) r~rrfrtr|rzrrkrrr) r^rannrtargnamerkrmrhror`rarsrWs ` r*rsz singledispatch..registerRsQ #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)rkwrbfuncnames r*r$zsingledispatch..wrappersDxj)445 5+xQ))*D7B77r-rzsingledispatch functionr) rHweakrefWeakKeyDictionaryrr[rsrbMappingProxyTyperWr _clear_cacher) rrzr$rhror`rbraryrsrWrHs @@@@@@@@@r*r r sH..0NK.;E22h8tZ)BCHHVGG--h7G)//G7D! Nr-c4eZdZ dZddZddZedZy)rc|t|st|dst|dt||_||_y)Nrz is not callable or a descriptor)rrr~r dispatcherrr4rs r*rjzsingledispatchmethod.__init__s8~gdI&>th&FGH H(. r-Nc> |jj||S)Nr)rrs)r4r^methods r*rszsingledispatchmethod.registers# ''&'99r-cfd}j|_j|_t|j|S)Ncjj|dj}|j|i|Srl)rrbrr)rkwargsrr^rgr4s r*rz-singledispatchmethod.__get__.._methods>__--d1g.?.?@F+6>>#s+T3J3J2MNDDHMMCTT^` n$.  /s A6#B56rs:   ""=2,>)# 70+&*'+&*'+&+&+&(+&+&+&(+&+&+&(+&+&+&(  $ & %8'78 !??B " C2FC2P %N O "  st>,\rh -26+Z("T4vt!A!APX *2*2  P  X  T   sH D&D1.D<1E&D.-D.1D98D9<EEEE