@better_wraps(decorator)
def wrapper(*args, **kwargs):

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

    def dec(f):
        return decorator(f, *args, **kwargs)
    is_decorating = ((not kwargs) and (len(args) == 1) and isinstance(args[0], Callable))
    if is_decorating:
        f = args[0]
        args = []
        return dec(f)
    else:
        return dec