human
I wrote the below code

    def wrap(f):
        if tables_cache:
            def wrapped_f(cls, *args, **kwargs):
                cache_key = key(*args, **kwargs)
                o = tables_cache.get(cache_key)
                if ((not kwargs['force']) and (o is not None)):
                    return o
                o = f(cls, *args, **kwargs)
                tables_cache.set(cache_key, o, timeout=timeout)
                return o
        else:
            def wrapped_f(cls, *args, **kwargs):
                return f(cls, *args, **kwargs)
        return wrapped_f
    return wrap

What's a good function header?
assistant
#Here's a good function header.

def memoized_func(timeout=(5 * 60), key=view_cache_key):