import functools


def ambiguous(decorator):
    """ Decorator to allow the decorated function to be called with or without
        parenthesis. Should only be used to decorate other decorator defintions"""

    @functools.wraps(decorator)
    def wrapper(*args, **kwargs):
        if len(args) > 0:
            f = args[0]
        else:
            f = None

        if callable(f):
            return decorator()(f)  # pass the function to be decorated
        else:
            return decorator(*args, **kwargs)  # pass the specified params

    return wrapper