<commit_before>(function ($) {
    "use strict";

    try {
        Object.defineProperties($.prototype, {
            intersection: {
                value: function () {
                    var
                        i,
                        self = this,
                        args = [],
                        intersects = [];

                    if (arguments.length > 0) {
                        for (i in arguments) {
                            if (arguments.hasOwnProperty(i)) {
                                args.push((arguments[i]).uniq());
                            }
                        }
                    } else if (self.length > 0) {
                        self.forEach(function (v) {
                            args.push(v.uniq());
                        });
                    } else {
                        return [];
                    }

                    intersects = args.asc().reduce(function (prev, curr, i) {
                        if (i == 1) {
                            intersects = prev.filter(function (v) {
                                // returns to filter method
                                return curr.indexOf(v) > -1;
                            });
                        } else {
                            intersects = intersects.filter(function (v) {
                                return curr.indexOf(v) > -1;
                            });
                        }
                        //console.log(i);
                        //console.log(intersects);
                        // returns to reduce
                        return intersects;
                    });

                    return intersects;
                }
            },

            areMultiples: {
                value: function () {
                    var
                        clone = this.clone();

                    clone.shift();
                    return Number.prototype.areMultiples.apply(this[0], clone);
                }
            }

        });

    } catch(e) {}

})(Array);
<commit_msg>refactor intersects<commit_after>(function ($) {
    "use strict";

    try {
        Object.defineProperties($.prototype, {
            intersection: {
                value: function () {
                    var
                        i,
                        current,
                        acumulator,
                        self = this.uniq(),
                        args = [],
                        intersects = [];

                    if (arguments.length > 0) {
                        for (i in arguments) {
                            if (arguments.hasOwnProperty(i)) {
                                args.push((arguments[i]).uniq());
                            }
                        }
                    } else {
                        return [];
                    }

                    intersects = args.asc().reduce(
                        function(aux, value, i) {

                        if (i === 0) {
                            current = self;
                            acumulator = value;
                        } else {
                            current = value;
                            acumulator = aux.clone();
                        }

                        if (args.length -1 == i) {
                            aux = [];
                        }

                        aux.push(current.filter(function (v) {
                            return acumulator.indexOf(v) != -1;
                        }));

                        return aux.flatten();

                    }, []);

                    return intersects.asc();
                }
            },

            areMultiples: {
                value: function () {
                    var
                        clone = this.clone();

                    clone.shift();
                    return Number.prototype.areMultiples.apply(this[0], clone);
                }
            }

        });

    } catch(e) {}

})(Array);

{'fraction_non_alphanumeric': 0.09750623441396508, 'fraction_numerical': 0.002743142144638404, 'mean_word_length': 0.6140845070422535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3867422', 'n_tokens_mistral': 896, 'n_tokens_neox': 793, 'n_words': 151}