<commit_before>const Deployed = require("./deployed");
const path = require("path");
const fse = require("fs-extra");
const contract = require("@truffle/contract");
const find_contracts = require("@truffle/contract-sources");

function TestSource(config) {
  this.config = config;
}

TestSource.prototype.require = function() {
  return null; // FSSource will get it.
};

TestSource.prototype.resolve = function(importPath, callback) {
  const self = this;

  if (importPath === "truffle/DeployedAddresses.sol") {
    return find_contracts(this.config.contracts_directory, function(
      err,
      sourceFiles
    ) {
      // Ignore this error. Continue on.

      let abstractionFiles;
      try {
        abstractionFiles = fse.readdirSync(
          self.config.contracts_build_directory
        );
        // Filter out non-json files
        abstractionFiles = abstractionFiles.filter(file => {
          return file.match(/^.*.json$/);
        });
      } catch (error) {
        return callback(error);
      }

      const mapping = {};

      const blacklist = ["Assert", "DeployedAddresses"];

      // Ensure we have a mapping for source files and abstraction files
      // to prevent any compile errors in tests.
      sourceFiles.forEach(file => {
        const name = path.basename(file, ".sol");
        if (blacklist.indexOf(name) >= 0) return;
        mapping[name] = false;
      });

      abstractionFiles.forEach(file => {
        const name = path.basename(file, ".json");
        if (blacklist.indexOf(name) >= 0) return;
        mapping[name] = false;
      });
<commit_msg>Change variable name<commit_after>const Deployed = require("./deployed");
const path = require("path");
const fse = require("fs-extra");
const contract = require("@truffle/contract");
const find_contracts = require("@truffle/contract-sources");

function TestSource(config) {
  this.config = config;
}

TestSource.prototype.require = function() {
  return null; // FSSource will get it.
};

TestSource.prototype.resolve = function(importPath, callback) {
  const self = this;

  if (importPath === "truffle/DeployedAddresses.sol") {
    return find_contracts(this.config.contracts_directory, function(
      err,
      sourceFiles
    ) {
      // Ignore this error. Continue on.

      let abstractionFiles;
      try {
        const buildDirFiles = (abstractionFiles = fse.readdirSync(
          self.config.contracts_build_directory
        ));
        // Filter out non-json files
        abstractionFiles = buildDirFiles.filter(file => {
          return file.match(/^.*.json$/);
        });
      } catch (error) {
        return callback(error);
      }

      const mapping = {};

      const blacklist = ["Assert", "DeployedAddresses"];

      // Ensure we have a mapping for source files and abstraction files
      // to prevent any compile errors in tests.
      sourceFiles.forEach(file => {
        const name = path.basename(file, ".sol");
        if (blacklist.indexOf(name) >= 0) return;
        mapping[name] = false;
      });

      abstractionFiles.forEach(file => {
        const name = path.basename(file, ".json");
        if (blacklist.indexOf(name) >= 0) return;
        mapping[name] = false;
      });

{'fraction_non_alphanumeric': 0.12902227722772278, 'fraction_numerical': 0.0012376237623762376, 'mean_word_length': 2.6822323462414577, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '397648', 'n_tokens_mistral': 938, 'n_tokens_neox': 919, 'n_words': 224}