decorator pattern @profile_all_class_methods class domathstuff(object)def fib(self)@profiling_decorator def factorial(self)there you have ityou can now decorate both classes and functions it would be helpful to you if you download and read the flask source code (download form the official websiteuse of decorators to handle routing another package that you may find interesting is the django rest framework (form the official websitep arting shots the decorator pattern differs from both the adapter and facade pattern in that the interface does not changebut new functionality is somehow added soif you have specific piece of functionality that you want to attach to number of functions to alter these functions without changing their interfacea decorator may be the way to go exercises extend the fibonacci function wrapper so it also returns the time elapsed in minutes and hoursprinted "hrs:minutes:seconds millisecondsmake list of ten common cases you can think of in which you could implement decorators read the flask source code and write down every interesting use of decorators you come across