>>> 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
>>> undecorated = add
>>> decorated = decorate(add)

#%%

>>> add
<function add at 0x106f04860>
>>> undecorated
<function add at 0x106f04860>
>>> decorated
<function decorate.<locals>.wrapper at 0x106f07a60>

#%%

>>> add(1,2)
3
>>> undecorated(1,2)
3
>>> decorated(1,2)
before
after
3