a DOg9&@sdZddlZddZeeZeddZeejZeejZ eej Z ddZ ee Z d d ZeeZd d ZeZeeZed dZeZeeZGdddZeejZeeZegjZeejZeejZ ee!j"Z#ee$jdZ%eeZ&ze'Wn8e'y@e(dZ)ee)Z*ee)j+Z,dZ)[)Yn0eejZ-eej.Z/[[[[[[d$ddZ0ddZ1d%ddZ2ddZ3GdddZ4GdddZ5d d!Z6ee7e8Z9d"d#e:DZ;dS)&zO Define names for built-in types that aren't directly accessible as a builtin. NcCsdSNrrr/usr/lib64/python3.9/types.py_f rcCsdSrrrrrr rrcsdfdd}|jdS)NcsdSrrrarrfsz_cell_factory..fr) __closure__)r rr r _cell_factorys r ccs dVdS)Nrrrrrr_gsrcsdSrrrrrr_crrcCs dVdSrrrrrr_ag"src@seZdZddZdS)_CcCsdSrrselfrrr_m(rz_C._mN)__name__ __module__ __qualname__rrrrrr'srfromkeysrcCsNt|}t|||\}}}|dur*||||ur:||d<||||fi|S)zBCreate a class object dynamically using the appropriate metaclass.N__orig_bases__) resolve_bases prepare_class)namebaseskwds exec_bodyresolved_basesmetansrrr new_classEsr$cCst|}d}d}t|D]t\}}t|tr6t|ts6qt|dsBq||}d}t|tsdtdq||||||d<|t |d7}q|s|St|S)z8Resolve MRO entries dynamically as specified by PEP 560.Fr__mro_entries__Tz#__mro_entries__ must return a tupler) list enumerate isinstancetype GenericAliashasattrr%tuple TypeErrorlen)r new_basesupdatedshiftibasenew_baserrrrOs"    rcCs|duri}nt|}d|vr*|d}n|r|}|D]0}t|}t||r qt||r0|}qtdq|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)r) issubclassr-)r"rwinnerr3 base_metarrrr9s   r9c@sLeZdZdZdddZdddZddZd d Zd d Zd dZ ddZ 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 (see Enum for an example). NcCs>||_||_||_|p|j|_|du|_tt|dd|_dS)N__isabstractmethod__F)fgetfsetfdel__doc__ overwrite_docboolgetattrr>)rr?r@rAdocrrr__init__s   zDynamicClassAttribute.__init__cCs6|dur|jr|Stn|jdur,td||S)Nzunreadable attribute)r>AttributeErrorr?)rinstance ownerclassrrr__get__s zDynamicClassAttribute.__get__cCs"|jdurtd|||dS)Nzcan't set attribute)r@rH)rrIvaluerrr__set__s zDynamicClassAttribute.__set__cCs |jdurtd||dS)Nzcan't delete attribute)rArH)rrIrrr __delete__s z DynamicClassAttribute.__delete__cCs8|jr |jnd}t|||j|j|p(|j}|j|_|Sr)rCrBr)r@rA)rr?fdocresultrrrgetterszDynamicClassAttribute.gettercCs$t||j||j|j}|j|_|Sr)r)r?rArBrC)rr@rPrrrsetterszDynamicClassAttribute.settercCs$t||j|j||j}|j|_|Sr)r)r?r@rBrC)rrArPrrrdeleterszDynamicClassAttribute.deleter)NNNN)N) rrrrBrGrKrMrNrQrRrSrrrrr=s r=c@seZdZddZddZddZddZed d Zed d Z ed dZ eddZ eZ e Z e Ze ZddZddZeZdS)_GeneratorWrappercCs2||_|jtu|_t|dd|_t|dd|_dS)Nrr)_GeneratorWrapper__wrapped __class__ GeneratorType_GeneratorWrapper__isgenrErr)rgenrrrrGs z_GeneratorWrapper.__init__cCs |j|Sr)rUsend)rvalrrrrZsz_GeneratorWrapper.sendcGs|jj|g|RSr)rUthrow)rtprestrrrr\sz_GeneratorWrapper.throwcCs |jSr)rUcloserrrrr_sz_GeneratorWrapper.closecCs|jjSr)rUgi_coderrrrr`sz_GeneratorWrapper.gi_codecCs|jjSr)rUgi_framerrrrrasz_GeneratorWrapper.gi_framecCs|jjSr)rU gi_runningrrrrrbsz_GeneratorWrapper.gi_runningcCs|jjSr)rU gi_yieldfromrrrrrcsz_GeneratorWrapper.gi_yieldfromcCs t|jSr)nextrUrrrr__next__sz_GeneratorWrapper.__next__cCs|jr |jS|Sr)rXrUrrrr__iter__sz_GeneratorWrapper.__iter__N)rrrrGrZr\r_propertyr`rarbrccr_codecr_frame cr_runningcr_awaitrerf __await__rrrrrTs&    rTcststdjturftddjturfjj}|d@r@S|d@rfj}|j|jdBd_Sddl }ddl | fd d }|S) z2Convert regular generator function to a coroutine.z$types.coroutine() expects a callable__code__Ni )co_flagsrcsV|i|}|jtus.|jtur2|jjd@r2|St|jrRt|jsRt|S|S)Nro) rV CoroutineTyperWr`rpr( Generator CoroutinerT)argskwargscoro_collections_abcfuncrrwrappeds    zcoroutine..wrapped) callabler-rV FunctionTyperECodeTypermrpreplace functoolsrxwraps)ryrpcorrzrrwr coroutines" rcCs g|]}|dddkr|qS)Nr_r).0nrrr +rr)rNN)rN)s\                   :%4