https://docs.python.org/3/reference/compound_stmts.html#function-definitions
A function definition may be wrapped by one or more decorator expressions. Decorator expressions are evaluated when the function is defined, in the scope that contains the function definition.
# Syntax.
@decorator2(arg)
@decorator1
def func(argument_list):
statements
# This is equivalent to
def func(argument_list):
statements
func = decorator1(func)
func = decorator2(arg)(func)