Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
3 \rzã+@sêdZddddddddd d d g Zyd d lmZWnek rBYnXd dlmZd dlmZd dl m Z d dl m Z d dl mZyd dlmZWn"ek r²Gdd„dƒZYnXdZZd[Zeefdd„Zeefdd„Zefdd„Zefd d!„Zefd"d#„Zefd$d%„Zefd&d'„Zefd(d)„Zefd*d+„Zefd,d-„Zefd.d/„Zefd0d1„Zefd2d3„Z efd4d5„Z!d6efd7efd8efgd8efd9efd6efgd9efd8efd7efgd7efd6e fd9e!fgd:œZ"d;d„Z#dd „d ƒZ%yd d?lm%Z%Wnek �r*YnXGd@d „d e&ƒZ'edAdBdCdDdEgƒZ(GdFdG„dGe)ƒZ*e&ƒfe+e,e-e.dHƒhe/e.e0fdIdJ„Z1d\dMd„Z2dNdO„Z3yd dPlm3Z3Wnek �rºYnXdQdR„Z4d]dSdT„Z5dUdV„Z6dWdX„Z7dYd „Z8dHS)^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é)r)Úget_cache_token)Ú namedtuple)ÚMappingProxyType)ÚWeakKeyDictionary)Úrecursive_repr)ÚRLockc@s eZdZdZdd„Zdd„ZdS)rz/Dummy reentrant lock for builds without threadscCsdS)N©)Úselfrrú!/usr/lib64/python3.6/functools.pyÚ __enter__szRLock.__enter__cCsdS)Nr)rÚexctypeÚexcinstÚexctbrrrÚ__exit__szRLock.__exit__N)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrrrrrsrrrrrÚ__annotations__Ú__dict__c Csnx<|D]4}yt||ƒ}Wntk r,YqXt|||ƒqWx$|D]}t||ƒjt||iƒƒqDW||_|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Úvaluerrrr,s  cCstt|||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 r)r'r(r)rrrrJs cCs$|j|ƒ}||kr|S| o"||kS)zIReturn a > b. Computed by @total_ordering from (not a < b) and (a != b).)Ú__lt__)rÚotherÚNotImplementedÚ op_resultrrrÚ _gt_from_ltbs r0cCs|j|ƒ}|p||kS)zEReturn a <= b. Computed by @total_ordering from (a < b) or (a == b).)r,)rr-r.r/rrrÚ _le_from_ltis r1cCs|j|ƒ}||kr|S| S)z=Return a >= b. Computed by @total_ordering from (not a < b).)r,)rr-r.r/rrrÚ _ge_from_ltns r2cCs$|j|ƒ}||kr|S| p"||kS)zJReturn a >= b. Computed by @total_ordering from (not a <= b) or (a == b).)Ú__le__)rr-r.r/rrrÚ _ge_from_leus r4cCs"|j|ƒ}||kr|S|o ||kS)zFReturn a < b. Computed by @total_ordering from (a <= b) and (a != b).)r3)rr-r.r/rrrÚ _lt_from_le|s r5cCs|j|ƒ}||kr|S| S)z=Return a > b. Computed by @total_ordering from (not a <= b).)r3)rr-r.r/rrrÚ _gt_from_leƒs r6cCs$|j|ƒ}||kr|S| o"||kS)zIReturn a < b. Computed by @total_ordering from (not a > b) and (a != b).)Ú__gt__)rr-r.r/rrrÚ _lt_from_gtŠs r8cCs|j|ƒ}|p||kS)zEReturn a >= b. Computed by @total_ordering from (a > b) or (a == b).)r7)rr-r.r/rrrÚ _ge_from_gt‘s r9cCs|j|ƒ}||kr|S| S)z=Return a <= b. Computed by @total_ordering from (not a > b).)r7)rr-r.r/rrrÚ _le_from_gt–s r:cCs$|j|ƒ}||kr|S| p"||kS)zJReturn a <= b. Computed by @total_ordering from (not a >= b) or (a == b).)Ú__ge__)rr-r.r/rrrÚ _le_from_ge�s r<cCs"|j|ƒ}||kr|S|o ||kS)zFReturn a > b. Computed by @total_ordering from (a >= b) and (a != b).)r;)rr-r.r/rrrÚ _gt_from_ge¤s r=cCs|j|ƒ}||kr|S| S)z=Return a < b. Computed by @total_ordering from (not a >= b).)r;)rr-r.r/rrrÚ _lt_from_ge«s r>r7r3r;r,)r,r3r7r;csZ‡fdd„tDƒ}|stdƒ‚t|ƒ}x.t|D]"\}}||kr0||_tˆ||ƒq0WˆS)z6Class decorator that fills in missing ordering methodscs(g|] }tˆ|dƒtt|dƒk r|‘qS)N)r!Úobject)Ú.0Úop)Úclsrrú Äsz"total_ordering..z6must define at least one ordering operation: < > <= >=)Ú_convertÚ ValueErrorÚmaxrr#)rBÚrootsÚrootÚopnameÚopfuncr)rBrrÁ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 ||_dS)N)rK)rrKrrrÚ__init__×szcmp_to_key..K.__init__csˆ|j|jƒdkS)Nr )rK)rr-)Úmycmprrr,Ùszcmp_to_key..K.__lt__csˆ|j|jƒdkS)Nr )rK)rr-)rMrrr7Ûszcmp_to_key..K.__gt__csˆ|j|jƒdkS)Nr )rK)rr-)rMrrÚ__eq__Ýszcmp_to_key..K.__eq__csˆ|j|jƒdkS)Nr )rK)rr-)rMrrr3ßszcmp_to_key..K.__le__csˆ|j|jƒdkS)Nr )rK)rr-)rMrrr;ászcmp_to_key..K.__ge__N) rrrÚ __slots__rLr,r7rNr3r;Ú__hash__r)rMrrÚKÕs     rQ)r?)rMrQr)rMrrÓs)rcsJeZdZdZdZ‡fdd„Zd d „Zeƒd d „ƒZd d„Z dd„Z ‡Z S)r zSNew function with partial application of the given arguments and keywords. ÚfuncÚargsÚkeywordsr Ú __weakref__csœ|s tdƒ‚t|ƒdkr tdƒ‚|^}}}t|ƒs:tdƒ‚t|ƒ}t|dƒrv|j|}|jjƒ}|j|ƒ|}~|j }t t |ƒj |ƒ}||_ ||_||_|S)Nz1descriptor '__new__' of partial needs an argumentéz*type 'partial' takes at least one argumentz#the first argument must be callablerR) Ú TypeErrorÚlenÚcallableÚtupleÚhasattrrSrTÚcopyr$rRÚsuperr Ú__new__)rSrTrBrRZtmpkwr)Ú __class__rrr^øs(      zpartial.__new__cOs:|s tdƒ‚|^}}|jjƒ}|j|ƒ|j|j|ž|ŽS)Nz2descriptor '__call__' of partial needs an argument)rWrTr\r$rRrS)rSrTrZ newkeywordsrrrÚ__call__s   zpartial.__call__cCs‚t|ƒj}t|jƒg}|jdd„|jDƒƒ|jdd„|jjƒDƒƒt|ƒjdkrld|›ddj |ƒ›d�S|›ddj |ƒ›d�S) Ncss|]}t|ƒVqdS)N)Úrepr)r@Úxrrrú sz#partial.__repr__..css |]\}}|›d|›�VqdS)ú=Nr)r@ÚkÚvrrrrcsÚ functoolsz functools.ú(z, ú)) ÚtyperrarRÚextendrSrTÚitemsrÚjoin)rÚqualnamerSrrrÚ__repr__s  zpartial.__repr__cCs*t|ƒ|jf|j|j|jpd|jp$dffS)N)rjrRrSrTr )rrrrÚ __reduce__#szpartial.__reduce__cCsÔt|tƒstdƒ‚t|ƒdkr0tdt|ƒ›�ƒ‚|\}}}}t|ƒ szt|tƒ sz|dk rft|tƒ sz|dk r‚t|tƒ r‚tdƒ‚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) Ú isinstancerZrWrXrYÚdictrjr rRrSrT)rÚstaterRrSÚkwdsÚ namespacerrrÚ __setstate__'s(    zpartial.__setstate__)rRrSrTr rU) rrrrrOr^r`rrorprwÚ __classcell__rr)r_rr ñs  )r c@s<eZdZdZdd„Zdd„Zdd„Zdd „Zed 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. cOsrt|ƒ r$t|dƒ r$tdj|ƒƒ‚t|tƒr\|j|_|j||_|jj ƒ|_|jj |ƒn||_||_||_dS)NÚ__get__z${!r} is not callable or a descriptor) rYr[rWÚformatrrr rRrSrTr\r$)rrRrSrTrrrrLMs   zpartialmethod.__init__cCsNdjtt|jƒƒ}djdd„|jjƒDƒƒ}d}|j|jj|jj |j ||d�S)Nz, css|]\}}dj||ƒVqdS)z{}={!r}N)rz)r@rerfrrrrccsz)partialmethod.__repr__..z*{module}.{cls}({func}, {args}, {keywords}))ÚmodulerBrRrSrT) rmÚmaprarSrTrlrzr_rrrR)rrSrTÚ format_stringrrrroas  zpartialmethod.__repr__cs‡fdd„}ˆj|_ˆ|_|S)Ncs<ˆjjƒ}|j|ƒ|^}}|fˆjt|ƒ}ˆj||ŽS)N)rTr\r$rSrZrR)rSrTÚ call_keywordsÚ cls_or_selfÚrestÚ call_args)rrrÚ_methodms   z3partialmethod._make_unbound_method.._method)Ú__isabstractmethod__Ú_partialmethod)rr‚r)rrÚ_make_unbound_methodls z"partialmethod._make_unbound_methodc Cs€t|jddƒ}d}|dk rd|||ƒ}||jk rdt|f|jž|jŽ}y |j|_Wntk rbYnX|dkr||jƒj||ƒ}|S)Nry) r!rRr rSrTÚ__self__r"r…ry)rrKrBÚgetÚresultÚnew_funcrrrryws   zpartialmethod.__get__cCst|jddƒS)NrƒF)r!rR)rrrrrƒŠsz"partialmethod.__isabstractmethod__N) rrrrrLror…ryÚpropertyrƒrrrrr Es   Ú 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…<||ƒ|_dS)N)r‘)rÚtupÚhashrrrrLžs z_HashedSeq.__init__cCs|jS)N)r‘)rrrrrP¢sz_HashedSeq.__hash__N)rrrrrOr“rLrPrrrrr�•s r�Nc s˜|}|r*||7}x|jƒD] } || 7}qW|rl||‡fdd„|Dƒƒ7}|r�||‡fdd„|jƒ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|]}ˆ|ƒVqdS)Nr)r@rf)rjrrrc¹sz_make_key..c3s|]}ˆ|ƒVqdS)Nr)r@rf)rjrrrc»sér )rlÚvaluesr�) rSruÚtypedÚkwd_markÚ fasttypesrZrjrXÚkeyÚitemr)rjrÚ _make_key¥s  r›é€Fcs.ˆdk rtˆtƒ rtdƒ‚‡‡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_algorithms#Least_Recently_Used Nz)Expected maxsize to be an integer or Nonecst|ˆˆtƒ}t||ƒS)N)Ú_lru_cache_wrapperÚ _CacheInfor)Ú user_functionr&)rŽr–rrÚdecorating_functionßsz&lru_cache..decorating_function)rrÚintrW)rŽr–r r)rŽr–rrÀscsòtƒ‰t‰ d\‰‰‰‰i‰d‰ ‰ d‰ˆj‰ˆj‰tƒ‰ g‰ˆˆddgˆdd…<ˆ dkrh‡ ‡fdd„}nNˆ dkrŒ‡‡‡ ‡ ‡ ‡‡‡fdd„}n*‡‡‡‡‡‡‡‡‡ ‡ ‡ ‡ ‡ ‡‡‡fd d„}‡‡‡ ‡ ‡ ‡ fd d „}‡‡‡ ‡ ‡ ‡fd d „}||_||_|S)Nr r”rVéFcsˆ||Ž}ˆd7‰|S)Nr”r)rSrurˆ)r�rŸrrr&ös z#_lru_cache_wrapper..wrappercsHˆ||ˆƒ}ˆ|ˆƒ}|ˆk r*ˆd7‰|Sˆ||Ž}|ˆ|<ˆd7‰|S)Nr”r)rSrur™rˆ)ÚcacheÚ cache_getrŒÚmake_keyr�Úsentinelr–rŸrrr&ÿs   c s2ˆ ||ˆƒ}ˆ �fˆ|ƒ}|dk rr|\}}}}||ˆ<||ˆ<ˆ ˆ}||ˆ<ˆ ˆ<||ˆ<ˆ |ˆ<ˆd7‰|SWdQRXˆ||Ž}ˆ �ž|ˆkr–n†ˆræˆ } || ˆ<|| ˆ<| ˆ‰ ˆ ˆ} ˆ ˆ} dˆ ˆ<ˆ ˆ<ˆ| =| ˆ|<n6ˆ ˆ}|ˆ ||g}||ˆ<ˆ ˆ<ˆ|<ˆƒˆ k‰ˆ d7‰ WdQRX|S)Nr”r) rSrur™ÚlinkZ link_prevZ link_nextZ_keyrˆZlastZoldrootZoldkeyZ oldresult)ÚKEYÚNEXTÚPREVÚRESULTr£r¤Ú cache_lenÚfullrŒÚlockr¥rŽr�rHr–rŸrrr&sB      c s ˆ�ˆˆˆˆˆƒƒSQRXdS)zReport cache statisticsNrr)ržr¬rŒr®rŽr�rrÚ cache_infoGsz&_lru_cache_wrapper..cache_infoc s<ˆ�.ˆjƒˆˆddgˆdd…<d‰‰d‰WdQRXdS)z$Clear the cache and cache statisticsNr F)Úclearr)r£r­rŒr®r�rHrrÚ cache_clearLs z'_lru_cache_wrapper..cache_clear)r r”rVr¢)r?r›r‡Ú__len__rr¯r±)rŸrŽr–ržr&r¯r±r)r¨r©rªr«ržr£r¤r¬r­rŒr®r¥rŽr�rHr¦r–rŸrr�ås* *9 r�)r�cCsšg}x�dd„|Dƒ}|s|Sx:|D]2}|d}x$|D]}||dd…kr4d}Pq4WPq"W|dkrhtdƒ‚|j|ƒx|D]}|d|krx|d=qxWqWdS)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|‘qSrr)r@ÚsrrrrCksz_c3_merge..r r”NzInconsistent hierarchy)Ú RuntimeErrorÚappend)Ú sequencesrˆÚs1Ú candidateÚs2ÚseqrrrÚ _c3_mergecs$     r»c s&x8tt|jƒƒD]"\}‰tˆdƒrt|jƒ|}PqWd}ˆrFtˆƒng‰t|jd|…ƒ}g}t|j|d…ƒ}x:ˆD]2‰t|ˆƒrxt‡fdd„|jDƒƒ rx|jˆƒqxWx|D]‰ˆj ˆƒq´W‡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__r Nc3s|]}t|ˆƒVqdS)N)Ú issubclass)r@Úb)Úbaserrrc›sz_c3_mro..csg|]}t|ˆd�‘qS))Úabcs)Ú_c3_mro)r@r¿)rÀrrrC¢sz_c3_mro..csg|]}t|ˆd�‘qS))rÀ)rÁ)r@r¿)rÀrrrC£scsg|]}t|ˆd�‘qS))rÀ)rÁ)r@r¿)rÀrrrC¤s) Ú enumerateÚreversedÚ __bases__r[rXÚlistr½ÚanyrµÚremover») rBrÀÚiÚboundaryÚexplicit_basesÚabstract_basesÚ other_basesÚexplicit_c3_mrosÚabstract_c3_mrosÚ other_c3_mrosr)rÀr¿rrÁ~s(    rÁcsütˆjƒ‰‡‡fdd„‰‡fdd„ˆDƒ‰‡fdd„‰‡fdd„ˆDƒ‰tˆƒ‰g}xšˆD]’}g}x<|jƒD]0}|ˆkrltˆ|ƒrl|j‡fdd„|jDƒƒqlW|s°|j|ƒqZ|jtd d �x,|D]$}x|D]}||krÎ|j|ƒqÎWqÄWqZWtˆ|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__)r[r½)Útyp)ÚbasesrBrrÚ is_related´sz _compose_mro..is_relatedcsg|]}ˆ|ƒr|‘qSrr)r@Ún)rÓrrrC·sz _compose_mro..cs(x"ˆD]}||kr||jkrdSqWdS)NTF)rÐ)rÑr-)ÚtypesrrÚis_strict_baseºs z$_compose_mro..is_strict_basecsg|]}ˆ|ƒs|‘qSrr)r@rÔ)rÖrrrC¿scsg|]}|ˆkr|‘qSrr)r@r³)Útype_setrrrCÈsT)r™Úreverse)rÀ)ÚsetrÐÚ__subclasses__r½rµÚsortrXrÁ)rBrÕÚmrorÑÚfoundÚsubÚsubclsr)rÒrBrÓrÖr×rÕrÚ _compose_mro«s*      ràcCsxt||jƒƒ}d}xZ|D]R}|dk r^||kr\||jkr\||jkr\t||ƒ r\tdj||ƒƒ‚P||kr|}qW|j|ƒ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´rzr‡)rBÚregistryrÜÚmatchÚtrrrÚ _find_implÔs     råcs€i‰tƒ‰d‰‡‡‡fdd„‰d ‡‡‡‡fdd„ ‰‡‡fdd„}t|dd ƒ‰|ˆt<ˆ|_ˆ|_tˆƒ|_ˆj|_t ||ƒ|S) alSingle-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. Ncs|ˆdk r"tƒ}ˆ|kr"ˆjƒ|‰y ˆ|}WnHtk rvy ˆ|}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)r r°ÚKeyErrorrå)rBÚ current_tokenÚimpl)Ú cache_tokenÚdispatch_cacherârrÚdispatchüs  z singledispatch..dispatchcsB|dkr‡‡fdd„S|ˆˆ<ˆdkr6tˆdƒr6tƒ‰ˆjƒ|S)zƒgeneric_func.register(cls, func) -> func Registers a new implementation for the given *cls* on a *generic_func*. Ncs ˆˆ|ƒS)Nr)Úf)rBÚregisterrrÚsz2singledispatch..register..r¼)r[r r°)rBrR)rérêrírâ)rBrrísz singledispatch..registercs&|stˆ›d�ƒ‚ˆ|djƒ||ŽS)Nz( requires at least 1 positional argumentr )rWr_)rSÚkw)rëÚfuncnamerrr&"szsingledispatch..wrapperrzsingledispatch function)N) rr!r?rírërrâr°Ú _clear_cacher)rRr&r)rérërêrðrírârr îs    )rrrrr)r )rœF)N)9rÚ__all__Ú _functoolsrÚ ImportErrorÚabcr Ú collectionsrrÕrÚweakrefrÚreprlibrÚ_threadrrrrrr.r0r1r2r4r5r6r8r9r:r<r=r>rDrrr r?r ržrÅr�r¡ÚstrÚ frozensetrjrZrXr›rr�r»rÁràrår rrrrÚs–                      NN %t -)