<commit_before>var Module = require("module");
var Entry = require("./entry.js").Entry;
var Mp = Module.prototype;
var load = Mp.load;

Mp.import = function (id, setters) {
  var module = this;

  id = Module._resolveFilename(id, module);

  if (setters && typeof setters === "object") {
    var entry = Entry.getOrCreate(id);
    entry.addSetters(setters);
    entry.addParent(module);
  }

  var countBefore = entry && entry.runCount;
  var exports = module.require(id);

  if (entry && entry.runCount === countBefore) {
    entry.runModuleSetters(Module._cache[id] || {
      id: id,
      exports: exports,
      getExportByName: Mp.getExportByName
    });
  }

  return exports;
};

// Override Module.prototype.load to call Entry.runModuleSetters whenever
// a module has loaded.
Mp.load = function () {
  var result = load.apply(this, arguments);
  Entry.runModuleSetters(this);
  return result;<commit_msg>Compile all imported module contents.<commit_after>var Module = require("module");
var Entry = require("./entry.js").Entry;
var compile = require("./compiler.js").compile;
var Mp = Module.prototype;

Mp.import = function (id, setters) {
  var module = this;

  id = Module._resolveFilename(id, module);

  if (setters && typeof setters === "object") {
    var entry = Entry.getOrCreate(id);
    entry.addSetters(setters);
    entry.addParent(module);
  }

  var countBefore = entry && entry.runCount;
  var exports = module.require(id);

  if (entry && entry.runCount === countBefore) {
    entry.runModuleSetters(Module._cache[id] || {
      id: id,
      exports: exports,
      getExportByName: Mp.getExportByName
    });
  }

  return exports;
};

// Override Module.prototype.load to call Entry.runModuleSetters whenever
// a module has loaded.
var load = Mp.load;
Mp.load = function () {
  var result = load.apply(this, arguments);
  Entry.runModuleSetters(this);
  return result;
};

// Override Module.prototype._compile to compile any code that will be
// evaluated as a module.
var _compile = Mp._compile;
Mp._compile = function (content, filename) {
  return _compile.call(this, compile(content), filename);
{'fraction_non_alphanumeric': 0.13649155722326453, 'fraction_numerical': 0.0, 'mean_word_length': 3.729490022172949, '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': '6654664', 'n_tokens_mistral': 672, 'n_tokens_neox': 663, 'n_words': 172}