human
I wrote the below code

    @functools.wraps(function)
    def wrapper(*args, **kwargs):
        args = list(args)
        offset = 1
        if ('prefix' in kwargs):
            kwargs['prefix'] = name_or_value(kwargs['prefix'])
        elif ((len(args) - 1) >= offset):
            args[offset] = name_or_value(args[offset])
            offset += 1
        if ('key' in kwargs):
            kwargs['key'] = name_or_value(kwargs['key'])
        elif ((len(args) - 1) >= offset):
            args[offset] = name_or_value(args[offset])
        return function(*tuple(args), **kwargs)
    return wrapper

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

def sanitize_prefix(function):