visitor pattern one other thing that you should note is that we now import the testcase class from the unittest librarywhich allows us to write tests to make sure thatafter applying the boot sequence to devicethat device is indeed in the state we expect it to be this is not an in-depth tutorial on unit testingbut will be good for you to see so you gain deeper level of comfort with the testing tools available in python import random import unittest class light(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 class thermostat(object)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