def opt_arguments(func):
    def meta_wrapper(*args, **kwargs):
        if len(args) == 1 and callable(args[0]):
            # No arguments, this is the decorator
            # Set default values for the arguments
            return func(args[0])
        else:
            def meta_func(inner_func):
                return func(inner_func, *args, **kwargs)
            return meta_func
    return meta_wrapper
Meta-decorator for ablity use decorators with optional arguments
dataset/ETHPy150Open ramusus/django-twitter-api/twitter_api/decorators.py/opt_arguments