<commit_before>var _append = require('./internal/_append');
var _curry2 = require('./internal/_curry2');
var _dispatchable = require('./internal/_dispatchable');
var _reduce = require('./internal/_reduce');
var _xgroupBy = require('./internal/_xgroupBy');


/**
 * Splits a list into sub-lists stored in an object, based on the result of calling a String-returning function
 * on each element, and grouping the results according to values returned.
 *
 * Acts as a transducer if a transformer is given in list position.
 * @see R.transduce
 *
 * @func
 * @memberOf R
 * @category List
 * @sig (a -> s) -> [a] -> {s: a}
 * @param {Function} fn Function :: a -> String
 * @param {Array} list The array to group
 * @return {Object} An object with the output of `fn` for keys, mapped to arrays of elements
 *         that produced that key when passed to `fn`.
 * @example
 *
 *     var byGrade = R.groupBy(function(student) {
 *       var score = student.score;
 *       return score < 65 ? 'F' :
 *              score < 70 ? 'D' :
 *              score < 80 ? 'C' :
 *              score < 90 ? 'B' : 'A';
 *     });
 *     var students = [{name: 'Abby', score: 84},
 *                     {name: 'Eddy', score: 58},
 *                     // ...
 *                     {name: 'Jack', score: 69}];
 *     byGrade(students);
 *     // {
 *     //   'A': [{name: 'Dianne', score: 99}],
 *     //   'B': [{name: 'Abby', score: 84}]
 *     //   // ...,
 *     //   'F': [{name: 'Eddy', score: 58}]
 *     // }
 */
module.exports = _curry2(_dispatchable('groupBy', _xgroupBy, function groupBy(fn, list) {
    return _reduce(function(acc, elt) {
        var key = fn(elt);<commit_msg>Type signature fix for groupBy<commit_after>var _append = require('./internal/_append');
var _curry2 = require('./internal/_curry2');
var _dispatchable = require('./internal/_dispatchable');
var _reduce = require('./internal/_reduce');
var _xgroupBy = require('./internal/_xgroupBy');


/**
 * Splits a list into sub-lists stored in an object, based on the result of calling a String-returning function
 * on each element, and grouping the results according to values returned.
 *
 * Acts as a transducer if a transformer is given in list position.
 * @see R.transduce
 *
 * @func
 * @memberOf R
 * @category List
 * @sig (a -> s) -> [a] -> {s: [a]}
 * @param {Function} fn Function :: a -> String
 * @param {Array} list The array to group
 * @return {Object} An object with the output of `fn` for keys, mapped to arrays of elements
 *         that produced that key when passed to `fn`.
 * @example
 *
 *     var byGrade = R.groupBy(function(student) {
 *       var score = student.score;
 *       return score < 65 ? 'F' :
 *              score < 70 ? 'D' :
 *              score < 80 ? 'C' :
 *              score < 90 ? 'B' : 'A';
 *     });
 *     var students = [{name: 'Abby', score: 84},
 *                     {name: 'Eddy', score: 58},
 *                     // ...
 *                     {name: 'Jack', score: 69}];
 *     byGrade(students);
 *     // {
 *     //   'A': [{name: 'Dianne', score: 99}],
 *     //   'B': [{name: 'Abby', score: 84}]
 *     //   // ...,
 *     //   'F': [{name: 'Eddy', score: 58}]
 *     // }
 */
module.exports = _curry2(_dispatchable('groupBy', _xgroupBy, function groupBy(fn, list) {
    return _reduce(function(acc, elt) {
        var key = fn(elt);
{'fraction_non_alphanumeric': 0.16671610797982794, 'fraction_numerical': 0.013645802432512608, 'mean_word_length': 2.2579710144927536, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2524175', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1042, 'n_words': 341}