<commit_before>if (!window.ace)
    ace = {};

ace.provide = function(namespace) {
    var parts = namespace.split(".");
    var obj = window;
    for (var i=0; i<parts.length; i++) {
        var part = parts[i];
        if (!obj[part]) {
            obj[part] = {};
        }
        obj = obj[part];
    }
};

ace.inherits = function(ctor, superCtor) {
    var tempCtor = function() {};
    tempCtor.prototype = superCtor.prototype;
    ctor.super_ = superCtor.prototype;
    ctor.prototype = new tempCtor();
    ctor.prototype.constructor = ctor;
};

ace.implement = function(proto, mixin) {
    mixin.call(proto);
};

ace.addListener = function(elem, type, callback) {
    if (elem.addEventListener) {
        return elem.addEventListener(type, callback, false);
    }
    if (elem.attachEvent) {
        var wrapper = function() {
            callback(window.event);
        };
        callback.$$wrapper = wrapper;
        elem.attachEvent("on" + type, wrapper);
    }
};

ace.removeListener = function(elem, type, callback) {
    if (elem.removeEventListener) {
        return elem.removeEventListener(type, callback, false);
    }
    if (elem.detachEvent) {
        elem.detachEvent("on" + type, callback.$$wrapper || callback);
    }
};

ace.setText = function(elem, text) {
    if (elem.innerText !== undefined) {
        elem.innerText = text;
    }
    if (elem.textContent !== undefined) {
        elem.textContent = text;
    }
};

ace.stopEvent = function(e) {
    ace.stopPropagation(e);
    ace.preventDefault(e);
    return false;
};

ace.stopPropagation = function(e) {
    if (e.stopPropagation)
        e.stopPropagation();
    else
        e.cancelBubble = true;
};

ace.preventDefault = function(e) {
    if (e.preventDefault)
        e.preventDefault();
    else
        e.returnValue = false;
};


ace.hasCssClass = function(el, name) {
    var classes = el.className.split(/\s*/g);
    return ace.arrayIndexOf(classes, name) !== -1;
};


ace.addCssClass = function(el, name) {
    if (!ace.hasCssClass(el, name)) {
        el.className += " " + name;
    }
};

ace.removeCssClass = function(el, name) {
    var classes = el.className.split(/\s+/g);
    while (true) {
        var index = ace.arrayIndexOf(classes, name);
        if (index == -1) {
            break;
        }
        classes.splice(index, 1);
    }
    el.className = classes.join(" ");
};

ace.getInnerWidth = function(element) {
    return (parseInt(ace.computedStyle(element, "paddingLeft"))
            + parseInt(ace.computedStyle(element, "paddingRight")) + element.clientWidth);
};

ace.getInnerHeight = function(element) {
    return (parseInt(ace.computedStyle(element, "paddingTop"))
            + parseInt(ace.computedStyle(element, "paddingBottom")) + element.clientHeight);
};

ace.computedStyle = function(element, style) {
    if (window.getComputedStyle) {
        return (window.getComputedStyle(element, null))[style];
    }
    else {
        return element.currentStyle[style];
    }
};

ace.scrollbarWidth = function(parent) {
    var el = document.createElement("div");
    var style = el.style;

    style.position = "absolute";
    style.left = "-10000px";
    style.overflow = "scroll";
    style.width = "100px";

    (parent || document.body).appendChild(el);
    var width = el.offsetWidth - el.clientWidth;
    document.body.removeChild(el);

    return width;
};

ace.stringReverse = function(string) {
    return string.split("").reverse().join("");
};

