decorator pattern the classic implementation of the decorator pattern does not use decorators in the sense that they are available in python once againwe will opt for the more pythonic implementation of the decorator patternand as such we will leverage the power of the built-in syntax for decorators in pythonusing the symbol class_decorated_profiled_ fib py import time class profilingdecorator(object)def __init__(selff)print("profiling decorator initiated"self def __call__(self*args)start_time time time(result self (*argsend_time time time(print("[time elapsed for {}{}format(nend_time start_time)return result @profilingdecorator def fib( )print("inside fib"if return fibprev fib for num in range( )fibprevfib fibfib fibprev return fib if __name__ ="__main__" print("fibonacci number for {}{}format(nfib( ))