<commit_before>define(["inherit"], function(inherit){

    var cid = 0,
        emptyCallback = function() {};

    var Base = inherit.Base.inherit("js.core.Base",{

        ctor: function () {
            // generate unique id
            this.$cid = ++cid;

        },

        /***
         * determinate if the application runs in the browser or on node
         *
         * @return {Boolean} true if the application runs in a browser
         */
        runsInBrowser: function () {
            return typeof window !== "undefined";
        },

        emptyCallback: function() {
            return emptyCallback;
        },

        /***
         * logs messages to configured logging functions
         *
         * @param {String|Array} message the message to log
         * @param {String} [level="info"] the service level of (debug, info, warn, error)
         */
        log: function(message, level) {
            level = level || Base.LOGLEVEL.INFO;

            if (message instanceof Error) {
                message = message.toString() + (message.stack || "");
            }

            if (Base.logger.length) {
                for (var i = 0; i < Base.logger.length; i++) {
                    Base.logger[i].log(message, level);
                }
            } else if (typeof console !== "undefined") {
                var method = (console[level] || console.log);
                if(method){
                    try {
                        method.call(console, "[ " + (new Date()) + " ]: ", message);
                    } catch (e) {
                        // nothing to do here
                    }
                }
            }
        }
    });

    Base.logger = [];
    Base.LOGLEVEL = {
        DEBUG: 'debug',
        INFO: 'info',<commit_msg>added _callFunctionDelayed -> to make debounced function call<commit_after>define(["inherit"], function(inherit){

    var cid = 0,
        emptyCallback = function() {};

    var Base = inherit.Base.inherit("js.core.Base",{

        ctor: function () {
            this.$functionTimeoutMap = {};
            // generate unique id
            this.$cid = ++cid;

        },

        /***
         * determinate if the application runs in the browser or on node
         *
         * @return {Boolean} true if the application runs in a browser
         */
        runsInBrowser: function () {
            return typeof window !== "undefined";
        },

        emptyCallback: function() {
            return emptyCallback;
        },

        /***
         * logs messages to configured logging functions
         *
         * @param {String|Array} message the message to log
         * @param {String} [level="info"] the service level of (debug, info, warn, error)
         */
        log: function(message, level) {
            level = level || Base.LOGLEVEL.INFO;

            if (message instanceof Error) {
                message = message.toString() + (message.stack || "");
            }

            if (Base.logger.length) {
                for (var i = 0; i < Base.logger.length; i++) {
                    Base.logger[i].log(message, level);
                }
            } else if (typeof console !== "undefined") {
                var method = (console[level] || console.log);
                if(method){
                    try {
                        method.call(console, "[ " + (new Date()) + " ]: ", message);
                    } catch (e) {
                        // nothing to do here
                    }
                }
            }
        },
        /***
         *
         * @param {Function} fnc - the function to call
         * @param {Number} delay - delay in ms
         * @private
         */
        _callFunctionDelayed: function(fnc, delay){
            delay = delay || 300;
            var key = fnc.toString();
            this.$functionTimeoutMap[key] && clearTimeout(this.$functionTimeoutMap[key]);

            this.$functionTimeoutMap[key] = setTimeout(fnc,delay);
        }

    });

    Base.logger = [];
    Base.LOGLEVEL = {
        DEBUG: 'debug',
        INFO: 'info',
{'fraction_non_alphanumeric': 0.125365141187926, 'fraction_numerical': 0.0017039922103213243, 'mean_word_length': 1.3628522139160437, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '569639', 'n_tokens_mistral': 1062, 'n_tokens_neox': 1015, 'n_words': 279}