<commit_before>/*!
 * @author <NAME>
 * @since 17/12/2016
 */

// former initBlocklyRunner

function RunController(ctx, msgCallback) {

  this.context = ctx;
  this.messageCallback = msgCallback;
  this.interpreters = [];
  this.isRunning = [];
  this.toStop = [];
  this.stopPrograms = false;

  this.waitDelay = function (callback, value, delay) {
    if (delay > 0) {
      var identifier = "wait" + this.context.curRobot + "_" + Math.random();
      var that = this;
      this.context.delayFactory.createTimeout(identifier, function () {
        that.noDelay(callback, value)
      }, delay);
    } else {
      this.noDelay(callback, value);
    }
  };

  this.noDelay = function (callback, value) {
    var primitive = undefined;
    if (value != undefined) {
      primitive = this.interpreters[context.curRobot].createPrimitive(value);
    }
    if (Math.random() < 0.1) {
      var identifier = "wait_" + Math.random();
      var that = this;
      context.delayFactory.createTimeout(identifier, function () {
        callback(primitive);<commit_msg>javascript interpeter working<commit_after>/*!
 * @author <NAME>
 * @since 17/12/2016
 */

// former initBlocklyRunner

function RunController(ctx, msgCallback) {

  this.context = ctx;
  this.messageCallback = msgCallback;
  this.interpreters = [];
  this.isRunning = [];
  this.toStop = [];
  this.stopPrograms = false;

  this.waitDelay = function (callback, value, delay) {
    if (delay > 0) {
      var identifier = "wait" + this.context.curRobot + "_" + Math.random();
      var that = this;
      this.context.delayFactory.createTimeout(identifier, function () {
        that.noDelay(callback, value)
      }, delay);
    } else {
      this.noDelay(callback, value);
    }
  };

  this.noDelay = function (callback, value) {
    var primitive = undefined;
    if (value != undefined) {
      primitive = this.interpreters[this.context.curRobot].createPrimitive(value);
    }
    if (Math.random() < 0.1) {
      var identifier = "wait_" + Math.random();
      var that = this;
      this.context.delayFactory.createTimeout(identifier, function () {
        callback(primitive);
{'fraction_non_alphanumeric': 0.1407269338303821, 'fraction_numerical': 0.010251630941286114, 'mean_word_length': 2.998137802607076, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1443118', 'n_tokens_mistral': 675, 'n_tokens_neox': 654, 'n_words': 137}