>>> def decorate(func):
...     def wrapper(*args, **kwargs):
...         print('before')
...         result = func(*args, **kwargs)
...         print('after')
...         return result
...     return wrapper
>>> def add(a, b):
...     return a + b
>>> add = decorate(add) # decorated