<commit_before>/**
 * Copyright (c) 2012 <NAME>
 * MIT License
 */

(function () {
  "use strict";

  var wrench = require('wrench');
  var path = require('path');
  var fs = require('fs');

  // fs exists
  exports.existsSync = fs.existsSync || path.existsSync;
  exports.exists = fs.exists || path.exists;

  // get test folders
  exports.root = path.join(path.dirname(module.filename), '../');
  var testDir = path.join(exports.root, 'test');

  // immortal path
  exports.immortal = path.join(exports.root, 'lib/module.js');

  // Filepath resolvers
  exports.temp = function (filename) {
    return path.join(testDir, 'temp', filename);
  };
  exports.fixture = function (filename) {
    return path.join(testDir, 'fixture', filename);
  };
  exports.simple = function (filename) {
    return path.join(testDir, 'simple', filename);
  };
  exports.watcher = function (filename) {
    return path.join(testDir, 'watchers', filename);
  };

  // create temp file if missing
  if (!exports.existsSync(exports.temp())) {
    fs.mkdirSync(exports.temp(), "755");
  }

  // extend options
  exports.extend = function(origin, add) {
    // Don't do anything if add isn't an object
    if (!add) return origin;

    var keys = Object.keys(add);
    var i = keys.length;
    while (i--) {
      origin[keys[i]] = add[keys[i]];
    }
    return origin;
  };

  // check if pid process alive
  exports.isAlive = function (pid) {
    try {
      process.kill(pid, 0);
      return true;
    } catch (e) {
      return false;
    }
  };

  // copy object
  exports.copy = function (object) {
    return exports.extend({}, object);
  };

  exports.reset = function () {
    var temp = path.join(testDir, 'temp');

    if (exports.existsSync(temp)) {
      wrench.rmdirSyncRecursive(temp);
    }

    fs.mkdirSync(temp);
  };

  // test sockets
  var isWin = process.platform === 'win32';
  exports.outputSocket = isWin ? 9002 : exports.temp('output');
  exports.inputSocket = isWin ? 9001 : exports.temp('input');

})();<commit_msg>[test] use port only RPC<commit_after>/**
 * Copyright (c) 2012 <NAME>
 * MIT License
 */

(function () {
  "use strict";

  var wrench = require('wrench');
  var path = require('path');
  var fs = require('fs');

  // fs exists
  exports.existsSync = fs.existsSync || path.existsSync;
  exports.exists = fs.exists || path.exists;

  // get test folders
  exports.root = path.join(path.dirname(module.filename), '../');
  var testDir = path.join(exports.root, 'test');

  // immortal path
  exports.immortal = path.join(exports.root, 'lib/module.js');

  // Filepath resolvers
  exports.temp = function (filename) {
    return path.join(testDir, 'temp', filename);
  };
  exports.fixture = function (filename) {
    return path.join(testDir, 'fixture', filename);
  };
  exports.simple = function (filename) {
    return path.join(testDir, 'simple', filename);
  };
  exports.watcher = function (filename) {
    return path.join(testDir, 'watchers', filename);
  };

  // create temp file if missing
  if (!exports.existsSync(exports.temp())) {
    fs.mkdirSync(exports.temp(), "755");
  }

  // extend options
  exports.extend = function(origin, add) {
    // Don't do anything if add isn't an object
    if (!add) return origin;

    var keys = Object.keys(add);
    var i = keys.length;
    while (i--) {
      origin[keys[i]] = add[keys[i]];
    }
    return origin;
  };

  // check if pid process alive
  exports.isAlive = function (pid) {
    try {
      process.kill(pid, 0);
      return true;
    } catch (e) {
      return false;
    }
  };

  // copy object
  exports.copy = function (object) {
    return exports.extend({}, object);
  };

  exports.reset = function () {
    var temp = path.join(testDir, 'temp');

    if (exports.existsSync(temp)) {
      wrench.rmdirSyncRecursive(temp);
    }

    fs.mkdirSync(temp);
  };

  // test sockets
  exports.outputSocket = 9002;
  exports.inputSocket = 9001;

})();
{'fraction_non_alphanumeric': 0.16058763931104356, 'fraction_numerical': 0.008611955420466059, 'mean_word_length': 2.9176587301587302, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1624361', 'n_tokens_mistral': 1343, 'n_tokens_neox': 1266, 'n_words': 312}