code: def _reset_state_mode(self, state, mode):
          
  
          state.set_mode(mode)
          state.options |= self._state_add_options
          state.options = state.options.difference(self._state_remove_options)
docs: Reset the state mode to the given mode, and apply the custom state options specified with this analysis.
  
          :param state:    The state to work with.
          :param str mode: The state mode.
          :return:         None