def debug_decorator(func):
    """ Debug decorator to call the function within the debug context """

def decorated_func(*args, **kwargs):
    with debug_context(func.__name__):
        return_value = func(*args, **kwargs)
return return_value
return decorated_func
Python Decorator for printing every line executed by a function