Sets up the execution of the concurrency states dependent on if the state is executed forward of backward.

        :return:
514030
def setup_forward_or_backward_execution(self):
        
        if self.backward_execution:
            # pop the return item of this concurrency state to get the correct scoped data
            last_history_item = self.execution_history.pop_last_item()
            assert isinstance(last_history_item, ReturnItem)
            self.scoped_data = last_history_item.scoped_data
            # get the concurrency item for the children execution historys
            concurrency_history_item = self.execution_history.get_last_history_item()
            assert isinstance(concurrency_history_item, ConcurrencyItem)

        else:  # forward_execution
            self.execution_history.push_call_history_item(self, CallType.CONTAINER, self, self.input_data)
            concurrency_history_item = self.execution_history.push_concurrency_history_item(self, len(self.states))
        return concurrency_history_item
619628
def execute
      return unless @start && @limit
      @next_to_insert = @start
      while @next_to_insert <= @limit
        stride = @throttler.stride
        affected_rows = @connection.update(copy(bottom, top(stride)))

        if @throttler && affected_rows > 0
          @throttler.run
        end

        @printer.notify(bottom, @limit)
        @next_to_insert = top(stride) + 1
        break if @start == @limit
      end
      @printer.end
    end
1209423
def setCurrentIndex(self, index):
        
        if 0 <= index and index < len(self._stack):
            self._blockStack = True
            self._index = index
            self.emitCurrentChanged()
            self._blockStack = False
            return True
        return False
638059
def finalize_backward_execution(self):
        
        # backward_execution needs to be True to signal the parent container state the backward execution
        self.backward_execution = True
        # pop the ConcurrencyItem as we are leaving the barrier concurrency state
        last_history_item = self.execution_history.pop_last_item()
        assert isinstance(last_history_item, ConcurrencyItem)

        last_history_item = self.execution_history.pop_last_item()
        assert isinstance(last_history_item, CallItem)
        # this copy is convenience and not required here
        self.scoped_data = last_history_item.scoped_data
        self.state_execution_status = StateExecutionStatus.WAIT_FOR_NEXT_STATE
        return self.finalize()
466261
def recursively_resume_states(self):
        
        super(ContainerState, self).recursively_resume_states()
        for state in self.states.values():
            state.recursively_resume_states()
919907
def recursively_preempt_states(self):
        
        super(ContainerState, self).recursively_preempt_states()
        # notify the transition condition variable to let the state instantaneously stop
        self._transitions_cv.acquire()
        self._transitions_cv.notify_all()
        self._transitions_cv.release()
        for state in self.states.values():
            state.recursively_preempt_states()
398572
def execute(self):
        
        self._state_machine.transition_to_execute()
        for action in self._actions:
            self._executed_actions.append(action)
            self.execute_with_retries(action, lambda a: a.execute())
        self._state_machine.transition_to_execute_complete()
862157
def recursively_pause_states(self):
        
        super(ContainerState, self).recursively_pause_states()
        for state in self.states.values():
            state.recursively_pause_states()
751833
def _run_active_state_machine(self):
        

        # Create new concurrency queue for root state to be able to synchronize with the execution
        self.__running_state_machine = self.state_machine_manager.get_active_state_machine()
        if not self.__running_state_machine:
            logger.error("The running state machine must not be None")
        self.__running_state_machine.root_state.concurrency_queue = queue.Queue(maxsize=0)

        if self.__running_state_machine:
            self.__running_state_machine.start()

            self.__wait_for_finishing_thread = threading.Thread(target=self._wait_for_finishing)
            self.__wait_for_finishing_thread.start()
        else:
            logger.warning("Currently no active state machine! Please create a new state machine.")
            self.set_execution_mode(StateMachineExecutionStatus.STOPPED)
102439
def step_into(self):
        
        logger.debug("Execution step into ...")
        self.run_to_states = []
        if self.finished_or_stopped():
            self.set_execution_mode(StateMachineExecutionStatus.FORWARD_INTO)
            self._run_active_state_machine()
        else:
            self.set_execution_mode(StateMachineExecutionStatus.FORWARD_INTO)
