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

    def decorating_function(user_function):
        cache = {}
        use_count = defaultdict(Counter)
        @functools.wraps(user_function)
        def wrapper(*args, **kwargs):
            try:
                result = cache[args[0]][args[1]]
            except KeyError:
                if (wrapper.cache_size == maxsize):
                    to_delete = ((maxsize // 10) or 1)
                    for (k1, k2, v) in nsmallest(to_delete, twolvl_iterator(use_count), key=itemgetter(2)):
                        del cache[k1][k2], use_count[k1][k2]
                        if (not cache[k1]):
                            del cache[k1]
                            del use_count[k1]
                    wrapper.cache_size -= to_delete
                result = user_function(*args, **kwargs)
                try:
                    cache[args[0]][args[1]] = result
                except KeyError:
                    cache[args[0]] = {args[1]: result}
                wrapper.cache_size += 1
            finally:
                use_count[args[0]][args[1]] += 1
            return result
        def clear():
            cache.clear()
            use_count.clear()
        def delete(key, inner_key=None):
            if (inner_key is not None):
                try:
                    del cache[key][inner_key]
                    del use_count[key][inner_key]
                    if (not cache[key]):
                        del cache[key]
                        del use_count[key]
                    wrapper.cache_size -= 1
                except KeyError:
                    return False
                else:
                    return True
            else:
                try:
                    wrapper.cache_size -= len(cache[key])
                    del cache[key]
                    del use_count[key]
                except KeyError:
                    return False
                else:
                    return True
        wrapper.clear = clear
        wrapper.cache = cache
        wrapper.delete = delete
       ...

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

def cache2lvl(maxsize=100):