class_docstr: 'safe' version of the empty (NO) cache decorator.
  
  Unlike other cache decorators, this decorator does not cache.  It is a
  dummy that collects statistics and conforms to the caching interface.  This
  decorator takes an integer tolerance 'tol', equal to the number of decimal
  places to which it will round off floats, and a bool 'deep' for whether the
  rounding on inputs will be 'shallow' or 'deep'.  Note that rounding is not
  applied to the calculation of new results, but rather as a simple form of
  cache interpolation.  For example, with tol=0 and a cached value for f(3.0),
  f(3.1) will lookup f(3.0) in the cache while f(3.6) will store a new value;
  however if tol=1, both f(3.1) and f(3.6) will store new values.
  
  maxsize = maximum cache size [fixed at maxsize=0]
  cache = storage hashmap (default is {})
  keymap = cache key encoder (default is keymaps.stringmap(flat=False))
  ignore = function argument names and indicies to 'ignore' (default is None)
  tol = integer tolerance for rounding (default is None)
  deep = boolean for rounding depth (default is False, i.e. 'shallow')
  purge = boolean for purge cache to archive at maxsize (fixed at True)
  
  If *keymap* is given, it will replace the hashing algorithm for generating
  cache keys.  Several hashing algorithms are available in 'keymaps'. The
  default keymap does not require arguments to the cached function to be
  hashable.  If a hashing error occurs, the cached function will be evaluated.
  
  If the keymap retains type information, then arguments of different types
  will be cached separately.  For example, f(3.0) and f(3) will be treated
  as distinct calls with distinct results.  Cache typing has a memory penalty,
  and may also be ignored by some 'keymaps'.  Here, the keymap is only used
  to look up keys in an associated archive.
  
  If *ignore* is given, the keymap will ignore the arguments with the names
  and/or positional indicies provided. For example, if ignore=(0,), then
  the key generated for f(1,2) will be identical to that of f(3,2) or f(4,2).
  If ignore=('y',), then the key generated for f(x=3,y=4) will be identical
  to that of f(x=3,y=0) or f(x=3,y=10). If ignore=('*','**'), all varargs
  and varkwds will be 'ignored'.  Ignored arguments never trigger a
  recalculation (they only trigger cache lookups), and thus are 'ignored'.
  When caching class methods, it may be useful to ignore=('self',).
  
  View cache statistics (hit, miss, load, maxsize, size) with f.info().
  Clear the cache and statistics with f.clear().  Replace the cache archive
  with f.archive(obj).  Load from the archive with f.load(), and dump from
  the cache to the archive with f.dump().
