decorator pattern fib_ func_profile_me py import time def fib( )if return fibprev fib for num in range( )fibprevfib fibfib fibprev return fib def profile_me(fn)start_time time time(result (nend_time time time(print("[time elapsed for {}{}format(nend_time start_time)return result if __name__ ="__main__" print("fibonacci number for {}{}format(nprofile_me(fibn))whenever we want to get the time it takes to execute functionwe can simply pass the function into the profiling function and then run it as usual this approach does have some limitationssince you must pre-define the parameters you want applied to the timed function yet againpython comes to the rescue by allowing us to also return functions as result instead of calling the functionwe now return the function with the profiling added on base_profiled_ fib py import time def fib( )if return