visitor pattern class temperatureregulator(visitable)def __init__(selfname)self name name self status self get_status(def get_status(self)return random choice(['heating''cooling''on''off''error']def is_online(self)return self status !'errordef boot_up(self)self status 'onclass temperatureregulatorstatusupdatevisitor(abstractvisitor)def __init__(selfperson_ _homeperson_ _home)self person_ _home person_ _home self person_ _home person_ _home def visit(selfelement)if self person_ _homeif self person_ _homeelement status 'onelseelement status 'heatingelif self person_ _homeelement status 'coolingelseelement status 'offclass doorlock(visitable)def __init__(selfname)self name name self status self get_status(def get_status(self)return random choice(range(- , )