Update output based just on state
183966
def session_demo_danger_callback(da_children, session_state=None, **kwargs):
    ''
    if not session_state:
        return "Session state not yet available"

    return "Session state contains: " + str(session_state.get('bootstrap_demo_state', "NOTHING")) + " and the page render count is " + str(session_state.get("ind_use", "NOT SET"))
920748
async def update_state(self, name, state):
        

        await self.send_command(OPERATIONS.CMD_UPDATE_STATE,
                                {'name': name, 'new_status': state},
                                MESSAGES.UpdateStateResponse, timeout=5.0)
678952
private void updateStreamState(Map<TaskStream, WindowState> state) {
        for (Map.Entry<TaskStream, WindowState> entry : state.entrySet()) {
            TaskStream taskStream = entry.getKey();
            WindowState newState = entry.getValue();
            WindowState curState = streamState.get(taskStream);
            if (curState == null) {
                streamState.put(taskStream, newState);
            } else {
                WindowState updatedState = new WindowState(Math.max(newState.lastExpired, curState.lastExpired),
                        Math.max(newState.lastEvaluated, curState.lastEvaluated));
                LOG.debug("Update window state, taskStream {}, curState {}, newState {}", taskStream, curState, updatedState);
                streamState.put(taskStream, updatedState);
            }
        }
    }
1159655
def _setState(self, name, value):
        ""
        d = self.getObjectId()

        @d.addCallback
        def set(objectid):
            return self.db.state.setState(objectid, name, value)
        return d
305244
def change_state(self, state):
        """"""
        if state is not self.state:
            if self.debug:
                self.print_debug(b'state => ' + STATE_NAMES[state].encode())
            if self.state is STATE_NOT_STARTED:
                self.read_in_state_not_started = b''
            self.state = state
269922
async def update_state(self, msg, _context):
        """"""

        name = msg.get('name')
        status = msg.get('new_status')

        await self.service_manager.update_state(name, status)
518161
function update(state, updater, description) {
    if (!state.__store__) {
        throw new Error('[Pastate] You can only operate pastate immutable state');
    }
    return state.__store__.update(state, updater, description);
}
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)
842624
def update_state(self):
        
        response = self.api_interface.get_device_state(self, id_override=self.parent.object_id(),
                                                       type_override=self.parent.object_type())
        self._update_state_from_response(response)
1312886
def state_pop(self):
        ""
        for of in self.output_fns:
            if hasattr(of,'state_pop'):
                of.state_pop()
        super(PatternGenerator, self).state_pop()
1042059
def update(self, input_stats=None):
        """"""
        input_stats = input_stats or {}

        # Force update of all the stats
        super(GlancesStatsServer, self).update()

        # Build all_stats variable (concatenation of all the stats)
        self.all_stats = self._set_stats(input_stats)
435980
def update_state(self):
        
        response = self.api_interface.get_device_state(self, id_override=self.parent_id(),
                                                       type_override=self.parent_object_type())
        self._update_state_from_response(response)
52056
def get_state(self, state):
        """"""
        # Check to see if we have a change request pending; if we do
        # return the value we expect it to change to.
        for data in list(self._send_queue.queue):
            desired_states = data['desired_states']
            for desired_state in desired_states:
                if desired_state['state'] == state:
                    return desired_state['enabled']
        if state == States.FILTER_LOW_SPEED:
            return (States.FILTER.value & self._flashing_states) != 0
        return (state.value & self._states) != 0
850374
def __update_state(self):
    """"""
    # Only if the job was not in a terminal state.
    if self._state.active:
      self._state = self.__get_state_by_id(self.job_config.job_id)
216773
def setChecked(self, state):
        
        super(XLockButton, self).setChecked(state)
        self.updateState()
6033
private void updateState(CmsShellCommandResult result) {

        m_errorCode = result.getErrorCode();
        m_prompt = result.getPrompt();
        m_exitCalled = result.isExitCalled();
        m_hasError = result.hasError();
        m_echo = result.hasEcho();
    }
999950
private void setState(State state) {
    if (this.state != state) {
      this.state = state;
      log.debug("State changed: {}", state);
    }
  }