code: def restore(self, state, permissive=False):
          
  
          self._engine.restore(state.get(u'engine'))
          self._last_values = {DataStream.FromString(stream): IOTileReading.FromDict(reading) for
                               stream, reading in state.get(u"last_values", {}).items()}
  
          self._rollover_storage = state.get(u'rollover_storage', True)
          self._rollover_streaming = state.get(u'rollover_streaming', True)
  
          old_walkers = {DataStreamSelector.FromString(selector): dump for selector, dump in
                         state.get(u"walkers").items()}
  
          for walker in self._virtual_walkers:
              if walker.selector in old_walkers:
                  walker.restore(old_walkers[walker.selector])
              elif not permissive:
                  raise ArgumentError("Cannot restore SensorLog, walker %s exists in restored log but did not exist before" % str(walker.selector))
  
          for walker in self._queue_walkers:
              if walker.selector in old_walkers:
                  walker.restore(old_walkers[walker.selector])
              elif not permissive:
                  raise ArgumentError("Cannot restore SensorLog, walker %s exists in restored log but did not exist before" % str(walker.selector))
docs: Restore a state previously dumped by a call to dump().
  
          The purpose of this method is to be able to restore a previously
          dumped state.  However there are links in the SensorLog for stream
          walkers.
  
          So the restore process looks through the current set of stream walkers
          and restores each one that existed when dump() was called to its
          state.  If there are walkers allocated that were not present when
          dump() was called, an exception is raised unless permissive=True,
          in which case they are ignored.
  
          Args:
              state (dict): The previous state to restore, from a prior call
                  to dump().
              permissive (bool): Whether to raise an exception is new stream
                  walkers are present that do not have dumped contents().
  
          Raises:
              ArgumentError: There are new stream walkers present in the current
                  SensorLog and permissive==False.