Proceed to the state following the provided one
497444
public static void proceedToNextStateFrom(InstallState prior) {
        InstallState next = getNextInstallState(prior);
        if (next != null) {
            Jenkins.getInstance().setInstallState(next);
        }
    }
1082204
public void moveToState(State state) throws RepositoryBackendException, RepositoryResourceException {
        if (getState() == null) {
            return;
        }
        int counter = 0;
        while (getState() != state) {
            counter++;
            StateAction nextAction = getState().getNextAction(state);
            performLifeCycle(nextAction);
            if (counter >= 10) {
                throw new RepositoryResourceLifecycleException("Unable to move to state " + state +
                                                               " after 10 state transistion attempts. Resource left in state " + getState(), getId(), getState(), nextAction);
            }
        }
    }
382343
public function next()
    {
        $this->state = ($this->state - 1) & $this->modulo;
        $this->limit--;
        if ($this->limit == 0) {
            $this->state = null;
        }
        $this->ext = null;
    }
77820
def PushState(self, **unused_kwargs):
    """"""
    logging.debug('Storing state {0:s}'.format(repr(self.state)))
    self.state_stack.append(self.state)
1043339
def state(self, state: str) -> None:
        """"""
        self._state = state
        for callback in self._callbacks:
            callback()
1334053
function () {
            /*  special case: just retrieve current state  */
            var state_old = _cs.states[this.__state].state;
            if (arguments.length === 0)
                return state_old;

            /*  determine parameters  */
            var params = $cs.params("state", arguments, {
                state:    { pos: 0, req: true,
                            valid: function (s) { return _cs.state_name2idx(s) !== -1; } },
                func:     { pos: 1, def: undefined },
                min:      {         def: undefined },
                max:      {         def: undefined },
                sync:     {         def: false     }
            });

            /*  if requested state is still not reached...  */
            var sOld = this.__state;
            var sNew = _cs.state_name2idx(params.state);
            if (   ( params.min === true && !params.max          && sNew  >  sOld)
                || (!params.min          &&  params.max === true && sNew  <  sOld)
                || ( params.min === true &&  params.max === true && sNew !== sOld)
                || (!params.min          && !params.max          && sNew !== sOld)) {
                var enqueue = true;
                var cid     = this.id();
                var request = {
                    comp:     this,
                    state:    params.state
                };

                /*  handle the params.func callback using await  */
                if (typeof params.func === "function" && _cs.states.length > 1) {
                    this.await({
                        state:     params.state,
                        direction: (sNew > sOld ? "upward" : "downward"),
                        func:      params.func,
                        spool:     _cs.states[1].state /* the first state after "dead" */
                    });
                }
                if (params.sync) {
                    /*  perform new state transition request (synchronously)  */
                    if (_cs.state_progression_single(request))
                        enqueue = false;

                    /*  delete any old transition request  */
                    if (_cs.state_requests[cid])
                        delete _cs.state_requests[cid];
                }
                if (enqueue) {
                    /*  enqueue new state transition request and trigger
                        state transition progression (asynchronously)  */
                    _cs.state_requests[cid] = request;
                    _cs.hook("ComponentJS:state-invalidate", "none", "requests");
                    _cs.state_progression();
                }
            }
            else {
                /*  still run its optional callback function  */
                if (typeof params.func === "function")
                    params.func.call(this, params.state);
            }

            /*  return old (and perhaps still current) state  */
            return state_old;
        }
