<commit_before>#!/usr/bin/env node

'use strict';

var util = require('util');
var cp = require('child_process');

var Q = require('q');
var _ = require('lodash');
var semver = require('semver');

var exec = function (cmd) {
  return function () {
    var args = Array.prototype.slice.call(arguments, 0);
    args.unshift(cmd);
    var fullCmd = util.format.apply(util, args);
    return Q.nfcall(cp.exec, fullCmd).then(function (out) {
      return out[0].split('\n');
    });
  };
};

var andThen = function (fn, after) {
  return function () {
    return fn.apply(this, arguments).then(after);
  };
};

var oneArg = function (fn) {
  return function (arg) {
    return fn(arg);
  };
};

var oneLine = function (lines) {
  return lines[0].trim();
};

var noArgs = function (fn) {
  return function () {
    return fn();
  };
};

var identity = function (i) { return i; };

// like Q.all, but runs the comands in series
// useful for ensuring env state (like which branch is checked out)
var allInSeries = function (fn) {
  return function (args) {
    var results = [];
    var def;
    while (args.length > 0) {
      (function (arg) {
        if (def) {
          def = def.then(function () {
            return fn(arg);
          });
        } else {
          def = fn(arg);
        }<commit_msg>docs(compare-master-to-stable.js): fix typo (comands -> commands)<commit_after>#!/usr/bin/env node

'use strict';

var util = require('util');
var cp = require('child_process');

var Q = require('q');
var _ = require('lodash');
var semver = require('semver');

var exec = function (cmd) {
  return function () {
    var args = Array.prototype.slice.call(arguments, 0);
    args.unshift(cmd);
    var fullCmd = util.format.apply(util, args);
    return Q.nfcall(cp.exec, fullCmd).then(function (out) {
      return out[0].split('\n');
    });
  };
};

var andThen = function (fn, after) {
  return function () {
    return fn.apply(this, arguments).then(after);
  };
};

var oneArg = function (fn) {
  return function (arg) {
    return fn(arg);
  };
};

var oneLine = function (lines) {
  return lines[0].trim();
};

var noArgs = function (fn) {
  return function () {
    return fn();
  };
};

var identity = function (i) { return i; };

// like Q.all, but runs the commands in series
// useful for ensuring env state (like which branch is checked out)
var allInSeries = function (fn) {
  return function (args) {
    var results = [];
    var def;
    while (args.length > 0) {
      (function (arg) {
        if (def) {
          def = def.then(function () {
            return fn(arg);
          });
        } else {
          def = fn(arg);
        }
{'fraction_non_alphanumeric': 0.16296575084681972, 'fraction_numerical': 0.0030109145652992097, 'mean_word_length': 2.6865464632454925, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '3191250', 'n_tokens_mistral': 876, 'n_tokens_neox': 867, 'n_words': 248}