design pattern quick reference adapter third_party py class whatihave(object)def provided_function_ (self)pass def provided_function_ (self)pass class whatiwant(object)def required_function()pass adapter py from third_party import whatihave class objectadapter(object)def __init__(selfwhat_i_have)self what_i_have what_i_have def required_function(self)return self what_i_have provided_function_ (def __getattr__(selfattr)everything else is handled by the wrapped object return getattr(self what_i_haveattrdecorator decorator py from functools import wraps def dummy_decorator( )@wraps(fdef wrap_f()print("function to be decorated" __name__print("nested wrapping function"wrap_f __name__return (return wrap_f