<commit_before>// Load in dependencies
var nodeExecSync = require('child_process').execSync;
var extExecSync;
try {
  extExecSync = require('execSync');
} catch (err) {
  // Ignore loading errors
}

// Define a default exec sync
// https://nodejs.org/docs/v5.0.0/api/child_process.html#child_process_child_process_execsync_command_options
var exec = function (cmd) {
  return nodeExecSync(cmd);
};

// If there is no native exec sync, then use our external one
if (!nodeExecSync) {
  exec = function (cmd) {
    // https://www.npmjs.com/package/execSync
    return execSync.stdout(cmd).trim();
  };
}

// Export our utils
module.exports = {
  exec: exec,
  getWindowTitle: function (id) {
    return exec('wmctrl -l | grep ' + id + ' | cut --delimiter " " --fields 5-');
  }
};
<commit_msg>Fixed up cross-system support<commit_after>// Load in dependencies
var nodeExecSync = require('child_process').execSync;
var extExecSync;
try {
  extExecSync = require('execSync');
} catch (err) {
  // Ignore loading errors
}

// Define a default exec sync
// https://nodejs.org/docs/v5.0.0/api/child_process.html#child_process_child_process_execsync_command_options
var exec = function (cmd) {
  return nodeExecSync(cmd).toString().trim();
};

// If there is no native exec sync, then use our external one
if (!nodeExecSync) {
  exec = function (cmd) {
    // https://www.npmjs.com/package/execSync
    return extExecSync.stdout(cmd).trim();
  };
}

// Export our utils
module.exports = {
  exec: exec,
  getWindowTitle: function (id) {
    return exec('wmctrl -l | grep ' + id + ' | cut --delimiter " " --fields 5-');
  }
};

{'fraction_non_alphanumeric': 0.14656771799628943, 'fraction_numerical': 0.004947433518862091, 'mean_word_length': 3.6361031518624642, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '3567658', 'n_tokens_mistral': 539, 'n_tokens_neox': 530, 'n_words': 137}