<commit_before>
var path = require('path');

// list all native modules in dependency order
exports.natives = ['util', 'url', 'events'];

// find lib and root folder
exports.lib = path.dirname(module.filename);
exports.root = path.join(exports.lib, '../');

// create filepath resolve shortcuts
['core', 'helpers', 'defaults', 'modules', 'client'].forEach(function (folder) {
  exports[folder] = function (part) {
    return path.join(exports.lib, folder, part + '.js');
  };
});

// return a core module object
exports.getCore = function (part) {
  return require(exports.core(part));
};

// return a helper module object
exports.getHelper = function (part) {
  return require(exports.helpers(part));
};

// preload common modules
exports.utils = require('./utils.js');
<commit_msg>[refactor] load functions<commit_after>
var path = require('path');

// find lib and root folder
exports.lib = path.dirname(module.filename);
exports.root = path.join(exports.lib, '../');

exports.find = function () {
  var args = Array.prototype.slice.call(arguments);

  // get filename (last argument)
  var filename = args.pop();

  // create folder path
  var folder = path.join.apply(path, [exports.lib].concat(args));

  // if filename is set to null, just return the folder
  if (filename === null) {
    return folder + '/';
  }

  // add file extention
  if (filename.indexOf('.') === -1) {
    filename += '.js';
  }

  // return full filepath
  return path.join(folder, filename);
};

exports.load = function () {
  return require(exports.find.apply(exports, arguments));
};

{'fraction_non_alphanumeric': 0.16751592356687897, 'fraction_numerical': 0.0006369426751592356, 'mean_word_length': 3.833846153846154, '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': '5164867', 'n_tokens_mistral': 472, 'n_tokens_neox': 467, 'n_words': 135}