
    .Ph                        d Z ddlmZ ddlmZ ddlmZmZmZ erddl	m	Z	  G d d          Z
 G d d	e
          Z G d
 de
          ZdS )zb
The cache object API for implementing caches. The default is a thread
safe in-memory dictionary.
    )annotations)Lock)IOTYPE_CHECKINGMutableMapping)datetimec                  2    e Zd ZddZ	 dddZddZddZdS )	BaseCachekeystrreturnbytes | Nonec                    t                      NNotImplementedErrorselfr   s     R/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/cachecontrol/cache.pygetzBaseCache.get       !###    Nvaluebytesexpiresint | datetime | NoneNonec                    t                      r   r   r   r   r   r   s       r   setzBaseCache.set   s     "###r   c                    t                      r   r   r   s     r   deletezBaseCache.delete   r   r   c                    d S r    )r   s    r   closezBaseCache.close   s    r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   )__name__
__module____qualname__r   r    r"   r%   r$   r   r   r
   r
      sp        $ $ $ $ HL$ $ $ $ $
$ $ $ $     r   r
   c                  4    e Zd ZdddZdd
Z	 dddZddZdS )	DictCacheN	init_dict!MutableMapping[str, bytes] | Noner   r   c                >    t                      | _        |pi | _        d S r   )r   lockdata)r   r.   s     r   __init__zDictCache.__init__$   s    FF	O			r   r   r   r   c                8    | j                             |d           S r   )r2   r   r   s     r   r   zDictCache.get(   s    y}}S$'''r   r   r   r   r   c                ~    | j         5  | j                            ||i           d d d            d S # 1 swxY w Y   d S r   )r1   r2   updater   s       r   r    zDictCache.set+   s     Y 	+ 	+Ic5\***	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+s   266c                    | j         5  || j        v r| j                            |           d d d            d S # 1 swxY w Y   d S r   )r1   r2   popr   s     r   r"   zDictCache.delete1   s    Y 	# 	#di	c"""	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	#s   $9= =r   )r.   r/   r   r   r&   r'   r(   )r)   r*   r+   r3   r   r    r"   r$   r   r   r-   r-   #   su        $ $ $ $ $( ( ( ( HL+ + + + +# # # # # #r   r-   c                  "    e Zd ZdZddZdd
ZdS )SeparateBodyBaseCacheag  
    In this variant, the body is not stored mixed in with the metadata, but is
    passed in (as a bytes-like object) in a separate call to ``set_body()``.

    That is, the expected interaction pattern is::

        cache.set(key, serialized_metadata)
        cache.set_body(key)

    Similarly, the body should be loaded separately via ``get_body()``.
    r   r   bodyr   r   r   c                    t                      r   r   )r   r   r;   s      r   set_bodyzSeparateBodyBaseCache.set_bodyD   r   r   IO[bytes] | Nonec                    t                      )z6
        Return the body as file-like object.
        r   r   s     r   get_bodyzSeparateBodyBaseCache.get_bodyG   s     "###r   N)r   r   r;   r   r   r   )r   r   r   r>   )r)   r*   r+   __doc__r=   r@   r$   r   r   r:   r:   7   sF        
 
$ $ $ $$ $ $ $ $ $r   r:   N)rA   
__future__r   	threadingr   typingr   r   r   r   r
   r-   r:   r$   r   r   <module>rE      s   
 
 # " " " " "       4 4 4 4 4 4 4 4 4 4 "!!!!!!        # # # # #	 # # #($ $ $ $ $I $ $ $ $ $r   