<commit_before>/***************
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 ****************/

(function(window) {

    /**
     * Bind a function to a context, making call and apply and other properties work as if no binding was applied.
     * It is intended to be used with class methods. It is intended to automate calls to delegate, but might
     * not be applied at all, because then delegating is used even when no delegating is needed. Less performance.
     *
     * A alternative could be to make a tool to automatically set
     *     instance.delegated.method = __pc_bind_method__(instance.method, instance)
     *
     * @param func Function
     * @param context *
     * @return Function
     * @private
     */
    var __pc_bind_method__ = function(func, context) {
        var f = delegate(func, context);
        f.__pc_context__ = context;
        f.__pc_orig__ = func;
        f.call = function() {
            var context = arguments[0];
            Array.prototype.shift.call(arguments);
            return f.__pc_orig__.apply(context, arguments);
        }
        f.apply = function(context, arguments) {
            return f.__pc_orig__.apply(context, arguments);
        }
        f.toString = func.toString;
        f.length = func.length;
        return f;
    }


    /**
     * Simple logger
     */
    var log = function () {
        var stderr = document.getElementById('stderr');
        if (stderr) {
            var m = "";
            var sep = "";
            for (var i = 0; i < arguments.length; i++) {
                var v = arguments[i];
                if (typeof v == 'string') {
                    m += sep + '"' + v + '"';
                } else {
                    m += sep + v;
                }
                sep = ', ';
            }
            stderr.innerHTML += m + "<br/>";
        } else {
            try {
                console.log.apply(console, arguments);
            } catch (e) {
                var m = "";
                for (var i = 0; i < arguments.length; i++) {
                    m += arguments[i] + ", ";
                }
                alert(m);
            }
        }
    };

    /**
     * delegate a function to an object.
     * @param method {Function}
     * @param instance {Object}
     * @param [args] {Array} If provided, the function will receive this array as arguments instead of the provided by the caller.
     * @return {Function}
     */
    var delegate = function (method, instance, args) {
        if (args) {
            return function () {
                return method.apply(instance, args);
            }
        } else {
            return function () {
                return method.apply(instance, arguments);
            }
        }
    }

    var getClassName = function (classReference) {
        // search through the global object for a name that resolves to this object
        for (var name in this)
            if (this[name] == classReference)
                return name;
    }


    var __pacaclass_used_names__ = ",";

    var __pacaclass_toString__ = function() {
        return '[PacaClass: ' + this.__class__.__name__ + ']';
    }

    var __pacaclass_getSuper__ = function (requestedSuper) {

        var len = this.__class__.supers.length;
        for (var i = 0; i < len; i++) {
            var _super = this.__class__.supers[i];
            if (_super == requestedSuper) {
                return _super.prototype;<commit_msg>remove unused code add suppor for stopPropagation in native events rename stopProgapation to preventDefault in standard event<commit_after>/***************
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 ****************/

(function(window) {

    if (window.PacaClass && window.PacaClass.__rookie__) {
        throw new Error("PacaClass Rookie detected. Either use rookie version or standard version.");
    }

    /**
     * Simple logger
     */
    var log = function () {
        var stderr = document.getElementById('stderr');
        if (stderr) {
            var m = "";
            var sep = "";
            for (var i = 0; i < arguments.length; i++) {
                var v = arguments[i];
                if (typeof v == 'string') {
                    m += sep + '"' + v + '"';
                } else {
                    m += sep + v;
                }
                sep = ', ';
            }
            stderr.innerHTML += m + "<br/>";
        } else {
            try {
                console.log.apply(console, arguments);
            } catch (e) {
                var m = "";
                for (var i = 0; i < arguments.length; i++) {
                    m += arguments[i] + ", ";
                }
                alert(m);
            }
        }
    };

    /**
     * delegate a function to an object.
     * @param method {Function}
     * @param instance {Object}
     * @param [args] {Array} If provided, the function will receive this array as arguments instead of the provided by the caller.
     * @return {Function}
     */
    var delegate = function (method, instance, args) {
        if (args) {
            return function () {
                return method.apply(instance, args);
            }
        } else {
            return function () {
                return method.apply(instance, arguments);
            }
        }
    }

    var getClassName = function (classReference) {
        // search through the global object for a name that resolves to this object
        for (var name in this)
            if (this[name] == classReference)
                return name;
    }


    var __pacaclass_used_names__ = ",";

    var __pacaclass_toString__ = function() {
        return '[PacaClass: ' + this.__class__.__name__ + ']';
    }

    var __pacaclass_getSuper__ = function (requestedSuper) {

        var len = this.__class__.supers.length;
        for (var i = 0; i < len; i++) {
            var _super = this.__class__.supers[i];
            if (_super === requestedSuper) {
                return _super.prototype;
{'fraction_non_alphanumeric': 0.10164724789071916, 'fraction_numerical': 0.002008838891120932, 'mean_word_length': 1.847121616469691, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1244210', 'n_tokens_mistral': 1944, 'n_tokens_neox': 1869, 'n_words': 704}