;i- dZdZddlZddlZddlZddlZddlmZddlm Z m Z m Z m Z m Z ddlmZddlmZGd d e Zd ZddZddZddZd ejd fdZd dejd fdZdS)z?`functools.lru_cache` compatible memoizing function decorators.) fifo_cache lfu_cache lru_cacherr_cache ttl_cacheN) Condition) FIFOCacheLFUCacheLRUCacheRRCacheTTLCache)cached)keysc*eZdZdZedZdS)_UnboundTTLCachecHtj|tj||dSN)r__init__mathinf)selfttltimers CC:\PYTHON\MyICR_Workspace\venv\Lib\site-packages\cachetools/func.pyrz_UnboundTTLCache.__init__s!$#u55555cdSr)rs rmaxsizez_UnboundTTLCache.maxsizestrN)__name__ __module__ __qualname__rpropertyrrrrrrs>666Xrrcfd}|S)Ncr tjn tj}t|t d|}fd|_|S)NT)cachekey conditioninfocdS)Nrtypedrr+srz+_cache..decorator..sw+O+Or)rtypedkeyhashkeyrrcache_parameters)funcr'wrapperr&rr,s r decoratorz_cache..decoratorsS$6dmm$,P&u#4PPPQUVV#O#O#O#O#O rr)r&rr,r3s``` r_cacher4s0 rFc|tid|St|r'ttdd||Stt|||S)zDecorator to wrap a function with a memoizing callable that saves up to `maxsize` results based on a First In First Out (FIFO) algorithm. Nr5)r4callabler r+s rrr#sg b$&&& '  :1vinnc511':::i(('5999rc|tid|St|r'ttdd||Stt|||S)zDecorator to wrap a function with a memoizing callable that saves up to `maxsize` results based on a Least Frequently Used (LFU) algorithm. Nr5)r4r7r r+s rrr1g b$&&& '  90vhsmmS%00999hw''%888rc|tid|St|r'ttdd||Stt|||S)zDecorator to wrap a function with a memoizing callable that saves up to `maxsize` results based on a Least Recently Used (LRU) algorithm. Nr5)r4r7r r+s rrr?r9rc|tid|St|r(ttd|d||Stt||||S)zDecorator to wrap a function with a memoizing callable that saves up to `maxsize` results based on a Random Replacement (RR) algorithm. Nr5)r4r7r )rchoicer,s rrrMsn b$&&& '  @7vgc6**C77@@@ggv..???riXc|tt||d|St|r)ttd||d||Stt|||||S)zDecorator to wrap a function with a memoizing callable that saves up to `maxsize` results based on a Least Recently Used (LRU) algorithm with a per-item time-to-live (TTL) value. Nr5)r4rr7r)rrrr,s rrr[s} &sE22D%@@@ '  ErFs`EE K >>>>>>>>>>>>>>x : : : : 9 9 9 9 9 9 9 9e @ @ @ @s$. E E E E E Er