def merged_cached_query(fn):
 def merge_wrapper(*args, **kwargs):
  queries = fn(*args, **kwargs)
  return MergedCachedQuery(queries)
 return merge_wrapper

def merged_cached_query ( fn ) : def merge_wrapper ( * args , ** kwargs ) : queries = fn ( * args , ** kwargs ) return MergedCachedQuery ( queries ) return merge_wrapper
decorate a function describing a cached query made up of others .