<commit_before>var
    esPhinx,
    Iterable;


(function($) {
    "use strict";

    $.extend({
        text: function(text) {
            return $(window.document.createTextNode(text));
        }
    });

    $.prototype.extend({

        // <br>|<br\/>
        // text: function() {
        // },

        append: function(node) {
            var
                nodes,
                element,

                nodesIteratorBlock = function(node) {
                    element.appendChild(node);
                },

                callback = function(e) {
                    element = e;
                    nodes.each(nodesIteratorBlock);
                };

            nodes = $(node);

            if (!nodes.some()) {
                nodes = esPhinx(window.document.createTextNode(node));
            }

            this.each(callback);

            return this;
        },

        prepend: function(node) {
            var
                firstNode,

                callback = function(element) {
                    firstNode = $(element).firstNode();
                    if (firstNode.some()) {
                        node.insertBefore(firstNode);
                    } else {
                        $(element).append(node);
                    }
                };

            node = $(node);
            if (!node.some()) {
                node = $(window.document.createTextNode(node));
            }

            this.each(callback);

            return this;
        },

        textContent: function() {
            var
                tagName = this.tagName(),
                node = this.asNode();

            if (tagName != "pre") {
                return node.textContent.replace(/\n[ \t]*/g, "")
                    .replace(/(\n){2,}/g, "");
            }

            return node.textContent;
        },

        insertAfter: function(element) {
            var
                elements = $(element),
                element2Insert,

                elementsIteratorBlock = function(element) {
                    // element = $(element);
                    // sibling = element.next();
                    // debugger
                    // if (sibling.some()) {
                    //     $(element).insertBefore(sibling);
                    // } else {
                    //     element.parent().append(element);
                    // }
                    element.parentNode.insertBefore(element2Insert,
                                                    element.nextSibling);
                },

                callback = function(e2I) {
                    element2Insert = e2I;
                    elements.each(elementsIteratorBlock);
                };

            this.each(callback);

            return this;
        },

        insertBefore: function(element) {
            var
                elements = $(element),
                element2Insert,

                elementsIteratorBlock = function(element) {
                    element.parentNode.insertBefore(element2Insert, element);
                },

                callback = function(e2I) {
                    element2Insert = e2I;
                    elements.each(elementsIteratorBlock);
                };

            this.each(callback);

            return this;
        },

        // "extends?" would make more sense in the relationship between classes
        isA: function(constructor) {
            return this.asNode() instanceof constructor;
        },

        // remove: function(object, delay = 0) {
        remove: function(object, delay) {
            if (typeof delay != "number") {delay = 0;}

            var
                self = this,

                callback = function(element) {
                    element.parentElement.removeChild(element);
                };

            if (typeof object == "number") {
                delay = object;
                object = undefined;
            }

            if (object) {
                // recursivity
                $(object).remove(delay);
            } else {
                if (typeof delay != "number") {
                    delay = 0;
                }

                window.setTimeout(function() {
                    self.each(callback);
                }, delay);
            }

            return self;
        },

        clean: function() {
            var
                callback = function(element) {
                    element.innerHTML = null;
                };

            this.each(callback);
<commit_msg>fix remove<commit_after>var
    esPhinx,
    Iterable;


(function($) {
    "use strict";

    $.extend({
        text: function(text) {
            return $(window.document.createTextNode(text));
        }
    });

    $.prototype.extend({

        // <br>|<br\/>
        // text: function() {
        // },

        insertAfter: function(element) {
            var
                elements = $(element),
                element2Insert,

                elementsIteratorBlock = function(element) {
                    // element = $(element);
                    // sibling = element.next();
                    // debugger
                    // if (sibling.some()) {
                    //     $(element).insertBefore(sibling);
                    // } else {
                    //     element.parent().append(element);
                    // }
                    element.parentNode.insertBefore(element2Insert,
                                                    element.nextSibling);
                },

                callback = function(e2I) {
                    element2Insert = e2I;
                    elements.each(elementsIteratorBlock);
                };

            this.each(callback);

            return this;
        },

        insertBefore: function(element) {
            var
                elements = $(element),
                element2Insert,

                elementsIteratorBlock = function(element) {
                    element.parentNode.insertBefore(element2Insert, element);
                },

                callback = function(e2I) {
                    element2Insert = e2I;
                    elements.each(elementsIteratorBlock);
                };

            this.each(callback);

            return this;
        },

        append: function(node) {
            var
                nodes,
                element,

                nodesIteratorBlock = function(node) {
                    element.appendChild(node);
                },

                callback = function(e) {
                    element = e;
                    nodes.each(nodesIteratorBlock);
                };

            nodes = $(node);

            if (!nodes.some()) {
                nodes = esPhinx(window.document.createTextNode(node));
            }

            this.each(callback);

            return this;
        },

        prepend: function(node) {
            var
                firstNode,

                callback = function(element) {
                    firstNode = $(element).firstNode();
                    if (firstNode.some()) {
                        node.insertBefore(firstNode);
                    } else {
                        $(element).append(node);
                    }
                };

            node = $(node);
            if (!node.some()) {
                node = $(window.document.createTextNode(node));
            }

            this.each(callback);

            return this;
        },

        textContent: function() {
            var
                tagName = this.tagName(),
                node = this.asNode();

            if (tagName != "pre") {
                return node.textContent.replace(/\n[ \t]*/g, "")
                    .replace(/(\n){2,}/g, "");
            }

            return node.textContent;
        },

        // "extends?" would make more sense in the relationship between classes
        isA: function(constructor) {
            return this.asNode() instanceof constructor;
        },

        // remove: function(object, delay = 0) {
        remove: function(object, delay) {
            if (typeof delay != "number") {delay = 0;}

            var
                self = this,

                remove = function(element) {
                    element.remove();
                },

                resolveArguments = function() {
                    if (typeof object == "number") {
                        delay = object;
                        object = undefined;
                    } else if (typeof delay != "number") {
                        delay = 0;
                    }
                };

            resolveArguments();

            if (object) {
                // recursivity
                $(object).remove(delay);
            } else {
                if (delay) {
                    window.setTimeout(function() {
                        self.each(remove);
                    }, delay);
                } else {
                    self.each(remove);
                }
            }


            return self;
        },

        clean: function() {
            var
                callback = function(element) {
                    element.innerHTML = null;
                };

            this.each(callback);

{'fraction_non_alphanumeric': 0.10759425299773144, 'fraction_numerical': 0.0030247380360808036, 'mean_word_length': 0.9539890249050232, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2542004', 'n_tokens_mistral': 2218, 'n_tokens_neox': 1999, 'n_words': 385}