code: def check_cache(cache):
      
      if isinstance(cache, BaseCache):
          return cache
      elif cache is False:
          return DictCache()
      elif cache is None:
          return DummyCache()
      else:
          raise ValueError('Provided cache must implement BaseCache')
docs: check if a cache fits esipy needs or not