
    kCi-                         S r SrSSKrSSKrSSKrSSKrSSKJr  SSKJ	r	J
r
JrJrJr  SSKJr  SSKJr   " S	 S
\5      rS rSS jrSS jrSS jrS\R*                  S4S jrSS\R.                  S4S jrg)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                   *    \ rS rSrS r\S 5       rSrg)_UnboundTTLCache   c                 P    [         R                  " U [        R                  X5        g N)r   __init__mathinf)selfttltimers      K/var/www/html/land-ocr/venv/lib/python3.13/site-packages/cachetools/func.pyr   _UnboundTTLCache.__init__   s    $#5    c                     g r    )r   s    r   maxsize_UnboundTTLCache.maxsize   s    r   r    N)__name__
__module____qualname____firstlineno__r   propertyr!   __static_attributes__r    r   r   r   r      s    6  r   r   c                    ^ ^^ U UU4S jnU$ )Nc                    > T(       a  [         R                  O[         R                  n[        TU[	        5       SS9" U 5      nUU4S jUl        U$ )NT)cachekey	conditioninfoc                     > T TS.$ )Nr!   typedr    r0   s   r   <lambda>+_cache.<locals>.decorator.<locals>.<lambda>   s
    w+Or   )r   typedkeyhashkeyr   r   cache_parameters)funcr,   wrapperr+   r!   r1   s      r   	decorator_cache.<locals>.decorator   s9    $dmm$,,u#4PQUV#O r   r    )r+   r!   r1   r9   s   ``` r   _cacher;      s     r      Fc                     U c  [        0 SU5      $ [        U 5      (       a  [        [        S5      SU5      " U 5      $ [        [        U 5      X5      $ )zDecorator to wrap a function with a memoizing callable that saves
up to `maxsize` results based on a First In First Out (FIFO)
algorithm.

Nr<   )r;   callabler
   r0   s     r   r   r   #   sM     b$&&	'		inc51'::i('99r   c                     U c  [        0 SU5      $ [        U 5      (       a  [        [        S5      SU5      " U 5      $ [        [        U 5      X5      $ )zDecorator to wrap a function with a memoizing callable that saves
up to `maxsize` results based on a Least Frequently Used (LFU)
algorithm.

Nr<   )r;   r>   r   r0   s     r   r   r   1   M     b$&&	'		hsmS%099hw'88r   c                     U c  [        0 SU5      $ [        U 5      (       a  [        [        S5      SU5      " U 5      $ [        [        U 5      X5      $ )zDecorator to wrap a function with a memoizing callable that saves
up to `maxsize` results based on a Least Recently Used (LRU)
algorithm.

Nr<   )r;   r>   r   r0   s     r   r   r   ?   r@   r   c                     U c  [        0 SU5      $ [        U 5      (       a  [        [        SU5      SU5      " U 5      $ [        [        X5      X5      $ )zDecorator to wrap a function with a memoizing callable that saves
up to `maxsize` results based on a Random Replacement (RR)
algorithm.

Nr<   )r;   r>   r   )r!   choicer1   s      r   r   r   M   sP     b$&&	'		gc6*C7@@gg.??r   iX  c                     U c  [        [        X5      SU5      $ [        U 5      (       a  [        [        SX5      SU5      " U 5      $ [        [        XU5      X5      $ )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.

Nr<   )r;   r   r>   r   )r!   r   r   r1   s       r   r   r   [   sX     &s2D%@@	'		hsC/e<WEEhwU3WDDr   )r<   F)__doc____all__	functoolsr   randomtime	threadingr    r
   r   r   r   r   r   r   r   r;   r   r   r   rC   r   	monotonicr   r    r   r   <module>rM      sp    E
K      > >  x :99 e @ s$.. Er   