<commit_before>var
    esPhinx;

(function ($) {
    "use strict";

    $.extend({

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

        prototype: {

            attribute: function (attrName, value) {
                var
                    node = this.asNode(),
                    attr;


                if (this.length === 0) {
                    return this;
                }

                if (typeof value === "boolean" || value || value === "") {
                    this.each(function (node) {
                        node.setAttribute(attrName, value);
                    });

                    return this;
                } else {
                    attr = node.getAttribute(attrName);
                    if (attr) {
                        return attr;
                    }
                }

                return undefined;
            },

            property: function (propertyName, value) {
                var
                    node = this.asNode();

                if (this.length === 0) {
                    return this;
                }

                if (typeof value === "boolean" || value || value === "") {
                    this.each(function (node) {
                        node[propertyName] = value;
                    });

                    return this;
                } else {
                    if (node[propertyName] ||
                        typeof node[propertyName] === "boolean") {
                        return node[propertyName];
                    }
                }

                return undefined;
            },

            tagName: function () {
                if (this.some() && this.asNode() instanceof Element) {
                    return this.property("tagName").toLowerCase();
                }

                return "";
            },

            focus: function () {
                this.asNode().focus();
                return this;
            },

            select: function (start, end) {
                if (Number.isNaN(start)) {start = 0;}
            // select: function (start = 0, end) {
                var
                    mainReference = this,
                    asNode = mainReference.asNode(),
                    aux;

                if (asNode instanceof HTMLInputElement &&
                    !(asNode instanceof HTMLSelectElement)) {
                    if (!end && typeof end !== "number") {
                        end = parseInt(mainReference.value().length);
                    }

                    if (end < start) {
                        aux = start;
                        start = end;
                        end = aux;
                    }

                    asNode.setSelectionRange(start, end);
                    mainReference.focus();

                    return mainReference;
                }

                return mainReference.property("selected", true);
            },

            unselect: function () {
                return this.property("selected", false);
            },

            removeClass: function (classList) {
                var
                    currentClassList,
                    pattern,
                    removed;

                if (arguments.length > 1) {
                    classList = Array.from(arguments);
                    pattern = new RegExp("\\b((" + classList
                        .join(")|(")  + "))(?=(\\b| ))", "g");
                } else {
                    pattern = new RegExp("\\b((" + classList.split(" ")
                        .join(")|(") + "))(?=(\\b| ))", "g");
                }

                this.each(function (node) {
                    currentClassList = $(node).attribute("class");
                    removed = currentClassList.replace(pattern, "");
                    $(node).attribute("class", removed.replace(/(  )+/g, " ")
                        .trim());
                });

                return this;
            },

            addClass: function (classList) {
                var
                    currentClassList,
                    asString;

                if (arguments.length > 1) {
                    classList = Array.from(arguments);
                    asString = classList.join(" ");
                } else if (typeof classList === "string") {
                    asString = classList;
                }

                this.each(function (node) {
                    currentClassList = $(node).attribute("class") || "";
                    $(node).attribute("class", (currentClassList + " " +
                                                asString).trim());
                });

                return this;
            },

            check: function () {
                return this.property("checked", true);
            },

            uncheck: function () {
                return this.property("checked", false);
            },

            removeAttr: function (attrName) {
                this.each(function (node) {
                    node.removeAttribute(attrName);
                });

                return this;
            },

            html: function (content) {
                this.clean();
                this.append(content);

                return this;
            }

        }

    });<commit_msg>fix html method<commit_after>var
    esPhinx;

(function ($) {
    "use strict";

    $.extend({

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

        prototype: {

            attribute: function (attrName, value) {
                var
                    node = this.asNode(),
                    attr;


                if (this.length === 0) {
                    return this;
                }

                if (typeof value === "boolean" || value || value === "") {
                    this.each(function (node) {
                        node.setAttribute(attrName, value);
                    });

                    return this;
                } else {
                    attr = node.getAttribute(attrName);
                    if (attr) {
                        return attr;
                    }
                }

                return undefined;
            },

            property: function (propertyName, value) {
                var
                    node = this.asNode();

                if (this.length === 0) {
                    return this;
                }

                if (typeof value === "boolean" || value || value === "") {
                    this.each(function (node) {
                        node[propertyName] = value;
                    });

                    return this;
                } else {
                    if (node[propertyName] ||
                        typeof node[propertyName] === "boolean") {
                        return node[propertyName];
                    }
                }

                return undefined;
            },

            tagName: function () {
                if (this.some() && this.asNode() instanceof Element) {
                    return this.property("tagName").toLowerCase();
                }

                return "";
            },

            focus: function () {
                this.asNode().focus();
                return this;
            },

            select: function (start, end) {
                if (Number.isNaN(start)) {start = 0;}
            // select: function (start = 0, end) {
                var
                    mainReference = this,
                    asNode = mainReference.asNode(),
                    aux;

                if (asNode instanceof HTMLInputElement &&
                    !(asNode instanceof HTMLSelectElement)) {
                    if (!end && typeof end !== "number") {
                        end = parseInt(mainReference.value().length);
                    }

                    if (end < start) {
                        aux = start;
                        start = end;
                        end = aux;
                    }

                    asNode.setSelectionRange(start, end);
                    mainReference.focus();

                    return mainReference;
                }

                return mainReference.property("selected", true);
            },

            unselect: function () {
                return this.property("selected", false);
            },

            removeClass: function (classList) {
                var
                    currentClassList,
                    pattern,
                    removed;

                if (arguments.length > 1) {
                    classList = Array.from(arguments);
                    pattern = new RegExp("\\b((" + classList
                        .join(")|(")  + "))(?=(\\b| ))", "g");
                } else {
                    pattern = new RegExp("\\b((" + classList.split(" ")
                        .join(")|(") + "))(?=(\\b| ))", "g");
                }

                this.each(function (node) {
                    currentClassList = $(node).attribute("class");
                    removed = currentClassList.replace(pattern, "");
                    $(node).attribute("class", removed.replace(/(  )+/g, " ")
                        .trim());
                });

                return this;
            },

            addClass: function (classList) {
                var
                    currentClassList,
                    asString;

                if (arguments.length > 1) {
                    classList = Array.from(arguments);
                    asString = classList.join(" ");
                } else if (typeof classList === "string") {
                    asString = classList;
                }

                this.each(function (node) {
                    currentClassList = $(node).attribute("class") || "";
                    $(node).attribute("class", (currentClassList + " " +
                                                asString).trim());
                });

                return this;
            },

            check: function () {
                return this.property("checked", true);
            },

            uncheck: function () {
                return this.property("checked", false);
            },

            removeAttr: function (attrName) {
                this.each(function (node) {
                    node.removeAttribute(attrName);
                });

                return this;
            },

            html: function (content) {
                if (typeof content == "string") {
                    this.elements().each(function (element) {
                        element.innerHTML = content;
                    });
                } else {
                    this.clean();
                    this.append(content);
                }

                return this;
            }

        }

    });
{'fraction_non_alphanumeric': 0.11379879054425508, 'fraction_numerical': 0.0010995052226498076, 'mean_word_length': 0.8783341937704354, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1874239', 'n_tokens_mistral': 2552, 'n_tokens_neox': 2253, 'n_words': 497}