<commit_before><html>
<head>
  <link href="../node_modules/mocha/mocha.css" rel="stylesheet">
  <script src="jquery-2.0.3.min.js"></script>
</head>
<body>

<div id="mocha"></div>

<script type="text/javascript" charset="utf-8">
(function() {
  // Check if we are running in CI.
  var argv = require('remote').process.argv;
  var isCi = argv[1] == '--ci';

  if (!isCi) {
    var win = require('remote').getCurrentWindow();
    win.show();
    win.focus();
  }

  // Show DevTools.
  document.oncontextmenu = function(e) {
    require('remote').getCurrentWindow().inspectElement(e.clientX, e.clientY);
  }

  require('coffee-script'); // Supports .coffee tests.

  // Rediret all output to browser.
  var ipc = require('ipc');
  global.__defineGetter__('console', function() {
    return {
      log: function() {
        args = Array.prototype.slice.call(arguments);
        ipc.sendChannel('console.log', args);
      },
      error: function() {
        args = Array.prototype.slice.call(arguments);
        ipc.sendChannel('console.error', args);
      },
    }
  });

  var Mocha = require('mocha');

  var mocha = new Mocha();
  mocha.ui('bdd').reporter(isCi ? 'tap' : 'html');

  var query = Mocha.utils.parseQuery(window.location.search || '');
  if (query.grep) mocha.grep(query.grep);
  if (query.invert) mocha.invert();

  // Read all test files.
  var walker = require('walkdir').walk(__dirname);

  walker.on('file', function(file) {
    if (/.coffee$/.test(file))
      mocha.addFile(file);
  });

  walker.on('end', function() {<commit_msg>Only redirect output to browser when running in CI.<commit_after><html>
<head>
  <link href="../node_modules/mocha/mocha.css" rel="stylesheet">
  <script src="jquery-2.0.3.min.js"></script>
</head>
<body>

<div id="mocha"></div>

<script type="text/javascript" charset="utf-8">
(function() {
  // Check if we are running in CI.
  var argv = require('remote').process.argv;
  var isCi = argv[1] == '--ci';

  if (!isCi) {
    var win = require('remote').getCurrentWindow();
    win.show();
    win.focus();
  }

  // Show DevTools.
  document.oncontextmenu = function(e) {
    require('remote').getCurrentWindow().inspectElement(e.clientX, e.clientY);
  }

  require('coffee-script'); // Supports .coffee tests.
  var ipc = require('ipc');

  // Rediret all output to browser.
  if (isCi) {
    global.__defineGetter__('console', function() {
      return {
        log: function() {
          args = Array.prototype.slice.call(arguments);
          ipc.sendChannel('console.log', args);
        },
        error: function() {
          args = Array.prototype.slice.call(arguments);
          ipc.sendChannel('console.error', args);
        },
      }
    });
  }

  var Mocha = require('mocha');

  var mocha = new Mocha();
  mocha.ui('bdd').reporter(isCi ? 'tap' : 'html');

  var query = Mocha.utils.parseQuery(window.location.search || '');
  if (query.grep) mocha.grep(query.grep);
  if (query.invert) mocha.invert();

  // Read all test files.
  var walker = require('walkdir').walk(__dirname);

  walker.on('file', function(file) {
    if (/.coffee$/.test(file))
      mocha.addFile(file);
  });

  walker.on('end', function() {
{'fraction_non_alphanumeric': 0.18789209535759097, 'fraction_numerical': 0.003136762860727729, 'mean_word_length': 3.109536082474227, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '6151472', 'n_tokens_mistral': 1132, 'n_tokens_neox': 1077, 'n_words': 214}