<commit_before>var fs = require('fs');
var path = require('path');
var _ = require('lodash');
var spawn = require('child_process').spawn;

var requiredIncludes = [
  'mocha',
  'bower_components/chai/chai'
];

function checkDeps(callback) {
  var self = this;

  var deps = _.union(requiredIncludes.map(function (name) {
    return {
      name: name,
      pm: 'bower'
      }
    }), [
    'sear-require',
    'function-bind'
    ].map(function (name) {
      return {
        name: name,
        pm: 'npm'
      }
    })).map(function (dep) {
      dep.include = dep.name;
      if (dep.name !== '/') {
        dep.name =  dep.name.split('/')[0];
      }
      return dep;
    });

  var missing = [];

  (function checkDep(i) {
    var dep = deps[i];
    if (dep == null) {
      return callback(null, missing);
    }

    self._resolveFileName('', dep.include, function (err, path) {
      if (!path || err) {
        missing.push(dep);
      }

      checkDep(++i);
    });

  })(0);
}

module.exports = function (files, options, callback) {
  var self = this;
  function runTests() {
    var testFiles = [];

    function readFiles(files, base) {
      _.each(files, function (file) {
        var stat = fs.statSync(path.join(base, file));<commit_msg>Set files in dir root as input, if only one path was given and it is a directory and recursive is set to false.<commit_after>var fs = require('fs');
var path = require('path');
var _ = require('lodash');
var spawn = require('child_process').spawn;

var requiredIncludes = [
  'mocha',
  'bower_components/chai/chai'
];

function checkDeps(callback) {
  var self = this;

  var deps = _.union(requiredIncludes.map(function (name) {
    return {
      name: name,
      pm: 'bower'
      }
    }), [
    'sear-require',
    'function-bind'
    ].map(function (name) {
      return {
        name: name,
        pm: 'npm'
      }
    })).map(function (dep) {
      dep.include = dep.name;
      if (dep.name !== '/') {
        dep.name =  dep.name.split('/')[0];
      }
      return dep;
    });

  var missing = [];

  (function checkDep(i) {
    var dep = deps[i];
    if (dep == null) {
      return callback(null, missing);
    }

    self._resolveFileName('', dep.include, function (err, path) {
      if (!path || err) {
        missing.push(dep);
      }

      checkDep(++i);
    });

  })(0);
}

module.exports = function (files, options, callback) {
  var self = this;
  function runTests() {
    var testFiles = [];

    if (files.length === 1 && !options.recursive) {
      var base = files[0];
      var stat = fs.statSync(path.join(options.input, base));
      if (stat.isDirectory()) {
        files = fs.readdirSync(path.join(options.input, base));
        files = files.map(function (file) {
          return path.join(base, file);
        });
      }
    }

    function readFiles(files, base) {
      _.each(files, function (file) {
        var stat = fs.statSync(path.join(base, file));
{'fraction_non_alphanumeric': 0.1650911546252532, 'fraction_numerical': 0.002025658338960162, 'mean_word_length': 2.3404735062006763, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1330255', 'n_tokens_mistral': 1010, 'n_tokens_neox': 973, 'n_words': 232}