adapter pattern packages and tools available to you you need to extend code you wrote year ago in way that you never consideredwithout the luxury to go back and redo everything you did before every few weeks or monthsyou will realize that you are no longer the programmer you were before--you became better--but you still need to support the projects (and mistakesyou previously made you will need interfaces you do not have you will need adapters sample problem we said that we want an adapterwhenever really we want specific interface that we do not have class whatihave(object)def provided_function_ (self)pass def provided_function_ (self)pass class whatiwant(object)def required_function()pass the first solution that comes to mind is simply changing what we want to fit what we have when you only need to interface with single objectyou are able to do thisbut let' imagine we want to also use second serviceand now we have second interface we could begin by using an if statement to direct the execution to the right interfaceclass client(objectdef __init__(some_object)self some_object some_object def do_something()if self some_object __class__ =whatihaveself some_object provided_function_ (self some_object provided_function_ (else if self some_object __class__ =whatiwantself some_object required_function(elseprint("class of self some_object not recognized"