a `&@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/local/src/Python-3.9.6/Lib/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.NZ__orig_bases__) resolve_bases prepare_class)namebaseskwdsZ exec_bodyZresolved_basesmetansrrr new_classEsr!cCst|}d}d}t|D]j\}}t|tr,qt|ds8q||}d}t|tsZtdq||||||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 isinstancetypehasattrr"tuple TypeErrorlen)rZ new_basesZupdatedZshiftibaseZnew_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))rrZwinnerr,Z base_metarrrr1s   r1c@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_docboolgetattrr4)rr5r6r7Zdocrrr__init__s   zDynamicClassAttribute.__init__cCs6|dur|jr|Stn|jdur,td||S)Nzunreadable attribute)r4AttributeErrorr5)rinstanceZ ownerclassrrr__get__s zDynamicClassAttribute.__get__cCs"|jdurtd|||dS)Nzcan't set attribute)r6r=)rr>valuerrr__set__s zDynamicClassAttribute.__set__cCs |jdurtd||dS)Nzcan't delete attribute)r7r=)rr>rrr __delete__s z DynamicClassAttribute.__delete__cCs8|jr |jnd}t|||j|j|p(|j}|j|_|Sr)r9r8r&r6r7)rr5ZfdocresultrrrgetterszDynamicClassAttribute.gettercCs$t||j||j|j}|j|_|Sr)r&r5r7r8r9)rr6rCrrrsetterszDynamicClassAttribute.settercCs$t||j|j||j}|j|_|Sr)r&r5r6r8r9)rr7rCrrrdeleterszDynamicClassAttribute.deleter)NNNN)N) rrrr8r<r?rArBrDrErFrrrrr3s r3c@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__isgenr;rr)rZgenrrrr<s z_GeneratorWrapper.__init__cCs |j|Sr)rHsend)rZvalrrrrLsz_GeneratorWrapper.sendcGs|jj|g|RSr)rHthrow)rZtprestrrrrMsz_GeneratorWrapper.throwcCs |jSr)rHcloserrrrrOsz_GeneratorWrapper.closecCs|jjSr)rHgi_coderrrrrPsz_GeneratorWrapper.gi_codecCs|jjSr)rHgi_framerrrrrQsz_GeneratorWrapper.gi_framecCs|jjSr)rH gi_runningrrrrrRsz_GeneratorWrapper.gi_runningcCs|jjSr)rH gi_yieldfromrrrrrSsz_GeneratorWrapper.gi_yieldfromcCs t|jSr)nextrHrrrr__next__sz_GeneratorWrapper.__next__cCs|jr |jS|Sr)rKrHrrrr__iter__sz_GeneratorWrapper.__iter__N)rrrr<rLrMrOpropertyrPrQrRrScr_codecr_frame cr_runningcr_awaitrUrV __await__rrrrrGs&    rGcststdjturftddjturfjj}|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)Nr_) rI CoroutineTyperJrPr`r%Z GeneratorZ CoroutinerG)argskwargsZcoro_collections_abcfuncrrwrappeds    zcoroutine..wrapped) callabler)rI FunctionTyper;CodeTyper]r`replace functoolsreZwraps)rfr`Zcorlrgrrdr coroutines" rmcCs g|]}|dddkr|qS)Nr_r).0nrrr +rrq)rNN)rN)s\                   :%4