visitor pattern doorlock("front door lock")coffeemachine("coffee machine")light("bedroom light")clock("system clock")]def test_person_ _not_home_person_ _not_home(self)expected_state mapstrself my_home_system iterable[ status'off' self my_home_system iterable[ status self visitor compositevisitor(falsefalseself my_home_system accept(self visitorretrieved_state sorted([str( statusfor in self my_home_system iterable]self assertequal(retrieved_statesorted(expected_state)def test_person_ _home_person_ _not(self)expected_state mapstrself my_home_system iterable[ status'heating' " :