
    #Yh,                         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dS )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dS )_UnboundTTLCachec                 H    t          j        | t          j        ||           d S N)r   __init__mathinf)selfttltimers      WD:\DownLoads\facial_attendance_system-main\venv311\Lib\site-packages\cachetools/func.pyr   z_UnboundTTLCache.__init__   s!    $#u55555    c                     d S r    )r   s    r   maxsizez_UnboundTTLCache.maxsize   s    tr   N)__name__
__module____qualname__r   propertyr   r   r   r   r   r      s>        6 6 6   X  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+O r   )r   typedkeyhashkeyr   r   cache_parameters)funcr'   wrapperr&   r   r,   s      r   	decoratorz_cache.<locals>.decorator   sS    $6dmm$,P&u#4PPPQUVV#O#O#O#O#O r   r   )r&   r   r,   r3   s   ``` r   _cacher4      s0           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   #   sg     b$&&&	'		 :1vinnc511':::i(('59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   g     b$&&&	'		 90vhsmmS%00999hw''%8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   sn     b$&&&	'		 @7vgc6**C7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22D%@@@	'		 E<vhsC//e<<WEEEhwU33WeD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      s`   E E
K              > > > > > > > > > > > > > >                x     : : : :9 9 9 99 9 9 9 e @ @ @ @ s$. 
E 
E 
E 
E 
E 
Er   