save current state and add a new state
965552
def _saveState(self, path):
        """"""
        self.addSession()  # next session
        self._save(str(self.n_sessions), path)
899714
private void pushState(final S state) {
        this.state = state;

        header.setHTML(TEMPLATE.header(currentStep().getTitle()));
        clearError();
        body.showWidget(state); // will call onShow(C) for the current step
        footer.back.setEnabled(state != initialState());
        footer.next
                .setHTML(
                        lastStates().contains(state) ? CONSTANTS.common_label_finish() : CONSTANTS.common_label_next());
    }
472968
def PushState(self, **_):
    """"""
    if self.verbose:
      logging.debug("Storing state %r", self.state)
    self.state_stack.append(self.state)
756674
def store_state(self, state, popl_db=True):
        
        self.state = state
        if popl_db:
            fw_dict = self.get_fw_dict()
            self.append_state_final_result(fw_dict.get('fw_id'),
                                           self.get_local_final_result(),
                                           state)
1012810
def add_object(self, obj):
        ''''''
        state = self.state
        if not obj.layer in state.layers:
            # its a new layer
            state.layers[obj.layer] = {}
        state.layers[obj.layer][obj.key] = obj
        state.need_redraw = True
798257
def addRecordState( self, state ):
        
        curr_state = self.recordState()
        self.setRecordState(curr_state | state)
888847
def store_mo(self, state, new_mo, overwrite=True): #pylint:disable=unused-argument
        
        start, end = self._resolve_range(new_mo)
        if overwrite:
            self.store_overwrite(state, new_mo, start, end)
        else:
            self.store_underwrite(state, new_mo, start, end)
856054
private void setState(int[] nextState)
                    throws StateErrorException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        "setState",
                        new Object[] { nextState,
                                      new Integer(state),
                                      stateNames[state] });

        synchronized (stateLock) {
            previousState = state; // Capture the previous state for dump. 
            state = nextState[state]; // Make the state change.       
        } // synchronized (stateLock)  

        if (state == stateError) {
            StateErrorException stateErrorException = new StateErrorException(this, previousState, stateNames[previousState]);
            ObjectManager.ffdc.processException(this, cclass, "setState", stateErrorException, "1:2016:1.34");

            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                trace.exit(this,
                           cclass,
                           "setState",
                           new Object[] { stateErrorException,
                                         new Integer(state),
                                         stateNames[state] });
            throw stateErrorException;
        } // if (state == stateError).  

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this
                       , cclass
                       , "setState"
                       , "state=" + state + "(int) " + stateNames[state] + "(String)"
                            );
    }
94451
def savestate(self, state):
        """"""
        oldstate = np.get_printoptions()
        np.set_printoptions(threshold=1e6)
        try:
            with open(os.path.join(self._directory, 'state.txt'), 'w') as f:
                print_(state, file=f)
        finally:
            np.set_printoptions(**oldstate)
755335
def update(self, state, tnow):
        ''''''
        self.state = state
        self.update_time = tnow
1025436
public void saveState (Path dir, State state) throws IOException {
    saveState(this.fs, dir, state);
  }
76898
def save_state(self):
        
        state = {
            'hazard': self.hazard_layer_combo.currentText(),
            'exposure': self.exposure_layer_combo.currentText(),
            'aggregation': self.aggregation_layer_combo.currentText(),
            'report': self.results_webview.page().currentFrame().toHtml()}
        self.state = state
365576
def add(self, action):
        """"""
        self._state_machine.transition_to_add()
        self._actions.append(action)
1235258
def update_state
      current_state.dup.tap do |s|
        src = eval_parameter :src
        s[src] = next_state s[src]
      end
    end
64816
def on_save_as(self):
        
        self.tabWidget.save_current_as()
        self._update_status_bar(self.tabWidget.current_widget())
945424
def _save_state(self, state_file, last_pk):
        """"""
        fp = open(state_file, 'w+')
        try:
            fp.write(str(last_pk))
        finally:
            fp.close()
682851
function createTodo(state: State, text: ?string): State {
  if (!text) {
    return state;
  }
  var newTodo = new Todo(text);
  return state.set(newTodo.id, newTodo);
}