<commit_before>import path from "path";
import fse from "fs-extra";
import { Deployed } from "./Deployed";
import findContracts from "@truffle/contract-sources";
import { ResolverSource } from "../../source";
const contract = require("@truffle/contract");

export class Truffle implements ResolverSource {
  options: any;

  constructor(options: any) {
    this.options = options;
  }

  async resolve(importPath: string) {
    if (importPath === "truffle/DeployedAddresses.sol") {
      const sourceFiles = await findContracts(this.options.contracts_directory);

      let abstractionFiles: string[] =
        fse.existsSync(this.options.contracts_build_directory)
          ? fse.readdirSync(this.options.contracts_build_directory)
          : [];
      const buildDirFiles = abstractionFiles;
      abstractionFiles = buildDirFiles.filter(file => file.match(/^.*.json$/));

      const mapping: { [key: string]: string | false } = {};

      const blacklist = new Set(["Assert", "DeployedAddresses"]);

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

      abstractionFiles.forEach(file => {
        const name = path.basename(file, ".json");<commit_msg>Simplify variable assignment sequence<commit_after>import path from "path";
import fse from "fs-extra";
import { Deployed } from "./Deployed";
import findContracts from "@truffle/contract-sources";
import { ResolverSource } from "../../source";
const contract = require("@truffle/contract");

export class Truffle implements ResolverSource {
  options: any;

  constructor(options: any) {
    this.options = options;
  }

  async resolve(importPath: string) {
    if (importPath === "truffle/DeployedAddresses.sol") {
      const sourceFiles = await findContracts(this.options.contracts_directory);

      const buildDirFiles: string[] =
        fse.existsSync(this.options.contracts_build_directory)
          ? fse.readdirSync(this.options.contracts_build_directory)
          : [];
      const abstractionFiles = buildDirFiles.filter(file => file.match(/^.*.json$/));

      const mapping: { [key: string]: string | false } = {};

      const blacklist = new Set(["Assert", "DeployedAddresses"]);

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

      abstractionFiles.forEach(file => {
        const name = path.basename(file, ".json");
{'fraction_non_alphanumeric': 0.12986086336068497, 'fraction_numerical': 0.0, 'mean_word_length': 3.3338485316846986, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3009454', 'n_tokens_mistral': 800, 'n_tokens_neox': 787, 'n_words': 200}