human
Here's a good function header given the following:
I wrote the below code

    @functools.wraps(fun)
    def wrapper(self):
        if (not wrapper.cache_activated):
            return fun(self)
        else:
            try:
                ret = cache[fun]
            except KeyError:
                ret = cache[fun] = fun(self)
            return ret
    def cache_activate():
        'Activate    cache.'
        wrapper.cache_activated = True
    def cache_deactivate():
        'Deactivate    and    clear    cache.'
        wrapper.cache_activated = False
        cache.clear()
    cache = {}
    wrapper.cache_activated = False
    wrapper.cache_activate = cache_activate
    wrapper.cache_deactivate = cache_deactivate
    return wrapper

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

def memoize_when_activated(fun):