<commit_before>var command = {
  command: "opcode",
  description: "Print the compiled opcodes for a given contract",
  builder: {
    all: {
      type: "boolean",
      default: false
    }
  },
  help: {
    usage: "truffle opcode <contract_name>",
    options: [
      {
        option: "<contract_name>",
        description:
          "Name of the contract to print opcodes for. Must be a contract name, not a file name. (required)"
      }
    ]
  },
  run: function (options, done) {
    var Config = require("@truffle/config");
    var TruffleError = require("@truffle/error");
    var Contracts = require("@truffle/workflow-compile");
    var CodeUtils = require("@truffle/code-utils");

    if (options._.length === 0) {
      return done(new TruffleError("Please specify a contract name."));
    }

    var config = Config.detect(options);
    Contracts.compileAndSave(config, function (err) {
      if (err) return done(err);

      var contractName = options._[0];
      var Contract;
      try {
        Contract = config.resolver.require(contractName);
      } catch (e) {
        return done(
          new TruffleError(
            'Cannot find compiled contract with name "' + contractName + '"'
          )
        );
      }

      var bytecode = Contract.deployedBytecode;
      var numInstructions = Contract.deployedSourceMap.split(";").length;

      if (options.creation) {
        bytecode = Contract.bytecode;
        numInstructions = Contract.sourceMap.split(";").length;
      }

      var opcodes = CodeUtils.parseCode(bytecode, numInstructions);

      var indexLength = (opcodes.length + "").length;

      opcodes.forEach(function (opcode, index) {
        var strIndex = index + ":";

        while (strIndex.length < indexLength + 1) {
          strIndex += " ";
        }

        console.log(
          strIndex + " " + opcode.name + " " + (opcode.pushData || "")
        );
      });
    });
  }
};
<commit_msg>Correct mistake in calling compileAndSave with a callback<commit_after>const command = {
  command: "opcode",
  description: "Print the compiled opcodes for a given contract",
  builder: {
    all: {
      type: "boolean",
      default: false
    }
  },
  help: {
    usage: "truffle opcode <contract_name>",
    options: [
      {
        option: "<contract_name>",
        description:
          "Name of the contract to print opcodes for. Must be a contract name, not a file name. (required)"
      }
    ]
  },
  run: function (options, done) {
    const Config = require("@truffle/config");
    const TruffleError = require("@truffle/error");
    const Contracts = require("@truffle/workflow-compile");
    const CodeUtils = require("@truffle/code-utils");

    if (options._.length === 0) {
      return done(new TruffleError("Please specify a contract name."));
    }

    var config = Config.detect(options);
    Contracts.compileAndSave(config)
      .then(() => {
        const contractName = options._[0];
        let Contract;
        try {
          Contract = config.resolver.require(contractName);
        } catch (e) {
          return done(
            new TruffleError(
              'Cannot find compiled contract with name "' + contractName + '"'
            )
          );
        }

        let bytecode = Contract.deployedBytecode;
        let numInstructions = Contract.deployedSourceMap.split(";").length;

        if (options.creation) {
          bytecode = Contract.bytecode;
          numInstructions = Contract.sourceMap.split(";").length;
        }
        const opcodes = CodeUtils.parseCode(bytecode, numInstructions);

        const indexLength = (opcodes.length + "").length;

        opcodes.forEach((opcode, index) => {
          let strIndex = index + ":";

          while (strIndex.length < indexLength + 1) {
            strIndex += " ";
          }

          console.log(
            strIndex + " " + opcode.name + " " + (opcode.pushData || "")
          );
        });
      })
      .catch(done);
  }
};

{'fraction_non_alphanumeric': 0.12896775806048488, 'fraction_numerical': 0.0014996250937265683, 'mean_word_length': 2.1837708830548928, 'pattern_counts': {'":': 2, '<': 9, '<?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': '5433182', 'n_tokens_mistral': 1156, 'n_tokens_neox': 1146, 'n_words': 280}