
    `i                     H    d Z dZ G d de          ZefZd Zd Zd Zd ZdS )	z'Key functions for memoizing decorators.)hashkey	methodkeytypedkeytypedmethodkeyc                   X    e Zd ZdZdZej        fdZej        fdZej        fdZd Z	dS )_HashedTuplezA tuple that ensures that hash() will be called no more than once
    per element, since cache decorators will hash the key multiple
    times on a cache miss.  See also _HashedSeq in the standard
    library functools implementation.

    Nc                 <    | j         }| ||           x| _         }|S N)_HashedTuple__hashvalue)selfhash	hashvalues      c/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/cachetools/keys.py__hash__z_HashedTuple.__hash__   s+    $	+/4::5Dy    c                 4    t           || |                    S r	   r   r   otheradds      r   __add__z_HashedTuple.__add__   s    CCe,,---r   c                 4    t           |||                     S r	   r   r   s      r   __radd__z_HashedTuple.__radd__   s    CCt,,---r   c                     i S r	    )r   s    r   __getstate__z_HashedTuple.__getstate__   s    	r   )
__name__
__module____qualname____doc__r
   tupler   r   r   r   r   r   r   r   r      s          K!N     "' . . . . #(- . . . .    r   r   c            	          |rFt          | t          z   t          t          |                                                    z             S t          |           S )z8Return a cache key for the specified hashable arguments.)r   _kwmarkr    sorteditems)argskwargss     r   r   r   %   sI      "D7NU6&,,..3I3I-J-JJKKKD!!!r   c                     t          |i |S )z/Return a cache key for use with cached methods.)r   r   r%   r&   s      r   r   r   .   s    D#F###r   c                  *   |ret          t          |                                                    }t          | t          z   |z             }|t          d |D                       z  }nt          |           }|t          d | D                       z  }|S )z>Return a typed cache key for the specified hashable arguments.c              3   :   K   | ]\  }}t          |          V  d S r	   type).0_vs      r   	<genexpr>ztypedkey.<locals>.<genexpr>9   s,      77AT!WW777777r   c              3   4   K   | ]}t          |          V  d S r	   r+   )r-   r/   s     r   r0   ztypedkey.<locals>.<genexpr><   s(      ''Qa''''''r   )r    r#   r$   r   r"   )r%   r&   sorted_kwargskeys       r   r   r   3   s      !fV\\^^44554'>M9::u777777774  5''$''''''CJr   c                     t          |i |S )z5Return a typed cache key for use with cached methods.)r   r(   s      r   r   r   @   s    T$V$$$r   N)	r   __all__r    r   r"   r   r   r   r   r   r   r   <module>r6      s    - -
@    5   8 /" " "$ $ $

 
 
% % % % %r   