Continue the state machine at first state.
422607
def start(self, request, application, extra_roles=None):
        
        # Get the authentication of the current user
        roles = self._get_roles_for_request(request, application)
        if extra_roles is not None:
            roles.update(extra_roles)

        # Ensure current user is authenticated. If user isn't applicant,
        # leader, delegate or admin, they probably shouldn't be here.
        if 'is_authorised' not in roles:
            return HttpResponseForbidden('<h1>Access Denied</h1>')

        # Go to first state.
        return self._next(request, application, roles, self._first_state)
1367548
def start(self, seconds=300):
        
        if self.state is TimerState.stopped:
            self.compare = time.time() + abs(seconds)
            self.state = TimerState.running
        elif self.state is TimerState.running:
            self.increase(seconds)
1014911
public void start() {
        switch (WORKER_STATE_UPDATER.get(this)) {
            case WORKER_STATE_INIT:
                if (WORKER_STATE_UPDATER.compareAndSet(this, WORKER_STATE_INIT, WORKER_STATE_STARTED)) {
                    workerThread.start();
                }
                break;
            case WORKER_STATE_STARTED:
                break;
            case WORKER_STATE_SHUTDOWN:
                throw new IllegalStateException("cannot be started once stopped");
            default:
                throw new Error("Invalid WorkerState");
        }

        // Wait until the startTime is initialized by the worker.
        while (startTime == 0) {
            try {
                startTimeInitialized.await();
            } catch (InterruptedException ignore) {
                // Ignore - it will be ready very soon.
            }
        }
    }
940826
def _set_master_state(self, state):
        """"""
        if state == 'init':
            self._service_state.update_current_state('init', force=True)
            self.set_state(DevState.INIT)

        elif state == 'on':
            self.set_state(DevState.ON)
            self._service_state.update_current_state('on')
249884
def begin(self, vccstate=SSD1306_SWITCHCAPVCC):
        """"""
        # Save vcc state.
        self._vccstate = vccstate
        # Reset and initialize display.
        self.reset()
        self._initialize()
        # Turn on the display.
        self.command(SSD1306_DISPLAYON)
691234
def set_initial_state(self, initial_state, initial_frames):
    """"""
    self._initial_state = initial_state
    self._initial_frames = initial_frames[:, -1, ...]
    self._should_preprocess_on_reset = False
1343374
def switch(self):
        
        self._status = (self._status + 1) % len(self.states)
        self.status(self._status)
1355675
public StateMachine<T> next(T nextState) throws IllegalStateException {
        Set<T> allowed = transitions.get(currentState);
        checkNotNull(allowed, "No transitions from state " + currentState);
        checkState(allowed.contains(nextState), "Transition not allowed from state " + currentState + " to " + nextState);
        currentState = nextState;
        return this;
    }
595570
def start(self):
        
        # load default input data for the state
        self._root_state.input_data = self._root_state.get_default_input_values_for_state(self._root_state)
        self._root_state.output_data = self._root_state.create_output_dictionary_for_state(self._root_state)
        new_execution_history = self._add_new_execution_history()
        new_execution_history.push_state_machine_start_history_item(self, run_id_generator())
        self._root_state.start(new_execution_history)
100939
public void initialState() {

        commandBuffer.clear();

        Channel currentChannel = this.channel;
        if (currentChannel != null) {

            ChannelFuture close = currentChannel.close();
            if (currentChannel.isOpen()) {
                close.syncUninterruptibly();
            }
        }
    }
991244
def transition_to_execute(self):
        """"""
        assert self.state in [AQStateMachineStates.add]
        self.state = AQStateMachineStates.execute
1128915
public void transition(CopycatServer.State state) {
    checkThread();

    if (this.state != null && state == this.state.type()) {
      return;
    }

    LOGGER.info("{} - Transitioning to {}", cluster.member().address(), state);

    // Close the old state.
    try {
      this.state.close().get();
    } catch (InterruptedException | ExecutionException e) {
      throw new IllegalStateException("failed to close Raft state", e);
    }

    // Force state transitions to occur synchronously in order to prevent race conditions.
    try {
      this.state = createState(state);
      this.state.open().get();
    } catch (InterruptedException | ExecutionException e) {
      throw new IllegalStateException("failed to initialize Raft state", e);
    }

    stateChangeListeners.forEach(l -> l.accept(this.state.type()));
  }
247676
def start(self):
        """"""
        if self.state != STATE_RUNNING:
            conn = self.loop.create_connection(
                lambda: self, self.host, self.port)
            task = self.loop.create_task(conn)
            task.add_done_callback(self.init_done)
            self.state = STATE_STARTING
397944
private StateUpdater createStart(Cursor cursor, SelectorModel model, StateUpdater check, StateUpdater select)
    {
        return (extrp, current) ->
        {
            StateUpdater next = current;
            if (!model.isEnabled())
            {
                next = check;
            }
            else if (model.getSelectionClick() == cursor.getClick())
            {
                checkBeginSelection(cursor, model);
                if (model.isSelecting())
                {
                    next = select;
                }
            }
            return next;
        };
    }
382343
public function next()
    {
        $this->state = ($this->state - 1) & $this->modulo;
        $this->limit--;
        if ($this->limit == 0) {
            $this->state = null;
        }
        $this->ext = null;
    }
487617
def transition_to_execute_complete(self):
        """"""
        assert self.state in [AQStateMachineStates.execute]
        self.state = AQStateMachineStates.execute_complete
391652
def switch(self, first, second):
        """"""
        allowed_states = ['queued', 'stashed']
        if first in self.queue and second in self.queue \
                and self.queue[first]['status'] in allowed_states\
                and self.queue[second]['status'] in allowed_states:

            tmp = self.queue[second].copy()
            self.queue[second] = self.queue[first].copy()
            self.queue[first] = tmp
            self.write()
            return True
        return False