Move data exercise_question in step_question.
331299
private function migrateExerciseQuestionData()
    {
        $exoId = -1;
        $orderStep = 1;

        $exoQuestion = $this->checkExoQuestion();
        $stepStmt = $this->connection->prepare("
            INSERT INTO ujm_step
            (exercise_id, value, nbQuestion, keepSameQuestion, shuffle, duration, max_attempts, ordre)
            VALUES (:exoId, '', 0, FALSE, FALSE, 0, 0, :orderStep)
        ");

        foreach ($exoQuestion as $eq) {
            if ($eq['exercise_id'] !== $exoId) {
                $exoId = $eq['exercise_id'];
            }

            $this->log('Create step ...');

            $stepStmt->bindValue('exoId', $exoId);
            $stepStmt->bindValue('orderStep', $orderStep);
            $stepStmt->execute();

            $stepId = $this->connection->lastInsertId();
            $this->addQuestionStep($stepId, $eq['question_id'], 1);
            ++$orderStep;
        }
    }
118361
def moveToPoint(self, xxx_todo_changeme):
        
        (x,y) = xxx_todo_changeme
        self.set_x(float(self.get_x()) + float(x))
        self.set_y(float(self.get_y()) + float(y))
1250659
def do_move_to(self, element, decl, pseudo):
        """"""
        target = serialize(decl.value).strip()
        step = self.state[self.state['current_step']]
        elem = self.current_target().tree

        #  Find if the current node already has a move, and remove it.
        actions = step['actions']
        for pos, action in enumerate(reversed(actions)):
            if action[0] == 'move' and action[1] == elem:
                target_index = - pos - 1
                actions[target_index:] = actions[target_index+1:]
                break

        _, valstep = self.lookup('pending', target)
        if not valstep:
            step['pending'][target] = [('move', elem)]
        else:
            self.state[valstep]['pending'][target].append(('move', elem))
827787
protected function define_my_steps() {
        // Generate the quiz.xml file containing all the quiz information
        // and annotating used questions.
        $this->add_step(new backup_quiz_activity_structure_step('quiz_structure', 'quiz.xml'));

        // Note: Following  steps must be present
        // in all the activities using question banks (only quiz for now)
        // TODO: Specialise these step to a new subclass of backup_activity_task.

        // Process all the annotated questions to calculate the question
        // categories needing to be included in backup for this activity
        // plus the categories belonging to the activity context itself.
        $this->add_step(new backup_calculate_question_categories('activity_question_categories'));

        // Clean backup_temp_ids table from questions. We already
        // have used them to detect question_categories and aren't
        // needed anymore.
        $this->add_step(new backup_delete_temp_questions('clean_temp_questions'));
    }
1318924
def stack(datasets):
    """"""
    base = datasets[0].copy()
    for dataset in datasets[1:]:
        base = base.where(dataset.isnull(), dataset)
    return base
132945
private boolean moveToNextDataSegment() throws IOException {
    try {
      clearDataSegment();
      DataSegmentReader dataSegmentReader =
          new DataSegmentReader(dataIn, conf, decompressorCache);
      dataSegmentIn = dataSegmentReader.getInputStream();
    } catch (EmptyDataSegmentException e){
      // no data available
      return false;
    } catch (EOFException e) {
      // EOFException is thrown when the underlying data stream is truncated, e.g. truncated file.
      // This is considered as a normal case.
      throw new CodecPrematureEOFException("Truncated .SSF file detected.");
    } catch (ClassNotFoundException e) {
      throw new RuntimeException(e);
    }
    return true;
  }
591828
def _move_here(self):
        """"""
        cu = self.scraper.current_item
        # Already here?
        if self is cu:
            return
        # A child?
        if cu.items and self in cu.items:
            self.scraper.move_to(self)
            return
        # A parent?
        if self is cu.parent:
            self.scraper.move_up()
        # A sibling?
        if self.parent and self in self.parent.items:
            self.scraper.move_up()
            self.scraper.move_to(self)
            return
        # Last resort: Move to top and all the way down again
        self.scraper.move_to_top()
        for step in self.path:
            self.scraper.move_to(step)
766751
function(data, onProgress) {
        onProgress = onProgress || function() {};
        return new Promise(function(resolve, reject) {
            try {
                let obj = JSON.parse(data);
                _.forEach(obj.languages, function (questionnaire, index) {
                    // format
                    questionnaire.language_slug = questionnaire.slug;
                    questionnaire.language_name = questionnaire.name;
                    questionnaire.td_id = questionnaire.questionnaire_id;
                    questionnaire.language_direction = questionnaire.dir.toLowerCase() === 'rtl' ? 'rtl' : 'ltr';

                    try {
                        let id = library.addQuestionnaire(questionnaire);
                        if (id > 0) {
                            // add questions
                            _.forEach(questionnaire.questions, function (question, n) {
                                // format question
                                question.is_required = question.required ? 1 : 0;
                                question.depends_on = question.depends_on === null ? -1 : question.depends_on;
                                question.td_id = question.id;

                                try {
                                    library.addQuestion(question, id);
                                } catch (err) {
                                    console.error('Failed to add question', question);
                                    reject(err);
                                    return;
                                }
                                // broadcast itemized progress if there is only one questionnaire
                                if (obj.languages.length == 1) {
                                    onProgress(questionnaire.questions.length, n + 1);
                                }
                            });
                        } else {
                            console.error('Failed to add questionnaire', questionnaire);
                        }
                    } catch (err) {
                        console.error('Failed to add questionnaire', questionnaire);
                        reject(err);
                        return;
                    }
                    // broadcast overall progress if there are multiple questionnaires.
                    if (obj.languages.length > 1) {
                        onProgress(obj.languages.length, index + 1);
                    }
                });
                resolve();
            } catch (err) {
                reject(err);
            }
        });
    }
355807
def run_exercises(setup_manager: SetupManager, exercises: Iterable[Exercise], seed: int) -> Iterator[Result]:
    
    game_interface = setup_manager.game_interface
    names = [exercise.get_name() for exercise in exercises]
    with training_status_renderer_context(names, game_interface.renderer) as ren:
        for i, exercise in enumerate(exercises):
            def update_row(status: str, status_color_func):
                nonlocal i
                nonlocal exercise
                ren.update(i, Row(exercise.get_name(), status, status_color_func))

            update_row('config', ren.renderman.white)
            # Only reload the match if the config has changed.
            new_match_config = exercise.get_match_config()
            if new_match_config != setup_manager.match_config:
                update_row('match', ren.renderman.white)
                _setup_match(new_match_config, setup_manager)
                update_row('bots', ren.renderman.white)
                _wait_until_bots_ready(setup_manager, new_match_config)

            update_row('wait', ren.renderman.white)
            _wait_until_good_ticks(game_interface)

            update_row('setup', ren.renderman.white)
            error_result = _setup_exercise(game_interface, exercise, seed)
            if error_result is not None:
                update_row('setup', ren.renderman.red)
                yield error_result
                continue

            update_row('reload', ren.renderman.white)
            setup_manager.reload_all_agents(quiet=True)

            # Wait for the set_game_state() to propagate before we start running ex.on_tick()
            # TODO: wait until the game looks similar.
            update_row('sleep', ren.renderman.white)
            time.sleep(0.03)

            update_row('>>>>', ren.renderman.white)
            result = _grade_exercise(game_interface, exercise, seed)

            if isinstance(result.grade, Pass):
                update_row('PASS', ren.renderman.green)
            else:
                update_row('FAIL', ren.renderman.red)

            yield result
622577
def adapt_step_table!(parsed_step_table, gathered_comments)
      # Saving off the original data
      parsed_step_table['cuke_modeler_parsing_data'] = Marshal::load(Marshal.dump(parsed_step_table['rows']))

      # Removing parsed data for child elements in order to avoid duplicating data
      parsed_step_table['cuke_modeler_parsing_data'].clear


      parsed_step_table['line'] = parsed_step_table['rows'].first['line']

      parsed_step_table['rows'].each do |row|
        adapt_table_row!(row, gathered_comments)
      end
    end
317662
private void moveToNextPartition() {
    if (this.currentPartitionIdx == INITIAL_PARTITION_IDX) {
      LOG.info("Pulling topic " + this.topicName);
      this.currentPartitionIdx = 0;
    } else {
      updateStatisticsForCurrentPartition();
      this.currentPartitionIdx++;
      this.currentPartitionRecordCount = 0;
      this.currentPartitionTotalSize = 0;
      this.currentPartitionDecodeRecordTime = 0;
      this.currentPartitionFetchMessageBufferTime = 0;
      this.currentPartitionReadRecordTime = 0;
      this.currentPartitionLastSuccessfulRecord = null;
    }

    this.messageIterator = null;
    if (this.currentPartitionIdx < this.partitions.size()) {
      LOG.info(String.format("Pulling partition %s from offset %d to %d, range=%d", this.getCurrentPartition(),
          this.nextWatermark.get(this.currentPartitionIdx), this.highWatermark.get(this.currentPartitionIdx),
          this.highWatermark.get(this.currentPartitionIdx) - this.nextWatermark.get(this.currentPartitionIdx)));
      switchMetricContextToCurrentPartition();
    }

    if (!allPartitionsFinished()) {
      this.startFetchEpochTime.put(this.getCurrentPartition(), System.currentTimeMillis());
    }
  }
1050311
def put(self, rank, val):
        
        idx = bisect.bisect(self.ranks, rank)
        self.ranks.insert(idx, rank)
        self.data.insert(idx, val)
988792
function insertQueueStep(step, index) {
  if (index && index < currentSteps.length) {
    return currentSteps.splice(index, 0, step);
  }

  return currentSteps.push(step);
}
1013033
def step(self, **args):
        
        if self.verbosity > 0:
            print("Network.step() called with:", args)
        # First, copy the values into either activations or targets:
        retargs = self.preStep(**args)
        if retargs: args = retargs # replace the args
        # Propagate activation through network:
        self.propagate(**args)
        retargs = self.postPropagate(**args)
        if retargs: args = retargs # replace the args
        # Next, take care of any Auto-association, and copy
        # activations to targets
        for aa in self.association:
            (inName, outName) = aa
            inLayer = self.getLayer(inName)
            if inLayer.type not in ['Input', "Hidden"]:
                raise LayerError('Associated input layer not type \'Input\' or \'Hidden\'.', \
                                   inLayer.type)
            outLayer = self.getLayer(outName)
            if not outLayer.type == 'Output':
                raise LayerError('Associated output layer not type \'Output\'.', \
                                   outLayer.type)
            outLayer.copyTargets(inLayer.activation)
        # Compute error, and back prop it:
        retargs = self.preBackprop(**args)
        if retargs: args = retargs # replace the args
        (error, correct, total, pcorrect) = self.backprop(**args) # compute_error()
        if self.verbosity > 2 or self.interactive:
            self.display()
            if self.interactive:
                self.prompt()
        retargs = self.postBackprop(**args)
        if retargs: args = retargs # replace the args
        # if learning is true, and need to update weights here:
        if self.learning and not self.batch:
            self.change_weights() # else change weights in sweep
        retargs = self.postStep(**args)
        if retargs: args = retargs # replace the args
        self.reportPattern()
        return (error, correct, total, pcorrect)
305145
def ship_move(ship, x, y, speed):
    """"""
    click.echo('Moving ship %s to %s,%s with speed %s' % (ship, x, y, speed))
1299974
def _transform(self, data, transform, step_size):
    '''
    
    '''
    if callable(transform):
      data = transform(data, step_size)
    return data
129449
def run_step(self):
        """"""
        rewriter = StreamRewriter(self.context.iter_formatted_strings)
        super().run_step(rewriter)