human
I wrote the below code

    @wraps(decorator)
    def wrapper(*args, **kwargs):
        def dec(f):
            return decorator(f, *args, **kwargs)
        is_decorating = ((not kwargs) and (len(args) == 1) and callable(args[0]))
        if is_decorating:
            f = args[0]
            args = []
            return dec(f)
        else:
            return dec
    return wrapper

What's a good function header?

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

def optional_args(decorator):