1144705
function deliver(curr, state, name, value) {
  if (curr.state === STATE_PENDING) {
    curr.state = state;
    /*  [Promises/A+ 2.1.2.1, 2.1.3.1]  */

    curr[name] = value;
    /*  [Promises/A+ 2.1.2.2, 2.1.3.2]  */

    execute(curr);
  }

  return curr;
}
250982
private void switchToBackward() {
        assert(state == State.ITER_CHECK_FWD ||
                (state == State.ITER_IN_FCD_SEGMENT && pos == start) ||
                (state.compareTo(State.IN_NORM_ITER_AT_LIMIT) >= 0 && pos == 0));
        if(state == State.ITER_CHECK_FWD) {
            // Turn around from forward checking.
            limit = pos = iter.getIndex();
            if(pos == start) {
                state = State.ITER_CHECK_BWD;  // Check backward.
            } else {  // pos > start
                state = State.ITER_IN_FCD_SEGMENT;  // Stay in FCD segment.
            }
        } else {
            // Reached the start of the FCD segment.
            if(state == State.ITER_IN_FCD_SEGMENT) {
                // The input text segment is FCD, extend it backward.
            } else {
                // The input text segment needed to be normalized.
                // Switch to checking backward from it.
                if(state == State.IN_NORM_ITER_AT_LIMIT) {
                    iter.moveIndex(start - limit);
                }
                limit = start;
            }
            state = State.ITER_CHECK_BWD;
        }
    }
1084797
def move_forward(self, seconds=None):
        """"""
        self._move(speed=SPEED_MAX, steering=0, seconds=seconds)
582254
def complete(self, text, state):
        """"""
        result = cmd.Cmd.complete(self, text, state)
        if self.argparser_completer:
            self._make_argparser()
            # argparser screws up with internal states, this is the best way to fix it for now
        return result
983201
private void seekNext() {
    if (!needSeek) {
      return;
    }

    // First, iterate all
    if (this.currentIterator != null && this.currentIterator.hasNext()) {
      needSeek = false;
      return;
    }

    // Then, find the next available work unit
    nextWu = null;
    this.currentIterator = null;
    while (nextWu == null && workUnits.hasNext()) {
      nextWu = workUnits.next();
      if (nextWu instanceof MultiWorkUnit) {
        this.currentIterator = ((MultiWorkUnit) nextWu).getWorkUnits().iterator();
        if (!this.currentIterator.hasNext()) {
          nextWu = null;
        }
      }
    }

    needSeek = false;
  }
43867
private void advance() {
        if (current == null || !current.hasNext()) {
            do {
                current = iters.poll();
            } while (current != null && !current.hasNext());
        }
    }
1343374
def switch(self):
        
        self._status = (self._status + 1) % len(self.states)
        self.status(self._status)
725632
public void go() {
		long nextPriority = Long.MIN_VALUE;
		for (Long d : handlers.getPriorities()) {
			if (nextPriority > d) continue;
			AnnotationVisitor visitor = new AnnotationVisitor(d);
			ast.traverse(visitor);
			// if no visitor interested for this AST, nextPriority would be MAX_VALUE and we bail out immediatetly
			nextPriority = visitor.getNextPriority();
			nextPriority = Math.min(nextPriority, handlers.callASTVisitors(ast, d, ast.isCompleteParse()));
		}
	}
420106
def follow_path( steps, past_steps = [] )
      if steps.is_a?( Hash )
        steps.each do |step, next_steps|
          path_to_this_point = [past_steps, step].flatten
          reflection = reflection_for( path_to_this_point ) rescue nil
          if reflection
            follow_path( next_steps, path_to_this_point )
          else
            follow_comparison( next_steps, past_steps, step )
          end
        end
      elsif steps.is_a?( Array ) && steps.length == 2
        if reflection_for( past_steps )
          follow_comparison( steps, past_steps, :id )
        else
          follow_comparison( steps, past_steps[0..-2], past_steps[-1] )
        end
      else
        raise "invalid obligation path #{[past_steps, steps].inspect}"
      end
    end
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());
    }
747774
def step(self):
        """"""
        if self.index >= len(self.tasklist):
            raise TaskError("step(): sequential compound task %s finished" % self)

        self.check_state()

        # Select next task from the set and advance the index
        self.task = self.tasklist[self.index]
        self.index += 1

        return self.runTask(self.task)