<commit_before>import { all, any, except, intersect, union, map, flatMap, groupBy, sortBy, addFront, concat, groupJoin, join, zip, filter,
    contains, first, last, count, fold, distinct, ofType, binarySearch, equals, take, takeWhile, skip, skipWhile, reverse } from '../../list_monad/list_iterators';
import { generatorProto, sortDirection } from '../../helpers';
import { set, when, isSomething, apply, ifElse, wrap, delegatesFrom, defaultPredicate, delegatesTo, not, isArray } from '../../functionalHelpers';

/**
 * @description: Object that contains the core functionality of a List; both the m_list and ordered_m_list
 * objects delegate to this object for all functionality besides orderBy/orderByDescending
 * and thenBy/thenByDescending respectively. Getter/setters are present for state-manipulation
 * at the consumer-object level, as well as to provide default values for a consumer-level
 * object at creation if not specified.
 * @type {{
 * value,
 * value,
 * map: list_functor_core._map,
 * groupBy: list_functor_core._groupBy,
 * groupByDescending: list_functor_core._groupByDescending,
 * flatMap: list_functor_core._flatMap,
 * addFront: list_functor_core._addFront,
 * concat: list_functor_core._concat,
 * except: list_functor_core._except,
 * groupJoin: list_functor_core._groupJoin,
 * intersect: list_functor_core._intersect,
 * join: list_functor_core._join,
 * union: list_functor_core._union,
 * zip: list_functor_core._zip,
 * where: list_functor_core._where,
 * ofType: list_functor_core._ofType,
 * distinct: list_functor_core._distinct,
 * take: list_functor_core._take,
 * takeWhile: list_functor_core._takeWhile,
 * skip: list_functor_core._skip,
 * skipWhile: list_functor_core._skipWhile,
 * any: list_functor_core._any,
 * all: list_functor_core._all,
 * contains: list_functor_core._contains,
 * first: list_functor_core._first,
 * fold: list_functor_core._fold,
 * last: list_functor_core._last,
 * count: list_functor_core._count,
 * toArray: list_functor_core._toArray,
 * toSet: list_functor_core._toSet,
 * reverse: list_functor_core._reverse,
 * [Symbol.iterator]: list_functor_core._iterator
 * }}
 */
