visitor pattern class temperatureregulator(object)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 doorlock(object)def __init__(selfname)self name name self status self get_status(def get_status(self)return random choice(range(- , )def is_online(self)return self status !- def boot_up(self)pass class coffeemachine(object)def __init__(selfname)self name name self status self get_status(def get_status(self)return random choice(range(- , )def is_online(self)return self status !- def boot_up(self)self status