grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026o ®û|j¼”ã@sÐdZgd¢ZddlmZddlmZddlmZddlm Z ddl m Z dZ d Z e e fd d „Ze e fd d „Zefdd„Zefdd„Zefdd„Zefdd„Zefdd„Zefdd„Zefdd„Zefdd„Zefdd„Zefd d!„Zefd"d#„Zefd$d%„Zd&efd'efd(efgd(efd)efd&efgd)efd(efd'efgd'efd&efd)efgd*œZd+d,„Zd-d.„Zzdd/l mZWn e!yÂYnwe"ƒZ#e#fd0d1„Z$zdd2l m$Z$Wn e!yÝYnwGd3d4„d4ƒZ%zdd5l m%Z%Wn e!yöYnwGd6d7„d7e"ƒZ&d8d9„Z'ed:gd;¢ƒZ(Gdd?„Z0dXdBdC„Z1dDdE„Z2zddFl m2Z2Wn e!�y;YnwdGdH„Z3dIdJ„Z4dYdLdM„Z5dNdO„Z6dPdQ„Z7dRdS„Z8GdTdU„dUƒZ9e"ƒZ:GdVdW„dWƒZ;dKS)ZzEfunctools.py - Tools for working with functions and callable objects )Úupdate_wrapperÚwrapsÚWRAPPER_ASSIGNMENTSÚWRAPPER_UPDATESÚtotal_orderingÚcacheÚ cmp_to_keyÚ lru_cacheÚreduceÚpartialÚ partialmethodÚsingledispatchÚsingledispatchmethodÚcached_propertyé)Úget_cache_token)Ú namedtuple)Úrecursive_repr)ÚRLock)Ú GenericAlias)Ú __module__Ú__name__Ú __qualname__Ú__doc__Ú__annotations__)Ú__dict__c Csd|D]}zt||ƒ}Wn tyYqwt|||ƒ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&ú0/opt/alt/python310/lib64/python3.10/functools.pyr#s ÿrcCstt|||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(). ©r!r"r#)r rr(r&r&r'rAs ÿrcCó*t|ƒ ||¡}||ur|S| o||kS)zIReturn a > b. Computed by @total_ordering from (not a < b) and (a != b).©ÚtypeÚ__lt__©ÚselfÚotherÚNotImplementedÚ op_resultr&r&r'Ú _gt_from_ltYór2cCó(t|ƒ ||¡}||ur|S|p||kS)zEReturn a <= b. Computed by @total_ordering from (a < b) or (a == b).r*r-r&r&r'Ú _le_from_lt`ó r5cCó"t|ƒ ||¡}||ur|S| S)z=Return a >= b. Computed by @total_ordering from (not a < b).r*r-r&r&r'Ú _ge_from_ltgór8cCó*t|ƒ ||¡}||ur|S| p||kS)zJReturn a >= b. Computed by @total_ordering from (not a <= b) or (a == b).©r+Ú__le__r-r&r&r'Ú _ge_from_lenr3r=cCó(t|ƒ ||¡}||ur|S|o||kS)zFReturn a < b. Computed by @total_ordering from (a <= b) and (a != b).r;r-r&r&r'Ú _lt_from_leur6r?cCr7)z=Return a > b. Computed by @total_ordering from (not a <= b).r;r-r&r&r'Ú _gt_from_le|r9r@cCr))zIReturn a < b. Computed by @total_ordering from (not a > b) and (a != b).©r+Ú__gt__r-r&r&r'Ú _lt_from_gtƒr3rCcCr4)zEReturn a >= b. Computed by @total_ordering from (a > b) or (a == b).rAr-r&r&r'Ú _ge_from_gtŠr6rDcCr7)z=Return a <= b. Computed by @total_ordering from (not a > b).rAr-r&r&r'Ú _le_from_gt‘r9rEcCr:)zJReturn a <= b. Computed by @total_ordering from (not a >= b) or (a == b).©r+Ú__ge__r-r&r&r'Ú _le_from_ge˜r3rHcCr>)zFReturn a > b. Computed by @total_ordering from (a >= b) and (a != b).rFr-r&r&r'Ú _gt_from_geŸr6rIcCr7)z=Return a < b. Computed by @total_ordering from (not a >= b).rFr-r&r&r'Ú _lt_from_ge¦r9rJrBr<rGr,)r,r<rBrGcsV‡fdd„tDƒ}|stdƒ‚t|ƒ}t|D]\}}||vr(||_tˆ||ƒqˆS)z6Class decorator that fills in missing ordering methodscs(h|]}tˆ|dƒtt|dƒur|’qS©N)rÚobject)Ú.0Úop©Úclsr&r'Ú ¿s(z!total_ordering..z6must define at least one ordering operation: < > <= >=)Ú_convertÚ ValueErrorÚmaxrr)rPÚrootsÚrootÚopnameÚopfuncr&rOr'r¼s €rcsG‡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 ||_dSrK©rY)r.rYr&r&r'Ú__init__Òs zcmp_to_key..K.__init__csˆ|j|jƒdkS©NrrZ©r.r/©Úmycmpr&r'r,Ôózcmp_to_key..K.__lt__csˆ|j|jƒdkSr\rZr]r^r&r'rBÖr`zcmp_to_key..K.__gt__csˆ|j|jƒdkSr\rZr]r^r&r'Ú__eq__Ør`zcmp_to_key..K.__eq__csˆ|j|jƒdkSr\rZr]r^r&r'r<Úr`zcmp_to_key..K.__le__csˆ|j|jƒdkSr\rZr]r^r&r'rGÜr`zcmp_to_key..K.__ge__N) rrrÚ __slots__r[r,rBrar<rGÚ__hash__r&r^r&r'ÚKÐs     rd)rL)r_rdr&r^r'rÎsr)rcCsRt|ƒ}|turzt|ƒ}Wntytdƒd‚w|}|D]}|||ƒ}q|S)aÐ reduce(function, iterable[, initial]) -> value Apply a function of two arguments cumulatively to the items of a sequence or iterable, from left to right, so as to reduce the iterable 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 iterable in the calculation, and serves as a default when the iterable is empty. z0reduce() of empty iterable with no initial valueN)ÚiterÚ_initial_missingÚnextÚ StopIterationÚ TypeError)ZfunctionZsequenceÚinitialÚitr%Zelementr&r&r'r ís   ÿÿÿ r )r csJeZdZdZdZ‡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__cs^t|ƒstdƒ‚t|dƒr|j|}i|j¥|¥}|j}tt|ƒ |¡}||_||_||_|S)Nz#the first argument must be callablerl) ÚcallableriÚhasattrrmrnrlÚsuperr Ú__new__)rPrlrmrnr.©Ú __class__r&r'rss  zpartial.__new__cOs*i|j¥|¥}|jg|j¢|¢Ri|¤ŽSrK©rnrlrm)r.rmrnr&r&r'Ú__call__+szpartial.__call__cCs‚t|ƒj}t|jƒg}| dd„|jDƒ¡| dd„|j ¡Dƒ¡t|ƒjdkr6d|›dd  |¡›d�S|›dd  |¡›d�S) Ncss�|]}t|ƒVqdSrK)Úrepr)rMÚxr&r&r'Ú 3ó€z#partial.__repr__..css"�|] \}}|›d|›�VqdS)ú=Nr&©rMÚkÚvr&r&r'rz4s€ Ú functoolsz functools.ú(ú, ú)) r+rrxrlÚextendrmrnÚitemsrÚjoin)r.Úqualnamermr&r&r'Ú__repr__/s  zpartial.__repr__cCs*t|ƒ|jf|j|j|jpd|jpdffSrK)r+rlrmrnr©r.r&r&r'Ú __reduce__9sÿzpartial.__reduce__cCsÌt|tƒs tdƒ‚t|ƒdkrtdt|ƒ›�ƒ‚|\}}}}t|ƒr9t|tƒr9|dur0t|tƒr9|dur=t|tƒs=tdƒ‚t|ƒ}|durHi}n t|ƒturRt|ƒ}|durXi}||_||_||_ ||_ dS)Nz(argument to __setstate__ must be a tupleézexpected 4 items in state, got zinvalid partial state) Ú isinstanceÚtupleriÚlenrpÚdictr+rrlrmrn)r.ÚstaterlrmÚkwdsÚ namespacer&r&r'Ú __setstate__=s(     zpartial.__setstate__) rrrrrbrsrwrrˆrŠr“Ú __classcell__r&r&rtr'r s   r )r c@sFeZdZdZdd„Zdd„Zdd„Zd d d „Zed d „ƒZ e e ƒZ dS)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. cOsht|ƒst|dƒstd |¡ƒ‚t|tƒr)|j|_|j||_i|j¥|¥|_dS||_||_||_dS)NÚ__get__z${!r} is not callable or a descriptor) rprqriÚformatrŒr rlrmrn)r.rlrmrnr&r&r'r[csÿ   zpartialmethod.__init__cCsNd tt|jƒ¡}d dd„|j ¡Dƒ¡}d}|j|jj|jj |j ||d�S)Nr‚css �|] \}}d ||¡VqdS)z{}={!r}N)r–r}r&r&r'rzxs€ÿz)partialmethod.__repr__..z*{module}.{cls}({func}, {args}, {keywords}))ÚmodulerPrlrmrn) r†Úmaprxrmrnr…r–rurrrl)r.rmrnÚ format_stringr&r&r'rˆvs ÿ üzpartialmethod.__repr__cs‡fdd„}ˆj|_ˆ|_|S)Ncs,iˆj¥|¥}ˆj|gˆj¢|¢Ri|¤ŽSrKrv)Ú cls_or_selfrmrnr‰r&r'Ú_method‚sz3partialmethod._make_unbound_method.._method)Ú__isabstractmethod__Ú_partialmethod)r.r›r&r‰r'Ú_make_unbound_method�s z"partialmethod._make_unbound_methodNcCs„t|jddƒ}d}|dur4|||ƒ}||jur4t|g|j¢Ri|j¤Ž}z|j|_Wn ty3Ynw|dur@| ¡ ||¡}|S)Nr•) rrlr rmrnÚ__self__rržr•)r.rYrPÚgetÚresultÚnew_funcr&r&r'r•‰s    ÿzpartialmethod.__get__cCót|jddƒS©NrœF©rrlr‰r&r&r'rœœóz"partialmethod.__isabstractmethod__rK) rrrrr[rˆržr•ÚpropertyrœÚ classmethodrÚ__class_getitem__r&r&r&r'r [s   r cCst|tƒr |j}t|tƒs|SrK)rŒr rl©rlr&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…<||ƒ|_dSrK©r²)r.ÚtupÚhashr&r&r'r[¹s z_HashedSeq.__init__cCs|jSrKr³r‰r&r&r'rc½sz_HashedSeq.__hash__N)rrrrrbrµr[rcr&r&r&r'r±°s   r±c sš|}|r||7}| ¡D]} || 7}q |r7||‡fdd„|Dƒƒ7}|r3||‡fdd„| ¡Dƒƒ7}t|ƒS||ƒdkrIˆ|dƒ|vrI|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. c3ó�|]}ˆ|ƒVqdSrKr&©rMr©r+r&r'rzØr{z_make_key..c3r¶rKr&r·r¸r&r'rzÚr{ér)r…Úvaluesr±) rmr‘ÚtypedÚkwd_markÚ fasttypesr�r+rŽÚkeyÚitemr&r¸r'Ú _make_keyÀs  þrÀé€Fcs~tˆtƒr ˆdkr d‰n*tˆƒr.tˆtƒr.ˆd}‰t|ˆˆtƒ}‡‡fdd„|_t||ƒSˆdur6tdƒ‚‡‡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: https://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU) rrÁcó ˆˆdœS©N©r¯r»r&r&rÄr&r'Úó zlru_cache..Nz=Expected first argument to be an integer, a callable, or Nonecs(t|ˆˆtƒ}‡‡fdd„|_t||ƒS)NcrÂrÃr&r&rÄr&r'rÅrÆz8lru_cache..decorating_function..)Ú_lru_cache_wrapperÚ _CacheInfoÚcache_parametersr)Ú user_functionr rÄr&r'Údecorating_functions z&lru_cache..decorating_function) rŒÚintrpÚboolrÇrÈrÉrri)r¯r»rÊr rËr&rÄr'rßs €  ÿrcsòtƒ‰t‰ d\‰‰‰‰i‰d‰ ‰ d‰ˆj‰ˆj‰tƒ‰ g‰ˆˆddgˆdd…<ˆ dkr4‡ ‡fdd„}n'ˆ durF‡‡‡ ‡ ‡ ‡‡‡fdd„}n‡‡‡‡‡‡‡‡‡ ‡ ‡ ‡ ‡ ‡‡‡fdd„}‡‡‡ ‡ ‡ ‡ fdd „}‡‡‡ ‡ ‡ ‡fd d „}||_||_|S) N)rr¹éérFcsˆd7‰ˆ|i|¤Ž}|S©Nr¹r&)rmr‘r¡)r®rÊr&r'r sz#_lru_cache_wrapper..wrappercsLˆ||ˆƒ}ˆ|ˆƒ}|ˆurˆd7‰|Sˆd7‰ˆ|i|¤Ž}|ˆ|<|SrÐr&)rmr‘r¾r¡)rÚ cache_getr­Úmake_keyr®Úsentinelr»rÊr&r'r 's  c sŽˆ ||ˆƒ}ˆ �Cˆ|ƒ}|dur@|\}}}}||ˆ<||ˆ<ˆ ˆ}||ˆ<ˆ ˆ<||ˆ<ˆ |ˆ<ˆd7‰|WdƒSˆ d7‰ Wdƒn1sNwYˆ|i|¤Ž}ˆ �a|ˆvrbnKˆrŠˆ } || ˆ<|| ˆ<| ˆ‰ ˆ ˆ} ˆ ˆ} dˆ ˆ<ˆ ˆ<ˆ| =| ˆ|<n+ˆ ˆ}|ˆ ||g}||ˆ<ˆ ˆ<ˆ|<ˆƒˆ k‰Wdƒ|SWdƒ|SWdƒ|S1sÀwY|SrÐr&) rmr‘r¾ÚlinkZ link_prevZ link_nextZ_keyr¡ZlastZoldrootZoldkeyZ oldresult)ÚKEYÚNEXTÚPREVÚRESULTrrÑÚ cache_lenÚfullr­ÚlockrÒr¯r®rVr»rÊr&r'r 6sX  ô ó    Ý$â ú$÷ å$Ü$cs8ˆ�ˆˆˆˆˆƒƒWdƒS1swYdS)zReport cache statisticsNr&r&)rÈrÙr­rÛr¯r®r&r'Ú cache_infoos$ÿz&_lru_cache_wrapper..cache_infocsRˆ�ˆ ¡ˆˆddgˆdd…<d‰‰d‰WdƒdS1s"wYdS)z$Clear the cache and cache statisticsNrF)Úclearr&)rrÚr­rÛr®rVr&r'Ú cache_clearts "üz'_lru_cache_wrapper..cache_clear)rLrÀr Ú__len__rrÜrÞ)rÊr¯r»rÈr rÜrÞr&)rÕrÖr×rØrÈrrÑrÙrÚr­rÛrÒr¯r®rVrÓr»rÊr'rÇ s* *9 rÇ)rÇcCstdd�|ƒS)z@Simple lightweight unbounded cache. Sometimes called "memoize".N)r¯)r)rÊr&r&r'r‹r¦rcCsŒg} dd„|Dƒ}|s|S|D]}|d}|D]}||dd…vr&d}nqnq|dur2tdƒ‚| |¡|D] }|d|krD|d=q9q)z�Merges MROs in *sequences* to a single MRO using the C3 algorithm. Adapted from https://www.python.org/download/releases/2.3/mro/. TcSsg|]}|r|‘qSr&r&©rMÚ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ƒ|}nqd}ˆr"tˆƒng‰t|jd|…ƒ}g}t|j|d…ƒ}ˆD]‰t|ˆƒrRt‡fdd„|jDƒƒsR| ˆ¡q:|D]‰ˆ  ˆ¡qU‡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|ˆƒVqdSrK)Ú issubclass)rMÚb)Úbaser&r'rzËs€  ÿz_c3_mro..cóg|]}t|ˆd�‘qS©©Úabcs©Ú_c3_mro©rMrîrñr&r'râÓóz_c3_mro..crïrðrórõrñr&r'râÔröcrïrðrórõrñr&r'râÕrö) Ú enumerateÚreversedÚ __bases__rqrŽÚlistrìÚanyräÚremoverê) rPròÚiÚboundaryÚexplicit_basesÚabstract_basesÚ other_basesÚexplicit_c3_mrosÚabstract_c3_mrosÚ other_c3_mrosr&)ròrîr'rô¯sH þÿ € ÿÿÿþþþÿrôcsìtˆjƒ‰‡‡fdd„‰‡fdd„ˆDƒ‰‡fdd„‰‡fdd„ˆDƒ‰tˆƒ‰g}ˆD]C}g}| ¡D]}|ˆvrLtˆ|ƒrL| ‡fdd„|jDƒ¡q4|sU| |¡q,|jtd d �|D]}|D] }||vrm| |¡qbq^q,tˆ|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(|ˆvot|dƒot|tƒ otˆ|ƒS)NÚ__mro__)rqrŒrrì)Útyp)ÚbasesrPr&r'Ú is_relatedås  ÿþz _compose_mro..is_relatedcsg|]}ˆ|ƒr|‘qSr&r&©rMÚn)rr&r'râéröz _compose_mro..cs&ˆD]}||kr||jvrdSqdS)NTF)r)rr/)Útypesr&r'Úis_strict_baseìs €z$_compose_mro..is_strict_basecsg|]}ˆ|ƒs|‘qSr&r&r )r r&r'râñröcsg|]}|ˆvr|‘qSr&r&rà)Útype_setr&r'râúröT)r¾Úreverserñ)ÚsetrÚ__subclasses__rìräÚsortrŽrô)rPr ÚmrorÚfoundÚsubÚsubclsr&)rrPrr r r r'Ú _compose_mroÜs2   €  €þÿ rcCstt|| ¡ƒ}d}|D])}|dur.||vr,||jvr,||jvr,t||ƒs,td ||¡ƒ‚n||vr4|}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Úkeysrrìrãr–r )rPÚregistryrÚmatchÚtr&r&r'Ú _find_impls   ÿÿ€ rcsžddl}ddl}i‰| ¡‰d‰‡‡‡fdd„‰dd„‰d ‡‡‡‡‡fdd„ ‰‡‡fd d „}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 sxˆdurtƒ}ˆ|krˆ ¡|‰zˆ|}W|Sty;zˆ|}Wnty3t|ˆƒ}Ynw|ˆ|<Y|Sw)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)rPÚ current_tokenÚimpl)Ú cache_tokenÚdispatch_cacherr&r'Údispatch2s"  ú  ÿ úz singledispatch..dispatchcSst|tƒo t|tƒ SrK)rŒr+rrOr&r&r'Ú_is_valid_dispatch_typeIsz/singledispatch.._is_valid_dispatch_typecsʈˆƒr|dur‡‡fdd„Sn?|durtdˆ›d�ƒ‚tˆdiƒ}|s,tdˆ›d�ƒ‚ˆ}d d lm}tt||ƒ ¡ƒƒ\}‰ˆˆƒsOtd |›d ˆ›d�ƒ‚|ˆˆ<ˆdur_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 ˆˆ|ƒSrKr&)Úf)rPÚregisterr&r'rÅUrÆz2singledispatch..register..z(Invalid first argument to `register()`. z is not a class.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. rë) rirÚtypingr%rgrer…rqrrÝ)rPrlÚannr%Úargname)r"rr r$rrOr'r$Ls:ÿÿÿ  ÿ ÿÿz singledispatch..registercs*|s tˆ›d�ƒ‚ˆ|djƒ|i|¤ŽS)Nz( requires at least 1 positional argumentr)riru)rmÚkw)r!Úfuncnamer&r'r tszsingledispatch..wrapperrzsingledispatch functionrK) r ÚweakrefÚWeakKeyDictionaryrrLr$r!ÚMappingProxyTyperrÝÚ _clear_cacher)rlr r+r r&)r"rr!r r*r$rr'r s  (   r 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|ƒst|dƒst|›d�ƒ‚t|ƒ|_||_dS)Nr•z is not callable or a descriptor)rprqrir Ú dispatcherrl©r.rlr&r&r'r[�s  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ª)r/r$)r.rPÚmethodr&r&r'r$”szsingledispatchmethod.registercs0‡‡‡fdd„}ˆj|_ˆj|_t|ˆjƒ|S)Ncs(ˆj |dj¡}| ˆˆ¡|i|¤ŽSr\)r/r!rur•)rmÚkwargsr1©rPrYr.r&r'r›œsz-singledispatchmethod.__get__.._method)rœr$rrl)r.rYrPr›r&r3r'r•›s  zsingledispatchmethod.__get__cCr£r¤r¥r‰r&r&r'rœ¥r¦z)singledispatchmethod.__isabstractmethod__rK) rrrrr[r$r•r§rœr&r&r&r'r †s   r c@s.eZdZdd„Zdd„Zddd„ZeeƒZdS) rcCs ||_d|_|j|_tƒ|_dSrK)rlÚattrnamerrrÛr0r&r&r'r[²s zcached_property.__init__cCs:|jdur ||_dS||jkrtd|j›d|›d�ƒ‚dS)Nz?Cannot assign the same cached_property to two different names (z and z).)r4ri)r.ÚownerÚnamer&r&r'Ú __set_name__¸s   ÿÿÿÿzcached_property.__set_name__Nc Cs|dur|S|jdurtdƒ‚z|j}Wnty-dt|ƒj›d|j›d�}t|ƒd‚w| |jt¡}|tur†|j�B| |jt¡}|turn|  |¡}z|||j<Wn!tymdt|ƒj›d|j›d�}t|ƒd‚wWdƒ|SWdƒ|S1s�wY|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 ) r4rirrr+rr Ú _NOT_FOUNDrÛrl)r.Úinstancer5rÚmsgÚvalr&r&r'r•ÁsL ÿ  ÿÿ û  ÿÿ ûü ý ù ú ó zcached_property.__get__rK) rrrr[r7r•r¨rr©r&r&r&r'r±s  r)rÁFrK)s°       ý þ            þþþþö ÿ  ÿ A ÿJ  ý .tÿ -*f(