if (Array.prototype.indexOf) {
    ace.arrayIndexOf = function(array, searchElement) {
        return array.indexOf(searchElement);
    };
}
else {
    ace.arrayIndexOf = function(array, searchElement) {
        for (var i=0; i<array.length; i++) {
            if (array[i] == searchElement) {<commit_msg>update "scrollbarWidth()" function to work in IE<commit_after>if (!window.ace)
    ace = {};

ace.provide = function(namespace) {
    var parts = namespace.split(".");
    var obj = window;
    for (var i=0; i<parts.length; i++) {
        var part = parts[i];
        if (!obj[part]) {
            obj[part] = {};
        }
        obj = obj[part];
    }
};

ace.inherits = function(ctor, superCtor) {
    var tempCtor = function() {};
    tempCtor.prototype = superCtor.prototype;
    ctor.super_ = superCtor.prototype;
    ctor.prototype = new tempCtor();
    ctor.prototype.constructor = ctor;
};

ace.implement = function(proto, mixin) {
    mixin.call(proto);
};

ace.addListener = function(elem, type, callback) {
    if (elem.addEventListener) {
        return elem.addEventListener(type, callback, false);
    }
    if (elem.attachEvent) {
        var wrapper = function() {
            callback(window.event);
        };
        callback.$$wrapper = wrapper;
        elem.attachEvent("on" + type, wrapper);
    }
};

ace.removeListener = function(elem, type, callback) {
    if (elem.removeEventListener) {
        return elem.removeEventListener(type, callback, false);
    }
    if (elem.detachEvent) {
        elem.detachEvent("on" + type, callback.$$wrapper || callback);
    }
};

ace.setText = function(elem, text) {
    if (elem.innerText !== undefined) {
        elem.innerText = text;
    }
    if (elem.textContent !== undefined) {
        elem.textContent = text;
    }
};

ace.stopEvent = function(e) {
    ace.stopPropagation(e);
    ace.preventDefault(e);
    return false;
};

ace.stopPropagation = function(e) {
    if (e.stopPropagation)
        e.stopPropagation();
    else
        e.cancelBubble = true;
};

ace.preventDefault = function(e) {
    if (e.preventDefault)
        e.preventDefault();
    else
        e.returnValue = false;
};


ace.hasCssClass = function(el, name) {
    var classes = el.className.split(/\s*/g);
    return ace.arrayIndexOf(classes, name) !== -1;
};


ace.addCssClass = function(el, name) {
    if (!ace.hasCssClass(el, name)) {
        el.className += " " + name;
    }
};

ace.removeCssClass = function(el, name) {
    var classes = el.className.split(/\s+/g);
    while (true) {
        var index = ace.arrayIndexOf(classes, name);
        if (index == -1) {
            break;
        }
        classes.splice(index, 1);
    }
    el.className = classes.join(" ");
};

ace.getInnerWidth = function(element) {
    return (parseInt(ace.computedStyle(element, "paddingLeft"))
            + parseInt(ace.computedStyle(element, "paddingRight")) + element.clientWidth);
};

ace.getInnerHeight = function(element) {
    return (parseInt(ace.computedStyle(element, "paddingTop"))
            + parseInt(ace.computedStyle(element, "paddingBottom")) + element.clientHeight);
};

ace.computedStyle = function(element, style) {
    if (window.getComputedStyle) {
        return (window.getComputedStyle(element, null))[style];
    }
    else {
        return element.currentStyle[style];
    }
};

ace.scrollbarWidth = function() {

    var inner = document.createElement('p');
    inner.style.width = "100%";
    inner.style.height = "200px";

    var outer = document.createElement("div");
    var style = outer.style;

    style.position = "absolute";
    style.left = "-10000px";
    style.overflow = "hidden";
    style.width = "200px";
    style.height = "150px";

    outer.appendChild(inner);
    document.body.appendChild(outer);
    var noScrollbar = inner.offsetWidth;

    style.overflow = "scroll";
    var withScrollbar = inner.offsetWidth;

    if (noScrollbar == withScrollbar) {
        withScrollbar = outer.clientWidth;
    }

    document.body.removeChild(outer);

    return noScrollbar-withScrollbar;
};

ace.stringReverse = function(string) {
    return string.split("").reverse().join("");
};

if (Array.prototype.indexOf) {
    ace.arrayIndexOf = function(array, searchElement) {
        return array.indexOf(searchElement);
    };
}
else {
    ace.arrayIndexOf = function(array, searchElement) {
        for (var i=0; i<array.length; i++) {
            if (array[i] == searchElement) {
{'fraction_non_alphanumeric': 0.15060392551585305, 'fraction_numerical': 0.004403623553095118, 'mean_word_length': 2.7870414483087185, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7603234', 'n_tokens_mistral': 2524, 'n_tokens_neox': 2499, 'n_words': 480}