grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026U iÛf’ã @sädZddddddddd d d d d g ZddlmZddlmZddlmZddlm Z dZ dZ e e fdd„Z e e fdd„Z efdd„Zefdd„Zefdd„Zefdd„Zefdd „Zefd!d"„Zefd#d$„Zefd%d&„Zefd'd(„Zefd)d*„Zefd+d,„Zefd-d.„Zd/efd0efd1efgd1efd2efd/efgd2efd1efd0efgd0efd/efd2efgd3œZd4d„Zd5d„Zzdd6lmZWnek �r’YnXe ƒZ!e!fd7d„Z"zdd8lm"Z"Wnek �rÌYnXGd9d „d ƒZ#zdd:lm#Z#Wnek �rYnXGd;d „d e ƒZ$dd?d@dAdBgƒZ&GdCdD„dDe'ƒZ(e ƒfe)e*he+e,e-fdEdF„Z.dYdId„Z/dJdK„Z0zddLlm0Z0Wnek �r’YnXdMdN„Z1dZdPdQ„Z2dRdS„Z3dTdU„Z4dVd „Z5GdWd „d ƒZ6e ƒZ7GdXd „d ƒZ8dOS)[zEfunctools.py - Tools for working with functions and callable objects Úupdate_wrapperÚwrapsÚWRAPPER_ASSIGNMENTSÚWRAPPER_UPDATESÚtotal_orderingÚ cmp_to_keyÚ lru_cacheÚreduceÚpartialÚ partialmethodÚsingledispatchÚsingledispatchmethodÚcached_propertyé)Úget_cache_token)Ú namedtuple)Úrecursive_repr)ÚRLock)Ú __module__Ú__name__Ú __qualname__Ú__doc__Ú__annotations__)Ú__dict__c Csf|D]4}zt||ƒ}Wntk r*YqXt|||ƒq|D]}t||ƒ t||iƒ¡q>||_|S)aUpdate a wrapper function to look like the wrapped function wrapper is the function to be updated wrapped is the original function assigned is a tuple naming the attributes assigned directly from the wrapped function to the wrapper function (defaults to functools.WRAPPER_ASSIGNMENTS) updated is a tuple naming the attributes of the wrapper that are updated with the corresponding attribute from the wrapped function (defaults to functools.WRAPPER_UPDATES) )ÚgetattrÚAttributeErrorÚsetattrÚupdateÚ __wrapped__)ÚwrapperÚwrappedÚassignedÚupdatedÚattrÚvalue©r$ú./opt/alt/python38/lib64/python3.8/functools.pyr"scCstt|||d�S)a‹Decorator factory to apply update_wrapper() to a wrapper function Returns a decorator that invokes update_wrapper() with the decorated function as the wrapper argument and the arguments to wraps() as the remaining arguments. Default arguments are as for update_wrapper(). This is a convenience function to simplify applying partial() to update_wrapper(). ©rr r!)r rr&r$r$r%r@s ÿcCs$| |¡}||kr|S| o"||kS)zIReturn a > b. Computed by @total_ordering from (not a < b) and (a != b).©Ú__lt__©ÚselfÚotherÚNotImplementedÚ op_resultr$r$r%Ú _gt_from_ltXs r.cCs| |¡}|p||kS)zEReturn a <= b. Computed by @total_ordering from (a < b) or (a == b).r'r)r$r$r%Ú _le_from_lt_s r/cCs| |¡}||kr|S| S)z=Return a >= b. Computed by @total_ordering from (not a < b).r'r)r$r$r%Ú _ge_from_ltds r0cCs$| |¡}||kr|S| p"||kS)zJReturn a >= b. Computed by @total_ordering from (not a <= b) or (a == b).©Ú__le__r)r$r$r%Ú _ge_from_leks r3cCs"| |¡}||kr|S|o ||kS)zFReturn a < b. Computed by @total_ordering from (a <= b) and (a != b).r1r)r$r$r%Ú _lt_from_lers r4cCs| |¡}||kr|S| S)z=Return a > b. Computed by @total_ordering from (not a <= b).r1r)r$r$r%Ú _gt_from_leys r5cCs$| |¡}||kr|S| o"||kS)zIReturn a < b. Computed by @total_ordering from (not a > b) and (a != b).©Ú__gt__r)r$r$r%Ú _lt_from_gt€s r8cCs| |¡}|p||kS)zEReturn a >= b. Computed by @total_ordering from (a > b) or (a == b).r6r)r$r$r%Ú _ge_from_gt‡s r9cCs| |¡}||kr|S| S)z=Return a <= b. Computed by @total_ordering from (not a > b).r6r)r$r$r%Ú _le_from_gtŒs r:cCs$| |¡}||kr|S| p"||kS)zJReturn a <= b. Computed by @total_ordering from (not a >= b) or (a == b).©Ú__ge__r)r$r$r%Ú _le_from_ge“s r=cCs"| |¡}||kr|S|o ||kS)zFReturn a > b. Computed by @total_ordering from (a >= b) and (a != b).r;r)r$r$r%Ú _gt_from_gešs r>cCs| |¡}||kr|S| S)z=Return a < b. Computed by @total_ordering from (not a >= b).r;r)r$r$r%Ú _lt_from_ge¡s r?r7r2r<r()r(r2r7r<csV‡fdd„tDƒ}|stdƒ‚t|ƒ}t|D]"\}}||kr.||_tˆ||ƒq.ˆS)z6Class decorator that fills in missing ordering methodscs(h|] }tˆ|dƒtt|dƒk r|’qS©N)rÚobject)Ú.0Úop©Úclsr$r%Ú ºsz!total_ordering..z6must define at least one ordering operation: < > <= >=)Ú_convertÚ ValueErrorÚmaxrr)rEÚrootsÚrootÚopnameÚopfuncr$rDr%r·scsG‡fdd„dtƒ}|S)z,Convert a cmp= function into a key= functioncsZeZdZdgZdd„Z‡fdd„Z‡fdd„Z‡fdd „Z‡fd d „Z‡fd d „Z dZ dS)zcmp_to_key..KÚobjcSs ||_dSr@©rN)r*rNr$r$r%Ú__init__Íszcmp_to_key..K.__init__csˆ|j|jƒdkS©NrrO©r*r+©Úmycmpr$r%r(Ïszcmp_to_key..K.__lt__csˆ|j|jƒdkSrQrOrRrSr$r%r7Ñszcmp_to_key..K.__gt__csˆ|j|jƒdkSrQrOrRrSr$r%Ú__eq__Ószcmp_to_key..K.__eq__csˆ|j|jƒdkSrQrOrRrSr$r%r2Õszcmp_to_key..K.__le__csˆ|j|jƒdkSrQrOrRrSr$r%r<×szcmp_to_key..K.__ge__N) rrrÚ __slots__rPr(r7rUr2r<Ú__hash__r$rSr$r%ÚKËs     rX)rA)rTrXr$rSr%rÉs)rcCsZt|ƒ}|tkr>z t|ƒ}WqBtk r:tdƒd‚YqBXn|}|D]}|||ƒ}qF|S)aà reduce(function, sequence[, initial]) -> value Apply a function of two arguments cumulatively to the items of a sequence, from left to right, so as to reduce the sequence 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 sequence in the calculation, and serves as a default when the sequence is empty. z0reduce() of empty sequence with no initial valueN)ÚiterÚ_initial_missingÚnextÚ StopIterationÚ TypeError)ZfunctionZsequenceÚinitialÚitr#Zelementr$r$r%rès   )rcsJeZdZdZdZ‡fdd„Zdd„Zeƒdd„ƒZd d „Z d d „Z ‡Z S) r zSNew function with partial application of the given arguments and keywords. )ÚfuncÚargsÚkeywordsrÚ __weakref__csZt|ƒstdƒ‚t|dƒr4|j|}|j|–}|j}tt|ƒ |¡}||_||_||_|S)Nz#the first argument must be callabler`) Úcallabler]Úhasattrrarbr`Úsuperr Ú__new__)rEr`rarbr*©Ú __class__r$r%rgs   zpartial.__new__cOs|j|–}|j|j|ž|ŽSr@©rbr`ra)r*rarbr$r$r%Ú__call__%s zpartial.__call__cCs‚t|ƒj}t|jƒg}| dd„|jDƒ¡| dd„|j ¡Dƒ¡t|ƒjdkrld|›dd  |¡›d�S|›dd  |¡›d�S) Ncss|]}t|ƒVqdSr@)Úrepr)rBÚxr$r$r%Ú -sz#partial.__repr__..css |]\}}|›d|›�VqdS)ú=Nr$©rBÚkÚvr$r$r%rn.sÚ functoolsz functools.ú(ú, ú)) Útyperrlr`ÚextendrarbÚitemsrÚjoin)r*Úqualnamerar$r$r%Ú__repr__)s  zpartial.__repr__cCs*t|ƒ|jf|j|j|jpd|jp$dffSr@)rwr`rarbr©r*r$r$r%Ú __reduce__3sÿzpartial.__reduce__cCsÌt|tƒstdƒ‚t|ƒdkr0tdt|ƒ›�ƒ‚|\}}}}t|ƒrrt|tƒrr|dk r`t|tƒrr|dk rzt|tƒsztdƒ‚t|ƒ}|dkr�i}nt|ƒtk r¤t|ƒ}|dkr°i}||_||_||_ ||_ dS)Nz(argument to __setstate__ must be a tupleézexpected 4 items in state, got zinvalid partial state) Ú isinstanceÚtupler]ÚlenrdÚdictrwrr`rarb)r*Ústater`raÚkwdsÚ namespacer$r$r%Ú __setstate__7s4   ÿÿþþ zpartial.__setstate__) rrrrrVrgrkrr|r~r‡Ú __classcell__r$r$rhr%r s  )r c@sDeZdZdZdd„Zde_dd„Zdd„Zdd d „Ze d d „ƒZ d S)r zÂMethod descriptor with partial application of the given arguments and keywords. Supports wrapping existing descriptors and handles non-descriptor callables as instance methods. cOsØt|ƒdkr|^}}}nV|s&tdƒ‚nHd|krZ| d¡}|^}}ddl}|jdtdd�ntdt|ƒdƒ‚t|ƒ}t|ƒs–t|d ƒs–td   |¡ƒ‚t |t ƒrÂ|j |_ |j ||_ |j|–|_n||_ ||_ ||_dS) Néz8descriptor '__init__' of partialmethod needs an argumentr`rz0Passing 'func' as keyword argument is deprecated)Ú stacklevelz8type 'partialmethod' takes at least one argument, got %déÚ__get__z${!r} is not callable or a descriptor)r‚r]ÚpopÚwarningsÚwarnÚDeprecationWarningr�rdreÚformatr€r r`rarb)rarbr*r`rŽr$r$r%rP]s6    ÿ ÿÿ  zpartialmethod.__init__z#($self, func, /, *args, **keywords)cCsNd tt|jƒ¡}d dd„|j ¡Dƒ¡}d}|j|jj|jj |j ||d�S)Nrucss|]\}}d ||¡VqdS)z{}={!r}N)r‘rpr$r$r%rnƒsÿz)partialmethod.__repr__..z*{module}.{cls}({func}, {args}, {keywords}))ÚmodulerEr`rarb) rzÚmaprlrarbryr‘rirrr`)r*rarbÚ format_stringr$r$r%r|�s ÿ üzpartialmethod.__repr__cs‡fdd„}ˆj|_ˆ|_|S)Ncs ˆj|–}ˆj|fˆj|ž|ŽSr@rj)Ú cls_or_selfrarbr}r$r%Ú_method�s z3partialmethod._make_unbound_method.._method)Ú__isabstractmethod__Ú_partialmethod)r*r–r$r}r%Ú_make_unbound_methodŒs z"partialmethod._make_unbound_methodNcCs€t|jddƒ}d}|dk rd|||ƒ}||jk rdt|f|jž|jŽ}z |j|_Wntk rbYnX|dkr|| ¡ ||¡}|S)NrŒ) rr`r rarbÚ__self__rr™rŒ)r*rNrEÚgetÚresultÚnew_funcr$r$r%rŒ”s   zpartialmethod.__get__cCst|jddƒS©Nr—F©rr`r}r$r$r%r—§sz"partialmethod.__isabstractmethod__)N) rrrrrPÚ__text_signature__r|r™rŒÚpropertyr—r$r$r$r%r Us"  cCst|tƒr|j}q|Sr@)r€r r`©r`r$r$r%Ú_unwrap_partial­s r£Ú CacheInfoÚhitsÚmissesÚmaxsizeÚcurrsizec@s(eZdZdZdZefdd„Zdd„ZdS)Ú _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. Ú hashvaluecCs||dd…<||ƒ|_dSr@©rª)r*ÚtupÚhashr$r$r%rPÁs z_HashedSeq.__init__cCs|jSr@r«r}r$r$r%rWÅsz_HashedSeq.__hash__N)rrrrrVr­rPrWr$r$r$r%r©¸s r©c s”|}|r&||7}| ¡D] } || 7}q|rh||‡fdd„|Dƒƒ7}|rŒ||‡fdd„| ¡Dƒƒ7}n$||ƒdkrŒˆ|dƒ|krŒ|dSt|ƒS)a‘Make 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. c3s|]}ˆ|ƒVqdSr@r$©rBrr©rwr$r%rnàsz_make_key..c3s|]}ˆ|ƒVqdSr@r$r®r¯r$r%rnâsr‹r)ryÚvaluesr©) rar…ÚtypedÚkwd_markÚ fasttypesr�rwr‚ÚkeyÚitemr$r¯r%Ú _make_keyÈs   r¶é€Fcsntˆtƒrˆdkr\d‰nDtˆƒrLtˆtƒrLˆd}‰t|ˆˆtƒ}t||ƒSˆdk r\tdƒ‚‡‡fdd„}|S)a«Least-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: http://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU) rr·Nz=Expected first argument to be an integer, a callable, or Nonecst|ˆˆtƒ}t||ƒSr@)Ú_lru_cache_wrapperÚ _CacheInfor)Ú user_functionr©r§r±r$r%Údecorating_function sz&lru_cache..decorating_function)r€ÚintrdÚboolr¸r¹rr])r§r±rºrr¼r$r»r%rçs   ÿcsòtƒ‰t‰ d\‰‰‰‰i‰d‰ ‰ d‰ˆj‰ˆj‰tƒ‰ g‰ˆˆddgˆdd…<ˆ dkrh‡ ‡fdd„}nNˆ dkrŒ‡‡‡ ‡ ‡ ‡‡‡fdd„}n*‡‡‡‡‡‡‡‡‡ ‡ ‡ ‡ ‡ ‡‡‡fdd„}‡‡‡ ‡ ‡ ‡ fdd „}‡‡‡ ‡ ‡ ‡fd d „}||_||_|S) N)rr‹r‰érFcsˆd7‰ˆ||Ž}|S©Nr‹r$)rar…rœ)r¦rºr$r%r$s z#_lru_cache_wrapper..wrappercsHˆ||ˆƒ}ˆ|ˆƒ}|ˆk r*ˆd7‰|Sˆd7‰ˆ||Ž}|ˆ|<|SrÀr$)rar…r´rœ)ÚcacheÚ cache_getr¥Úmake_keyr¦Úsentinelr±rºr$r%r-s   c s>ˆ ||ˆƒ}ˆ �zˆ|ƒ}|dk r~|\}}}}||ˆ<||ˆ<ˆ ˆ}||ˆ<ˆ ˆ<||ˆ<ˆ |ˆ<ˆd7‰|W5QR£Sˆ d7‰ W5QRXˆ||Ž}ˆ �–|ˆkrªn†ˆrúˆ } || ˆ<|| ˆ<| ˆ‰ ˆ ˆ} ˆ ˆ} dˆ ˆ<ˆ ˆ<ˆ| =| ˆ|<n6ˆ ˆ}|ˆ ||g}||ˆ<ˆ ˆ<ˆ|<ˆƒˆ k‰W5QRX|SrÀr$) rar…r´ÚlinkZ link_prevZ link_nextZ_keyrœZlastZoldrootZoldkeyZ oldresult)ÚKEYÚNEXTÚPREVÚRESULTrÁrÂÚ cache_lenÚfullr¥ÚlockrÃr§r¦rKr±rºr$r%r<sB     c s,ˆ�ˆˆˆˆˆƒƒW5QR£SQRXdS)zReport cache statisticsNr$r$)r¹rÊr¥rÌr§r¦r$r%Ú cache_infousz&_lru_cache_wrapper..cache_infoc s<ˆ�.ˆ ¡ˆˆddgˆdd…<d‰‰d‰W5QRXdS)z$Clear the cache and cache statisticsNrF)Úclearr$)rÁrËr¥rÌr¦rKr$r%Ú cache_clearzs z'_lru_cache_wrapper..cache_clear)rAr¶r›Ú__len__rrÍrÏ)rºr§r±r¹rrÍrÏr$)rÆrÇrÈrÉr¹rÁrÂrÊrËr¥rÌrÃr§r¦rKrÄr±rºr%r¸s* *9 r¸)r¸cCsŽg}dd„|Dƒ}|s|S|D]2}|d}|D]}||dd…kr.d}qq.qRq|dkrbtdƒ‚| |¡|D]}|d|krp|d=qpqdS)zŒMerges MROs in *sequences* to a single MRO using the C3 algorithm. Adapted from http://www.python.org/download/releases/2.3/mro/. cSsg|] }|r|‘qSr$r$©rBÚsr$r$r%Ú ™sz_c3_merge..rr‹NzInconsistent hierarchy)Ú RuntimeErrorÚappend)Ú sequencesrœÚs1Ú candidateÚs2Úseqr$r$r%Ú _c3_merge‘s"  rÛNc stt|jƒƒD]$\}‰tˆdƒrt|jƒ|}q8qd}ˆrDtˆƒng‰t|jd|…ƒ}g}t|j|d…ƒ}ˆD]0‰t|ˆƒrtt‡fdd„|jDƒƒst| ˆ¡qt|D]‰ˆ  ˆ¡qª‡fdd„|Dƒ}‡fdd„|Dƒ}‡fd d„|Dƒ} t |gg||| |g|g|gƒS) aƒComputes 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__rNc3s|]}t|ˆƒVqdSr@)Ú issubclass)rBÚb)Úbaser$r%rnÈsz_c3_mro..csg|]}t|ˆd�‘qS©©Úabcs©Ú_c3_mro©rBrßrár$r%rÓÐsz_c3_mro..csg|]}t|ˆd�‘qSràrãrårár$r%rÓÑscsg|]}t|ˆd�‘qSràrãrårár$r%rÓÒs) Ú enumerateÚreversedÚ __bases__rer‚ÚlistrÝÚanyrÕÚremoverÛ) rErâÚiÚboundaryÚexplicit_basesÚabstract_basesÚ other_basesÚexplicit_c3_mrosÚabstract_c3_mrosÚ other_c3_mrosr$)rârßr%rä¬sD ÿ  ÿÿÿþþþÿräcsìtˆjƒ‰‡‡fdd„‰‡fdd„ˆDƒ‰‡fdd„‰‡fdd„ˆDƒ‰tˆƒ‰g}ˆD]†}g}| ¡D]0}|ˆkrhtˆ|ƒrh| ‡fdd„|jDƒ¡qh|sª| |¡qX|jtd d �|D] }|D]}||krÄ| |¡qÄq¼qXtˆ|d �S) zÛCalculates 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. cs|ˆkot|dƒotˆ|ƒS)NÚ__mro__)rerÝ)Útyp)ÚbasesrEr$r%Ú is_relatedâsÿz _compose_mro..is_relatedcsg|]}ˆ|ƒr|‘qSr$r$©rBÚn)r÷r$r%rÓåsz _compose_mro..cs&ˆD]}||kr||jkrdSqdS)NTF)rô)rõr+)Útypesr$r%Úis_strict_baseèsz$_compose_mro..is_strict_basecsg|]}ˆ|ƒs|‘qSr$r$rø)rûr$r%rÓíscsg|]}|ˆkr|‘qSr$r$rÑ)Útype_setr$r%rÓösT)r´Úreverserá)ÚsetrôÚ__subclasses__rÝrÕÚsortr‚rä)rErúÚmrorõÚfoundÚsubÚsubclsr$)rörEr÷rûrürúr%Ú _compose_mroÙs*    rcCstt|| ¡ƒ}d}|D]R}|dk r\||krX||jkrX||jkrXt||ƒsXtd ||¡ƒ‚qj||kr|}q| |¡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 {})rÚkeysrôrÝrÔr‘r›)rEÚregistryrÚmatchÚtr$r$r%Ú _find_impls" ÿþÿr cs”ddl}ddl}i‰| ¡‰d‰‡‡‡fdd„‰d ‡‡‡‡fdd„ ‰‡‡fdd„}t|d d ƒ‰|ˆt<ˆ|_ˆ|_| ˆ¡|_ˆ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 s|ˆdk r"tƒ}ˆ|kr"ˆ ¡|‰z ˆ|}WnHtk rvz ˆ|}Wntk rht|ˆƒ}YnX|ˆ|<YnX|S)zÌgeneric_func.dispatch(cls) -> Runs the dispatch algorithm to return the best available implementation for the given *cls* registered on *generic_func*. N)rrÎÚKeyErrorr )rEÚ current_tokenÚimpl)Ú cache_tokenÚdispatch_cacherr$r%Údispatch.s  z singledispatch..dispatchcs´|dkrˆtˆtƒr ‡‡fdd„Stˆdiƒ}|s@tdˆ›d�ƒ‚ˆ}ddlm}tt||ƒ ¡ƒƒ\}‰tˆtƒsˆtd |›d ˆ›d �ƒ‚|ˆˆ<ˆdkr¨t ˆd ƒr¨t ƒ‰ˆ  ¡|S) zƒgeneric_func.register(cls, func) -> func Registers a new implementation for the given *cls* on a *generic_func*. Ncs ˆˆ|ƒSr@r$)Úf)rEÚregisterr$r%ÚNóz2singledispatch..register..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 is not a class.rÜ) r€rwrr]Útypingrr[rYryrerrÎ)rEr`ÚannrÚargname)rrrrrDr%rEs(   ÿ  ÿz singledispatch..registercs&|stˆ›d�ƒ‚ˆ|djƒ||ŽS)Nz( requires at least 1 positional argumentr)r]ri)raÚkw)rÚfuncnamer$r%rfszsingledispatch..wrapperrzsingledispatch function)N) rúÚweakrefÚWeakKeyDictionaryrrArrÚMappingProxyTyperrÎÚ _clear_cacher)r`rúrrr$)rrrrrrr%r s !   c@s8eZdZdZdd„Zd dd„Zd dd„Zed d „ƒZdS) r z™Single-dispatch generic method descriptor. Supports wrapping existing descriptors and handles non-descriptor callables as instance methods. cCs4t|ƒs t|dƒs t|›d�ƒ‚t|ƒ|_||_dS)NrŒz is not callable or a descriptor)rdrer]r Ú dispatcherr`©r*r`r$r$r%rPs zsingledispatchmethod.__init__NcCs|jj||d�S)z†generic_method.register(cls, func) -> func Registers a new implementation for the given *cls* on a *generic_method*. r¢)rr)r*rEÚmethodr$r$r%r†szsingledispatchmethod.registercs0‡‡‡fdd„}ˆj|_ˆj|_t|ˆjƒ|S)Ncs$ˆj |dj¡}| ˆˆ¡||ŽSrQ)rrrirŒ)raÚkwargsr!©rErNr*r$r%r–Žsz-singledispatchmethod.__get__.._method)r—rrr`)r*rNrEr–r$r#r%rŒ�s  zsingledispatchmethod.__get__cCst|jddƒSržrŸr}r$r$r%r——sz)singledispatchmethod.__isabstractmethod__)N)N) rrrrrPrrŒr¡r—r$r$r$r%r xs   c@s&eZdZdd„Zdd„Zddd„ZdS) r cCs ||_d|_|j|_tƒ|_dSr@)r`ÚattrnamerrrÌr r$r$r%rP¤szcached_property.__init__cCs8|jdkr||_n"||jkr4td|j›d|›d�ƒ‚dS)Nz?Cannot assign the same cached_property to two different names (z and z).)r$r])r*ÚownerÚnamer$r$r%Ú __set_name__ªs   ÿzcached_property.__set_name__Nc Csö|dkr |S|jdkrtdƒ‚z |j}Wn8tk r`dt|ƒj›d|j›d�}t|ƒd‚YnX| |jt¡}|tkrò|j�n| |jt¡}|tkrè|  |¡}z|||j<Wn8tk rædt|ƒj›d|j›d�}t|ƒd‚YnXW5QRX|S)NzGCannot use cached_property instance without calling __set_name__ on it.zNo '__dict__' attribute on z instance to cache z property.zThe '__dict__' attribute on z7 instance does not support item assignment for caching ) r$r]rrrwrr›Ú _NOT_FOUNDrÌr`)r*Úinstancer%rÁÚmsgÚvalr$r$r%rŒ³s2 ÿ ÿ ÿzcached_property.__get__)N)rrrrPr'rŒr$r$r$r%r £s )r·F)N)9rÚ__all__ÚabcrÚ collectionsrÚreprlibrÚ_threadrrrrrr,r.r/r0r3r4r5r8r9r:r=r>r?rGrrÚ _functoolsÚ ImportErrorrArZrr r r£r¹rér©r½Ústrr�rwr‚r¶rr¸rÛrärr r r r(r r$r$r$r%Úsº ý    ý þ             þþþþö AX ý  ,t -)\(