31561
def _execution(self):
        

        did_start_executing = False

        if self.state == STATE_DEFAULT:
            did_start_executing = True
            self.state = STATE_EXECUTING

        def close():
            if did_start_executing and self.state == STATE_EXECUTING:
                self.state = STATE_DEFAULT

        yield close
        close()
536082
def backward(self, speed=1):
        
        if isinstance(self.enable_device, DigitalOutputDevice):
            if speed not in (0, 1):
                raise ValueError(
                    'backward speed must be 0 or 1 with non-PWM Motors')
        self.enable_device.off()
        self.phase_device.on()
        self.enable_device.value = speed
890350
def _handle_backward_execution_after_child_execution(self):
        
        self.child_state.state_execution_status = StateExecutionStatus.WAIT_FOR_NEXT_STATE
        # the item popped now from the history will be a CallItem and will contain the scoped data,
        # that was valid before executing the child_state
        last_history_item = self.execution_history.pop_last_item()
        assert isinstance(last_history_item, CallItem)
        # copy the scoped_data of the history from the point before the child_state was executed
        self.scoped_data = last_history_item.scoped_data

        # this is a look-ahead step to directly leave this hierarchy-state if the last child_state
        # was executed; this leads to the backward and forward execution of a hierarchy child_state
        # having the exact same number of steps
        last_history_item = self.execution_history.get_last_history_item()
        if last_history_item.state_reference is self:
            last_history_item = self.execution_history.pop_last_item()
            assert isinstance(last_history_item, CallItem)
            self.scoped_data = last_history_item.scoped_data
            self.child_state.state_execution_status = StateExecutionStatus.INACTIVE
            return True
        return False
93100
def update_backward_window(turn_from, tick_from, turn_to, tick_to, updfun, branchd):
    """"""
    if turn_from in branchd:
        for future_state in reversed(branchd[turn_from][:tick_from]):
            updfun(*future_state)
    for midturn in range(turn_from-1, turn_to, -1):
        if midturn in branchd:
            for future_state in reversed(branchd[midturn][:]):
                updfun(*future_state)
    if turn_to in branchd:
        for future_state in reversed(branchd[turn_to][tick_to+1:]):
            updfun(*future_state)
1258519
public static int cudnnPoolingBackward(
        cudnnHandle handle, 
        cudnnPoolingDescriptor poolingDesc, 
        Pointer alpha, 
        cudnnTensorDescriptor yDesc, 
        Pointer y, 
        cudnnTensorDescriptor dyDesc, 
        Pointer dy, 
        cudnnTensorDescriptor xDesc, 
        Pointer x, 
        Pointer beta, 
        cudnnTensorDescriptor dxDesc, 
        Pointer dx)
    {
        return checkResult(cudnnPoolingBackwardNative(handle, poolingDesc, alpha, yDesc, y, dyDesc, dy, xDesc, x, beta, dxDesc, dx));
    }
128701
def execute(self, state: GlobalState):
        
        address = _get_address_from_state(state)
        has_overflow = self._overflow_cache.get(address, False)
        has_underflow = self._underflow_cache.get(address, False)
        if has_overflow or has_underflow:
            return
        opcode = state.get_current_instruction()["opcode"]
        funcs = {
            "ADD": [self._handle_add],
            "SUB": [self._handle_sub],
            "MUL": [self._handle_mul],
            "SSTORE": [self._handle_sstore],
            "JUMPI": [self._handle_jumpi],
            "RETURN": [self._handle_return, self._handle_transaction_end],
            "STOP": [self._handle_transaction_end],
            "EXP": [self._handle_exp],
        }
        for func in funcs[opcode]:
            func(state)
747835
def _prior_running_states(jid):
    '''
    
    '''

    ret = []
    active = __salt__['saltutil.is_running']('state.*')
    for data in active:
        try:
            data_jid = int(data['jid'])
        except ValueError:
            continue
        if data_jid < int(jid):
            ret.append(data)
    return ret