code: def restore_state(self, state):
          
  
          tile_states = state.get('tile_states', {})
  
          for address, tile_state in tile_states.items():
              address = int(address)
              tile = self._tiles.get(address)
              if tile is None:
                  raise DataError("Invalid dumped state, tile does not exist at address %d" % address, address=address)
  
              tile.restore_state(tile_state)
docs: Restore the current state of this emulated device.
  
          Args:
              state (dict): A previously dumped state produced by dump_state.