visitor pattern class lightstatusupdatevisitor(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 elseelement status elif self person_ _homeelement status elseelement status class thermostat(visitable)def __init__(selfname)self name name self status self get_status(def get_status(self)temp_range [ for in range(- )temp_range append(nonereturn random choice(temp_rangedef is_online(self)return self status is not none def boot_up(self)pass class thermostatstatusupdatevisitor(abstractvisitor)def __init__(selfperson_ _homeperson_ _home)self person_ _home person_ _home self person_ _home person_ _home def visit(selfelement)pass