<commit_before>// Underscore-contrib (underscore.function.iterators.js 0.0.1)
// (c) 2013 <NAME> and DocumentCloud Inc.
// Underscore-contrib may be freely distributed under the MIT license.

(function(root, undefined) {

  // Baseline setup
  // --------------

  // Establish the root object, `window` in the browser, or `global` on the server.
  var _ = root._ || require('underscore');

  // Helpers
  // -------
  
  var HASNTBEENRUN = {};
  
  function unary (fun) {
    return function (first) {
      return fun.call(this, first);
    };
  }
  
  function binary (fun) {
    return function (first, second) {
      return fun.call(this, first, second);
    };
  }
  
  // Mixing in the iterator functions
  // --------------------------------

     function foldl (iter, binaryFn, seed) {
      var state, element;
      if (seed !== void 0) {
        state = seed;
      }
      else {
        state = iter();
      }
      element = iter();
      while (element != null) {
        state = binaryFn.call(element, state, element);
        element = iter();
      }
      return state;
    }
  
    function unfold (seed, unaryFn) {
      var state = HASNTBEENRUN;
      return function () {
        if (state === HASNTBEENRUN) {
          state = seed;
        } else if (state != null) {
          state = unaryFn.call(state, state);
        }

        return state;
      };
    }
  
    // note that the unfoldWithReturn behaves differently than
    // unfold with respect to the first value returned
    function unfoldWithReturn (seed, unaryFn) {
      var state = seed,
          pair,
          value;
      return function () {
        if (state != null) {
          pair = unaryFn.call(state, state);
          value = pair[1];
          state = value != null
                  ? pair[0]
                  : void 0;
          return value;
        }
        else return void 0;
      };
    }

    function accumulate (iter, binaryFn, initial) {
      var state = initial;
      return function () {
        var element = iter();
        if (element == null) {
          return element;
        }
        else {
          if (state === void 0) {
            state = element;
          } else {
            state = binaryFn.call(element, state, element);
          }
          
          return state;
        }
      };
    }
  
    function accumulateWithReturn (iter, binaryFn, initial) {
      var state = initial,
          stateAndReturnValue,<commit_msg>Fix bad line breaking in ternary. JSHint W014<commit_after>// Underscore-contrib (underscore.function.iterators.js 0.0.1)
// (c) 2013 <NAME> and DocumentCloud Inc.
// Underscore-contrib may be freely distributed under the MIT license.

(function(root, undefined) {

  // Baseline setup
  // --------------

  // Establish the root object, `window` in the browser, or `global` on the server.
  var _ = root._ || require('underscore');

  // Helpers
  // -------
  
  var HASNTBEENRUN = {};
  
  function unary (fun) {
    return function (first) {
      return fun.call(this, first);
    };
  }
  
  function binary (fun) {
    return function (first, second) {
      return fun.call(this, first, second);
    };
  }
  
  // Mixing in the iterator functions
  // --------------------------------

     function foldl (iter, binaryFn, seed) {
      var state, element;
      if (seed !== void 0) {
        state = seed;
      }
      else {
        state = iter();
      }
      element = iter();
      while (element != null) {
        state = binaryFn.call(element, state, element);
        element = iter();
      }
      return state;
    }
  
    function unfold (seed, unaryFn) {
      var state = HASNTBEENRUN;
      return function () {
        if (state === HASNTBEENRUN) {
          state = seed;
        } else if (state != null) {
          state = unaryFn.call(state, state);
        }

        return state;
      };
    }
  
    // note that the unfoldWithReturn behaves differently than
    // unfold with respect to the first value returned
    function unfoldWithReturn (seed, unaryFn) {
      var state = seed,
          pair,
          value;
      return function () {
        if (state != null) {
          pair = unaryFn.call(state, state);
          value = pair[1];
          state = value != null ? pair[0] : void 0;
          return value;
        }
        else return void 0;
      };
    }

    function accumulate (iter, binaryFn, initial) {
      var state = initial;
      return function () {
        var element = iter();
        if (element == null) {
          return element;
        }
        else {
          if (state === void 0) {
            state = element;
          } else {
            state = binaryFn.call(element, state, element);
          }
          
          return state;
        }
      };
    }
  
    function accumulateWithReturn (iter, binaryFn, initial) {
      var state = initial,
          stateAndReturnValue,
{'fraction_non_alphanumeric': 0.1303030303030303, 'fraction_numerical': 0.005858585858585859, 'mean_word_length': 1.579989577905159, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4990060', 'n_tokens_mistral': 1448, 'n_tokens_neox': 1384, 'n_words': 420}