class_docstr_tok: ["'safe","'","version","of","the","empty","(","NO",")","cache","decorator",".","Unlike","other","cache","decorators",",","this","decorator","does","not","cache",".","It","is","a","dummy","that","collects","statistics","and","conforms","to","the","caching","interface",".","This","decorator","takes","an","integer","tolerance","'tol","'",",","equal","to","the","number","of","decimal","places","to","which","it","will","round","off","floats",",","and","a","bool","'deep","'","for","whether","the","rounding","on","inputs","will","be","'shallow","'","or","'deep","'",".","Note","that","rounding","is","not","applied","to","the","calculation","of","new","results",",","but","rather","as","a","simple","form","of","cache","interpolation",".","For","example",",","with","tol=0","and","a","cached","value","for","f","(","3.0",")",",","f","(","3.1",")","will","lookup","f","(","3.0",")","in","the","cache","while","f","(","3.6",")","will","store","a","new","value",";","however","if","tol=1",",","both","f","(","3.1",")","and","f","(","3.6",")","will","store","new","values",".","maxsize","=","maximum","cache","size","[","fixed","at","maxsize=0","]","cache","=","storage","hashmap","(","default","is","{","}",")","keymap","=","cache","key","encoder","(","default","is","keymaps.stringmap","(","flat=False",")",")","ignore","=","function","argument","names","and","indicies","to","'ignore","'","(","default","is","None",")","tol","=","integer","tolerance","for","rounding","(","default","is","None",")","deep","=","boolean","for","rounding","depth","(","default","is","False",",","i.e",".","'shallow","'",")","purge","=","boolean","for","purge","cache","to","archive","at","maxsize","(","fixed","at","True",")","If","*","keymap","*","is","given",",","it","will","replace","the","hashing","algorithm","for","generating","cache","keys",".","Several","hashing","algorithms","are","available","in","'keymaps","'",".","The","default","keymap","does","not","require","arguments","to","the","cached","function","to","be","hashable",".","If","a","hashing","error","occurs",",","the","cached","function","will","be","evaluated",".","If","the","keymap","retains","type","information",",","then","arguments","of","different","types","will","be","cached","separately",".","For","example",",","f","(","3.0",")","and","f","(","3",")","will","be","treated","as","distinct","calls","with","distinct","results",".","Cache","typing","has","a","memory","penalty",",","and","may","also","be","ignored","by","some","'keymaps","'",".","Here",",","the","keymap","is","only","used","to","look","up","keys","in","an","associated","archive",".","If","*","ignore","*","is","given",",","the","keymap","will","ignore","the","arguments","with","the","names","and\/or","positional","indicies","provided",".","For","example",",","if","ignore=","(","0",",",")",",","then","the","key","generated","for","f","(","1,2",")","will","be","identical","to","that","of","f","(","3,2",")","or","f","(","4,2",")",".","If","ignore=","(","'","y","'",",",")",",","then","the","key","generated","for","f","(","x=3",",","y=4",")","will","be","identical","to","that","of","f","(","x=3",",","y=0",")","or","f","(","x=3",",","y=10",")",".","If","ignore=","(","'","*","'",",","'","*","*","'",")",",","all","varargs","and","varkwds","will","be","'ignored","'",".","Ignored","arguments","never","trigger","a","recalculation","(","they","only","trigger","cache","lookups",")",",","and","thus","are","'ignored","'",".","When","caching","class","methods",",","it","may","be","useful","to","ignore=","(","'self","'",",",")",".","View","cache","statistics","(","hit",",","miss",",","load",",","maxsize",",","size",")","with","f.info","(",")",".","Clear","the","cache","and","statistics","with","f.clear","(",")",".","Replace","the","cache","archive","with","f.archive","(","obj",")",".","Load","from","the","archive","with","f.load","(",")",",","and","dump","from","the","cache","to","the","archive","with","f.dump","(",")","."]
code: def __init__(
      self,
      maxsize=0,
      cache=None,
      keymap=None,
      ignore=None,
      tol=None,
      deep=False,
      purge=True,
  ):
      # if maxsize is not 0: raise ValueError('maxsize cannot be set')
      maxsize = 0  # XXX: allow maxsize to be given but ignored ?
      purge = True  # XXX: allow purge to be given but ignored ?
      if cache is None:
          cache = archive_dict()
      elif type(cache) is dict:
          cache = archive_dict(cache)
  
      if keymap is None:
          keymap = stringmap(flat=False)
      if ignore is None:
          ignore = tuple()
  
      if deep:
          rounded = deep_round
      else:
          rounded = simple_round
      # else: rounded = shallow_round #FIXME: slow
  
      @rounded(tol)
      def rounded_args(*args, **kwds):
          return (args, kwds)
  
      # set state
      self.__state__ = {
          "maxsize": maxsize,
          "cache": cache,
          "keymap": keymap,
          "ignore": ignore,
          "roundargs": rounded_args,
          "tol": tol,
          "deep": deep,
          "purge": purge,
      }
      return
  
imports: from functools import update_wrapper, partial
  from klepto.archives import cache
  from klepto.keymaps import stringmap
  from klepto.tools import CacheInfo
  from klepto.rounding import deep_round, simple_round
  from ._inspect import _keygen
label_desc: Use image node_id 1 to create a new no_cache object from inherited base classes: object with example: obj = no_cache(maxsize, cache, keymap, ignore, tol, deep, purge)