visitor pattern def main()device_network thermostat("general thermostat")temperatureregulator("thermal regulator")doorlock("front door lock")coffeemachine("coffee machine")light("bedroom light")light("kitchen light")clock("system clock")for device in device_networkprint("{is online\ {}format(device namedevice is_online())if __name__ ="__main__"main(since the simulated response is randomly generatedyou should not expect your output to be an exact match of the one given herebut the general shape of the output should hold general thermostat is onlinetrue thermal regulator is onlinetrue front door lock is onlinetrue coffee machine is onlinefalse bedroom light is onlinefalse kitchen light is onlinetrue system clock is onlinetrue we now want to add boot sequence to turn on all the devices and get them into their initial statelike setting the clock to : starting the coffee machineturning off all the lightsand turning on but not setting any settings on the temperature system we will leave the front door in the state that it is in since we are now becoming interested in the actual state of the systemwe will remove the get_status method and instead set status attribute to random value in the __init__(method