def get_cache_with_key(keyfunc, cache_name=None):
 def decorator(func):
  @wraps(func)
  def func_with_caching(*args, **kwargs):
   key = keyfunc(*args, **kwargs)
   val = cache_get(key, cache_name=cache_name)
   if (val is not None):
    return val[0]
   raise NotFoundInCache()
  return func_with_caching
 return decorator

def get_cache_with_key ( keyfunc , cache_name = None ) : def decorator ( func ) : @ wraps ( func ) def func_with_caching ( * args , ** kwargs ) : key = keyfunc ( * args , ** kwargs ) val = cache_get ( key , cache_name = cache_name ) if ( val is not None ) : return val [ 0 ] raise NotFoundInCache ( ) return func_with_caching return decorator
the main goal of this function getting value from the cache like in the "cache_with_key" .