var list_functor_core = {
    //Using getters for these properties because there's a chance the setting and/or getting
    //functionality could change; this will allow for a consistent interface while the
    //logic beneath changes

    /**
     * @description: Getter for the underlying source object of the List
     * @return: {*}
     */
    get value() {
        return this._value;
    },

    /**
     * @description: Setter for the underlying source object of the List
     * @param: val
     */
    set value(val) {
        this._value = val;
    },

    /**
     * @description:
     * @param: {@see list_core} ma
     * @param: {function} comparer
     * @return: {boolean}
     */
    equals: function _equals(ma, comparer) {
        return list_functor_core.isPrototypeOf(ma) && equals(this, ma, comparer);
    },

    /**
     * @description:
     * @param: {function} mapFunc
     * @return: {@see m_list}
     */
    map: function _map(mapFunc) {
        return this.of(this, map(this, mapFunc));
    },

    /**
     * @description:
     * @param: {function} keySelector
     * @param: {function} comparer
     * @return: {@see m_list}
     */
    groupBy: function _groupBy(keySelector, comparer) {
        var groupObj = [{ keySelector: keySelector, comparer: comparer, direction: sortDirection.ascending }];
        return this.of(this, groupBy(this, groupObj, createGroupedListDelegator));
    },

    /**
     * @description:
     * @param: {function} keySelector
     * @param: {function} comparer
     * @return: {@see m_list}
     */
    groupByDescending: function _groupByDescending(keySelector, comparer) {
        var groupObj = [{ keySelector: keySelector, comparer: comparer, direction: sortDirection.descending }];
        return this.of(this, groupBy(this, groupObj, createGroupedListDelegator));
    },

    /**
     * @description:
     * @param: {function} fn
     * @return: {@see m_list}
     */
    flatMap: function _flatMap(fn) {
        return list_functor_core.isPrototypeOf(this.value) ? this.value.map(fn) : this.of(this, flatMap(this, fn));
    },

    /**
     * @description:
     * @param: {iterable} enumerable
     * @return: {@see m_list}
     */
    addFront: function _addFront(enumerable) {
        return this.of(this, addFront(this, enumerable));
    },<commit_msg>develop: fixed list container flatmap<commit_after>import { all, any, except, intersect, union, map, flatMap, groupBy, sortBy, addFront, concat, groupJoin, join, zip, filter,
    contains, first, last, count, fold, distinct, ofType, binarySearch, equals, take, takeWhile, skip, skipWhile, reverse } from '../../list_monad/list_iterators';
import { generatorProto, sortDirection } from '../../helpers';
import { set, when, isSomething, apply, ifElse, wrap, delegatesFrom, defaultPredicate, delegatesTo, not, isArray } from '../../functionalHelpers';

/**
 * @description: Object that contains the core functionality of a List; both the m_list and ordered_m_list
 * objects delegate to this object for all functionality besides orderBy/orderByDescending
 * and thenBy/thenByDescending respectively. Getter/setters are present for state-manipulation
 * at the consumer-object level, as well as to provide default values for a consumer-level
 * object at creation if not specified.
 * @type {{
 * value,
 * value,
 * map: list_functor_core._map,
 * groupBy: list_functor_core._groupBy,
 * groupByDescending: list_functor_core._groupByDescending,
 * flatMap: list_functor_core._flatMap,
 * addFront: list_functor_core._addFront,
 * concat: list_functor_core._concat,
 * except: list_functor_core._except,
 * groupJoin: list_functor_core._groupJoin,
 * intersect: list_functor_core._intersect,
 * join: list_functor_core._join,
 * union: list_functor_core._union,
 * zip: list_functor_core._zip,
 * where: list_functor_core._where,
 * ofType: list_functor_core._ofType,
 * distinct: list_functor_core._distinct,
 * take: list_functor_core._take,
 * takeWhile: list_functor_core._takeWhile,
 * skip: list_functor_core._skip,
 * skipWhile: list_functor_core._skipWhile,
 * any: list_functor_core._any,
 * all: list_functor_core._all,
 * contains: list_functor_core._contains,
 * first: list_functor_core._first,
 * fold: list_functor_core._fold,
 * last: list_functor_core._last,
 * count: list_functor_core._count,
 * toArray: list_functor_core._toArray,
 * toSet: list_functor_core._toSet,
 * reverse: list_functor_core._reverse,
 * [Symbol.iterator]: list_functor_core._iterator
 * }}
 */
var list_functor_core = {
    //Using getters for these properties because there's a chance the setting and/or getting
    //functionality could change; this will allow for a consistent interface while the
    //logic beneath changes

    /**
     * @description: Getter for the underlying source object of the List
     * @return: {*}
     */
    get value() {
        return this._value;
    },

    /**
     * @description: Setter for the underlying source object of the List
     * @param: val
     */
    set value(val) {
        this._value = val;
    },

    /**
     * @description:
     * @param: {@see list_core} ma
     * @param: {function} comparer
     * @return: {boolean}
     */
    equals: function _equals(ma, comparer) {
        return list_functor_core.isPrototypeOf(ma) && equals(this, ma, comparer);
    },

    /**
     * @description:
     * @param: {function} mapFunc
     * @return: {@see m_list}
     */
    map: function _map(mapFunc) {
        return this.of(this, map(this, mapFunc));
    },

    /**
     * @description:
     * @param: {function} keySelector
     * @param: {function} comparer
     * @return: {@see m_list}
     */
    groupBy: function _groupBy(keySelector, comparer) {
        var groupObj = [{ keySelector: keySelector, comparer: comparer, direction: sortDirection.ascending }];
        return this.of(this, groupBy(this, groupObj, createGroupedListDelegator));
    },

    /**
     * @description:
     * @param: {function} keySelector
     * @param: {function} comparer
     * @return: {@see m_list}
     */
    groupByDescending: function _groupByDescending(keySelector, comparer) {
        var groupObj = [{ keySelector: keySelector, comparer: comparer, direction: sortDirection.descending }];
        return this.of(this, groupBy(this, groupObj, createGroupedListDelegator));
    },

    /**
     * @description:
     * @param: {function} fn
     * @return: {@see m_list}
     */
    flatMap: function _flatMap(fn) {
        return this.of(flatMap(this, fn));
    },

    /**
     * @description:
     * @param: {iterable} enumerable
     * @return: {@see m_list}
     */
    addFront: function _addFront(enumerable) {
        return this.of(this, addFront(this, enumerable));
    },
{'fraction_non_alphanumeric': 0.1193929173693086, 'fraction_numerical': 0.0, 'mean_word_length': 3.6141078838174274, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3855837', 'n_tokens_mistral': 2784, 'n_tokens_neox': 2762, 'n_words': 691}