Decorator Template
import functools
# Without arguments
def decorator(func_to_decorate):
@functools.wraps(func_to_decorate):
def wrapper(*args, **kwargs):
# do stuff here
result = func_to_decorate(*args, **kwargs)
# do something after
return result
return wrapper