python mathex py **add num diff num - partial function is required becausewhen we pass argument to the decorator @printname(prifix='**')then decorator will not find any function argument at first placehence return func(*arg**kwargswill generate error as there is no 'functo solve this problempartial is used which returns the an new functionwith modified parameters newfunc(func printnameprefix prefixdecorators inside the class in previous sectionsdecorators are defined as functions in this sectiondecorators will be defined as class methods class method and instance method decorator in the following codetwo types of decorators are defined inside the class using class method and instance method clsdecorator py from datetime import datetime class datedecorator(object)instance method decorator def instantmethoddecorator(selffunc)def printdate(*args**kwargs)print("instance method decorator at time \ "datetime today()return func(*args**kwargsreturn printdate class method decorator @classmethod def classmethoddecorator(selffunc)def printdate(*args**kwargs)print("class method decorator at time \ "datetime today()return func(*args**kwargsreturn printdate decoratorinstance method datedecorator(@ instantmethoddecorator def add(ab)return + decoratorclass method @datedecorator classmethoddecorator def sub(ab)return - sum add( instance method decorator at time : : diff sub( (continues on next page decorators