class_docstr: A cache of multiple CachedObjects, which returns the wrapped the value
  or raises and deletes the CachedObject if the value has expired.
  
  Parameters
  ----------
  cache : dict-like, optional
      An instance of a dict-like object which needs to support at least:
      `__del__`, `__getitem__`, `__setitem__`
      If `None`, than a dict is used as a default.
  
  cleanup : callable, optional
      A method that takes a single argument, a cached object, and is called
      upon expiry of the cached object, prior to deleting the object. If not
      provided, defaults to a no-op.
  
  Examples
  --------
  >>> from pandas import Timestamp, Timedelta
  >>> expires = Timestamp('2014', tz='UTC')
  >>> value = 1
  >>> cache = ExpiringCache()
  >>> cache.set('foo', value, expires)
  >>> cache.get('foo', expires - Timedelta('1 minute'))
  1
  >>> cache.get('foo', expires + Timedelta('1 minute'))
  Traceback (most recent call last):
      ...
  KeyError: 'foo'
class_docstr_tok: ["A","cache","of","multiple","CachedObjects",",","which","returns","the","wrapped","the","value","or","raises","and","deletes","the","CachedObject","if","the","value","has","expired",".","Parameters","--","--","--","--","--","cache",":","dict-like",",","optional","An","instance","of","a","dict-like","object","which","needs","to","support","at","least",":","`","__del__","`",",","`","__getitem__","`",",","`","__setitem__","`","If","`","None","`",",","than","a","dict","is","used","as","a","default",".","cleanup",":","callable",",","optional","A","method","that","takes","a","single","argument",",","a","cached","object",",","and","is","called","upon","expiry","of","the","cached","object",",","prior","to","deleting","the","object",".","If","not","provided",",","defaults","to","a","no-op",".","Examples","--","--","--","--",">",">",">","from","pandas","import","Timestamp",",","Timedelta",">",">",">","expires","=","Timestamp","(","'2014","'",",","tz='UTC","'",")",">",">",">","value","=","1",">",">",">","cache","=","ExpiringCache","(",")",">",">",">","cache.set","(","'foo","'",",","value",",","expires",")",">",">",">","cache.get","(","'foo","'",",","expires","-","Timedelta","(","'","1","minute","'",")",")","1",">",">",">","cache.get","(","'foo","'",",","expires","+","Timedelta","(","'","1","minute","'",")",")","Traceback","(","most","recent","call","last",")",":","...","KeyError",":","'foo","'"]
code: def __init__(self, cache=None, cleanup=lambda value_to_clean: None):
      if cache is not None:
          self._cache = cache
      else:
          self._cache = {}
  
      self.cleanup = cleanup
  
imports: from collections import MutableMapping
  import errno
  from functools import partial
  import os
  import pickle
  from distutils import dir_util
  from shutil import rmtree, move
  from tempfile import mkdtemp, NamedTemporaryFile
  import pandas
  from .compat import PY2
  from .context_tricks import nop_context
  from .paths import ensure_directory
  from .sentinel import sentinel
label_desc: Use image node_id 1 to create a new ExpiringCache object from inherited base classes: object with example: obj = ExpiringCache(cache, cleanup)