
    Eh-                         d Z dZddlZddlZddlZddlZddlmZ ddlm	Z	m
Z
mZmZmZ ddlmZ ddlmZ  G d	 d
e      Zd ZddZddZddZdej*                  dfdZddej.                  dfdZy)z?`functools.lru_cache` compatible memoizing function decorators.)
fifo_cache	lfu_cache	lru_cacherr_cache	ttl_cache    N)	Condition   )	FIFOCacheLFUCacheLRUCacheRRCacheTTLCache)cached)keysc                   "    e Zd Zd Zed        Zy)_UnboundTTLCachec                 P    t        j                  | t        j                  ||       y N)r   __init__mathinf)selfttltimers      k/home/developers/rajanand/mypropertyqr-fmb-refixing-v2/venv/lib/python3.12/site-packages/cachetools/func.pyr   z_UnboundTTLCache.__init__   s    $#u5    c                      y r    )r   s    r   maxsizez_UnboundTTLCache.maxsize   s    r   N)__name__
__module____qualname__r   propertyr   r   r   r   r   r      s    6  r   r   c                       fd}|S )Nc                     rt         j                  nt         j                  } t        |t	               d      |       }fd|_        |S )NT)cachekey	conditioninfoc                       dS )Nr   typedr   r+   s   r   <lambda>z+_cache.<locals>.decorator.<locals>.<lambda>   s    w+O r   )r   typedkeyhashkeyr   r   cache_parameters)funcr'   wrapperr&   r   r,   s      r   	decoratorz_cache.<locals>.decorator   s;    $dmm$,,P&u#4PQUV#O r   r   )r&   r   r,   r3   s   ``` r   _cacher4      s     r      Fc                     | t        i d|      S t        |       r t        t        d      d|      |       S t        t        |       | |      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   )r4   callabler
   r+   s     r   r   r   #   sN     b$&&	'	1vinc51'::i('599r   c                     | t        i d|      S t        |       r t        t        d      d|      |       S t        t        |       | |      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   )r4   r7   r   r+   s     r   r   r   1   N     b$&&	'	0vhsmS%099hw'%88r   c                     | t        i d|      S t        |       r t        t        d      d|      |       S t        t        |       | |      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   )r4   r7   r   r+   s     r   r   r   ?   r9   r   c                     | t        i d|      S t        |       r t        t        d|      d|      |       S t        t        | |      | |      S )zDecorator to wrap a function with a memoizing callable that saves
    up to `maxsize` results based on a Random Replacement (RR)
    algorithm.

    Nr5   )r4   r7   r   )r   choicer,   s      r   r   r   M   sS     b$&&	'	7vgc6*C7@@ggv.??r   iX  c                     | t        t        ||      d|      S t        |       r t        t        d||      d|      |       S t        t        | ||      | |      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   )r4   r   r7   r   )r   r   r   r,   s       r   r   r   [   s_     &sE2D%@@	'	<vhsC/e<WEEhwU3WeDDr   )r5   F)__doc____all__	functoolsr   randomtime	threadingr    r
   r   r   r   r   r   r   r   r4   r   r   r   r<   r   	monotonicr   r   r   r   <module>rF      sp    E
K      > >  x :99 e @ s$.. Er   