I am trying to understand how Python decorators work and tried to do the same thing with different code snippets as below:
Snippet 1:
def my_decorator(