fS'vdZddlZdZeeZedZeejZeejZ eej Z dZ ee Z dZeeZdZeZeeZedZeZeeZGd d ZeejZeeZegjZeejZeejZ ee!j"Z#ee$jd Z%eeZ& e'#e'$r/Z(ee(j)Z*ee(j)j+Z,YdZ([(ndZ([(wwxYweejZ-eej.Z/[[[[[[dd Z0dZ1ddZ2dZ3GddZ4GddZ5dZ6ee7e8Z9ee8e!zZ:ee;Z<edZ=ee>Z?de@DZAdS)zO Define names for built-in types that aren't directly accessible as a builtin. NcdSNr,/opt/alt/python311/lib64/python3.11/types.py_fr rcdSrrrrrr s$rc,dfd}|jdS)NcdSrr)asrfz_cell_factory..fsrr) __closure__)rrs @r _cell_factoryrs. A = rc#KdVdS)Nr rrrr_grs GGGGGrc KdSrrrrr_crs rcKdWVdSrrrrr_agr"s EEEEEErceZdZdZdS)_CcdSrrselfs r_mz_C._m(r rN)__name__ __module__ __qualname__rrrrrr'srrfromkeysrct|}t|||\}}}| ||||ur||d<||||fi|S)zBCreate a class object dynamically using the appropriate metaclass.N__orig_bases__) resolve_bases prepare_class)namebaseskwds exec_bodyresolved_basesmetanss r new_classr.Csk"5))N"4>>ND"d " U""$  4nb 1 1D 1 11rct|}d}d}t|D]\}}t|trt |ds,||}d}t|t std||||z||zdz<|t|dz z }|s|St |S)z8Resolve MRO entries dynamically as specified by PEP 560.Fr__mro_entries__Tz#__mro_entries__ must return a tupler ) list enumerate isinstancetypehasattrr0tuple TypeErrorlen)r( new_basesupdatedshiftibasenew_bases rr%r%MsU IG EU## ' '4 dD ! !  t.//  ''..(E** 'ABB B+3Iagagai' ( S]]Q& &EE    rc4|i}nt|}d|vr|d}n|rt|d}nt}t|trt ||}t |dr|j||fi|}ni}|||fS)azCall the __prepare__ method of the appropriate metaclass. Returns (metaclass, namespace, kwds) as a 3-tuple *metaclass* is the appropriate metaclass *namespace* is the prepared class namespace *kwds* is an updated copy of the passed in kwds argument with any 'metaclass' entry removed. If no kwds argument is passed in, this will be an empty dict. N metaclassr __prepare__)dictpopr4r3_calculate_metar5rA)r'r(r)r,r-s rr&r&bs |Dzzdxx $$  a>>DDD$,tU++t]## T dE 2 2T 2 2  T>rc|}|D]C}t|}t||r"t||r|}5td|S)z%Calculate the most derived metaclass.zxmetaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases)r4 issubclassr7)r,r(winnerr= base_metas rrDrDsn F ? ?JJ fi ( (   i ( ( F >?? ? Mrc@eZdZdZd dZd dZdZdZdZdZ d Z dS) DynamicClassAttributeaRoute attribute access on a class to __getattr__. This is a descriptor, used to define attributes that act differently when accessed through an instance and through a class. Instance access remains normal, but access to an attribute through a class will be routed to the class's __getattr__ method; this is done by raising AttributeError. This allows one to have properties active on an instance, and have virtual attributes on the class with the same name. (Enum used this between Python versions 3.4 - 3.9 .) Subclass from this to use a different method of accessing virtual attributes and still be treated properly by the inspect module. (Enum uses this since Python 3.10 .) Nc||_||_||_|p|j|_|du|_t t |dd|_dS)N__isabstractmethod__F)fgetfsetfdel__doc__ overwrite_docboolgetattrrL)rrMrNrOdocs r__init__zDynamicClassAttribute.__init__sT   *dl  D[$(7Mu)U)U$V$V!!!rc||jr|St|jtd||S)Nzunreadable attribute)rLAttributeErrorrM)rinstance ownerclasss r__get__zDynamicClassAttribute.__get__sM  (   "" " Y  !788 8yy"""rc^|jtd|||dS)Nzcan't set attribute)rNrW)rrXvalues r__set__zDynamicClassAttribute.__set__s3 9  !677 7 (E"""""rc\|jtd||dS)Nzcan't delete attribute)rOrW)rrXs r __delete__z DynamicClassAttribute.__delete__s1 9  !9:: : (rc|jr|jnd}t|||j|j|p|j}|j|_|Sr)rQrPr4rNrO)rrMfdocresults rgetterzDynamicClassAttribute.gettersK#1;t||tdD$)TY8L MM#1 rcrt||j||j|j}|j|_|Sr)r4rMrOrPrQ)rrNrbs rsetterzDynamicClassAttribute.setters3dDItTY EE#1 rcrt||j|j||j}|j|_|Sr)r4rMrNrPrQ)rrOrbs rdeleterzDynamicClassAttribute.deleters3dDIty$ EE#1 r)NNNNr) rr r!rPrUrZr]r_rcrergrrrrJrJs WWWW#######    rrJceZdZdZdZdZdZedZedZ edZ edZ eZ e Z e Ze Zd Zd ZeZd S) _GeneratorWrapperc||_|jtu|_t |dd|_t |dd|_dS)Nrr!)_GeneratorWrapper__wrapped __class__ GeneratorType_GeneratorWrapper__isgenrSrr!)rgens rrUz_GeneratorWrapper.__init__sD} 5 Z66 #C>>rc6|j|Sr)rksend)rvals rrqz_GeneratorWrapper.sends~""3'''rc(|jj|g|RSr)rkthrow)rtprests rrtz_GeneratorWrapper.throws#t~#B.....rc4|jSr)rkclosers rrxz_GeneratorWrapper.closes~##%%%rc|jjSr)rkgi_coders rrzz_GeneratorWrapper.gi_codes ~%%rc|jjSr)rkgi_framers rr|z_GeneratorWrapper.gi_frames ~&&rc|jjSr)rk gi_runningrs rr~z_GeneratorWrapper.gi_runnings ~((rc|jjSr)rk gi_yieldfromrs rrz_GeneratorWrapper.gi_yieldfroms ~**rc*t|jSr)nextrkrs r__next__z_GeneratorWrapper.__next__sDN###rc"|jr|jS|Sr)rnrkrs r__iter__z_GeneratorWrapper.__iter__s < "> ! rN)rr r!rUrqrtrxpropertyrzr|r~rcr_codecr_frame cr_runningcr_awaitrr __await__rrrriris??? (((///&&& &&X& ''X' ))X) ++X+GHJH$$$IIIrricvtstdjturat ddjt urDjj}|dzrS|dzr,j}||jdz_Sddl }ddl | fd }|S) z2Convert regular generator function to a coroutine.z$types.coroutine() expects a callable__code__Ni )co_flagsrc|i|}|jtus|jtur|jjdzr|St |jr$t |jst|S|S)Nr) rl CoroutineTypermrzrr3 Generator Coroutineri)argskwargscoro_collections_abcfuncs rwrappedzcoroutine..wrappedstT$V$$ Nm + + Nm + + 0E0M +K t-7 8 8 +4!1!;<< + %T** * r) callabler7rl FunctionTyperSCodeTyperrreplace functoolsrwraps)rrcorrrs` @r coroutiners D>>@>??? ,&&j$''1X===) e  K d? BJJ e0CJDDDMK__T Nrc.g|]}|dddk|S)Nr _r).0ns r r1s% 0 0 01RaR5C<<1<<rsq tBxx T,,   4  4 &&$s)** 4     RRTT RTTR      ceeT#YY T""$$']] d3iiDOOV_--D)**tCH~~ Dz!:;; T#YY 1 O111D*++MS&/00IIIIII1 tL122tL455RR2222*@"<<<<<<<<~########J111ftDI DsOO tH~~ 4::T.)) 0 0ggii 0 0 0sEF"%F  F