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 'ondef update_status(selfperson_ _homeperson_ _home)if person_ _homeif person_ _homeself status 'onelseself status 'heatingelif person_ _homeself status 'coolingelseself status 'offclass 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