<commit_before>/* eslint-disable no-undef, no-unused-vars, no-native-reassign */
// the $ on the iframe window object is the same
// as the one used on the main site, but
// uses the iframe document as the context
window.$(document).ready(function() {
  var _ = parent._;
  var Rx = parent.Rx;
  var chai = parent.chai;
  var assert = chai.assert;
  var tests = parent.tests;
  var common = parent.common;

  window.loopProtect.hit = function(line) {
    window.__err = new Error(
      'Potential infinite loop at line ' + line
    );
  };

  common.getJsOutput = function evalJs(code = '') {
    let output;
    try {
      /* eslint-disable no-eval */
      output = eval(code);
      /* eslint-enable no-eval */
    } catch (e) {
      window.__err = e;
    }
    return output;
  };

  common.runPreviewTests$ =
    function runPreviewTests$({
    tests = [],
    originalCode,
    ...rest
  }) {
      const code = originalCode;
      const editor = { getValue() { return originalCode; } };
      if (window.__err) {
        return Rx.Observable.throw(window.__err);
      }

      return Rx.Observable.from(tests)
        .map(test => {
          const userTest = {};
          common.appendToOutputDisplay('');
          try {
            /* eslint-disable no-eval */
            eval(test);
            /* eslint-enable no-eval */
          } catch (e) {
            userTest.err = e.message.split(':').shift();
          } finally {
            if (!test.match(/message: /g)) {
              userTest.text = 'message: ' + test
                .split(',')
                .pop()
                .replace(/\'/g, '')
                .replace(/\)/, '');
            } else {
              userTest.text = test;
            }
          }
          return userTest;
        })
        .toArray()
        .map(tests => ({ ...rest, tests, originalCode }));
    };

  // now that the runPreviewTest$ is defined
  // we set the subject to true
  // this will let the updatePreview
  // script now that we are ready.
  console.log('second');
  common.previewReady$.onNext(true);
});<commit_msg>Remove console.log<commit_after>/* eslint-disable no-undef, no-unused-vars, no-native-reassign */
// the $ on the iframe window object is the same
// as the one used on the main site, but
// uses the iframe document as the context
window.$(document).ready(function() {
  var _ = parent._;
  var Rx = parent.Rx;
  var chai = parent.chai;
  var assert = chai.assert;
  var tests = parent.tests;
  var common = parent.common;

  window.loopProtect.hit = function(line) {
    window.__err = new Error(
      'Potential infinite loop at line ' + line
    );
  };

  common.getJsOutput = function evalJs(code = '') {
    let output;
    try {
      /* eslint-disable no-eval */
      output = eval(code);
      /* eslint-enable no-eval */
    } catch (e) {
      window.__err = e;
    }
    return output;
  };

  common.runPreviewTests$ =
    function runPreviewTests$({
    tests = [],
    originalCode,
    ...rest
  }) {
      const code = originalCode;
      const editor = { getValue() { return originalCode; } };
      if (window.__err) {
        return Rx.Observable.throw(window.__err);
      }

      return Rx.Observable.from(tests)
        .map(test => {
          const userTest = {};
          common.appendToOutputDisplay('');
          try {
            /* eslint-disable no-eval */
            eval(test);
            /* eslint-enable no-eval */
          } catch (e) {
            userTest.err = e.message.split(':').shift();
          } finally {
            if (!test.match(/message: /g)) {
              userTest.text = 'message: ' + test
                .split(',')
                .pop()
                .replace(/\'/g, '')
                .replace(/\)/, '');
            } else {
              userTest.text = test;
            }
          }
          return userTest;
        })
        .toArray()
        .map(tests => ({ ...rest, tests, originalCode }));
    };

  // now that the runPreviewTest$ is defined
  // we set the subject to true
  // this will let the updatePreview
  // script now that we are ready.
  common.previewReady$.onNext(true);
});
{'fraction_non_alphanumeric': 0.1413826212193951, 'fraction_numerical': 0.0, 'mean_word_length': 1.725310660562459, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1514752', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1229, 'n_words': 314}