visitor pattern element status " : elif self person_ _homeelement status " : elsepass class compositevisitor(abstractvisitor)def __init__(selfperson_ _homeperson_ _home)self person_ _home person_ _home self person_ _home person_ _home def visit(selfelement)tryc eval("{}statusupdatevisitorformat (element __class__ __name__)exceptprint("visitor for {not foundformat (element __class__ __name__)elsevisitor (self person_ _homeself person_ _homevisitor visit(elementclass myhomesystem(compositevisitable)pass class myhomesystemstatusupdatevisitor(abstractvisitor)def __init__(selfperson_ _homeperson_ _home)self person_ _home person_ _home self person_ _home person_ _home def visit(selfelement)pass class homeautomationboottests(unittest testcase)def setup(self)self my_home_system myhomesystem(thermostat("general thermostat")temperatureregulator("thermal regulator")