<commit_before>'use strict';

const os = require('os');
const Vorpal = require('vorpal');

const commands = require('./../commands.json');
const help = require('./help');
const interfacer = require('./util/interfacer');

let cmds;

const app = {

  commands: commands.commands,

  importedCommands: commands.importedCommands,

  vorpal: new Vorpal(),

  _cwd: process.cwd(),

  _fatal: false,

  export(str, cbk) {
    cbk = cbk || function () {};
    const options = {
      fatal: app._fatal || false
    };
    // Hook stdin, execute the command and
    // then return it all.
    const intercept = require('./util/intercept');
    let out = '';
    const unhook = intercept(function (str) {
      out += `${str}\n`;
      return '';
    });
    app.vorpal.execSync(str, options);
    unhook();
    return String(out).replace(/\n$/, '');
  },

  load() {
    const self = this;
    self.vorpal.api = {};
    this.commands.forEach(function (cmd) {
      if (self.importedCommands.indexOf(cmd) > -1) {<commit_msg>Enables executing multiple commands via ES6 tagged template literals<commit_after>'use strict';

const os = require('os');
const Vorpal = require('vorpal');

const commands = require('./../commands.json');
const help = require('./help');
const interfacer = require('./util/interfacer');

let cmds;

const app = {

  commands: commands.commands,

  importedCommands: commands.importedCommands,

  vorpal: new Vorpal(),

  _cwd: process.cwd(),

  _fatal: false,

  export(str, cbk) {
    // Is this a tagged template literal?
    const tmpl = Array.isArray(str) && Array.isArray(str.raw);
    cbk = tmpl && cbk || function () {};
    const options = {
      fatal: app._fatal || false
    };
    // Hook stdin, execute the command and
    // then return it all.
    const intercept = require('./util/intercept');
    let out = '';
    const unhook = intercept(function (str) {
      out += `${str}\n`;
      return '';
    });
    let commands;
    if (tmpl) {
      // Render into a single string, inserting interpolated values.
      const interpVals = [...arguments].slice(1);
      let interpStr = str[0];
      for (let i = 0, l = interpVals.length; i < l; i++) {
        interpStr += `${interpVals[i]}${str[i + 1]}`;
      }
      // Split into lines.  Remove blank lines and comments (start with #)
      commands = interpStr.split(/\r\n|\r|\n/).filter(command => {
        return !(/^\s*(?:#|$)/.test(command));
      });
    } else {
      commands = [str];
    }
    commands.forEach(command => {
      app.vorpal.execSync(command, options);
    });
    unhook();
    return String(out).replace(/\n$/, '');
  },

  load() {
    const self = this;
    self.vorpal.api = {};
    this.commands.forEach(function (cmd) {
      if (self.importedCommands.indexOf(cmd) > -1) {
{'fraction_non_alphanumeric': 0.17168458781362006, 'fraction_numerical': 0.0025089605734767025, 'mean_word_length': 2.711436170212766, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 7, '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': '3250176', 'n_tokens_mistral': 910, 'n_tokens_neox': 892, 'n_words': 225}