human
I am working on the file "Python/Advancd Python.ipynb".
The first task is:
Decorators
Simple alternative to metaclasses. The '@' indicates the application of decorator.
Can you write Python program for it?
assistant
#Here is the Python program you requested.

@myDecorator
def aFunction():
    print('Inside aFunction')

class my_decorator(object):
    def __init__(self, f):
        print("inside my_decorator.__init__()")
        f()
    def __call__(self):
        print("inside my_decorator.__call__()")

@my_decorator
def aFunction():
    print("inside aFunction()")

# The part before it would run before going to the next statement 
# as we used decorators in which we defined the __init__ function
print("Finished decorating aFunction()")

aFunction()
# Decorators replace the original function object with the __call__