<commit_before>"use strict";
/*
 * gconfig
 * https://github.com/goliatone/gconfig
 *
 * Copyright (c) 2013 goliatone
 * Licensed under the MIT license.
 */
/* jshint strict: false, plusplus: true */
/*global define: false, require: false, module: false, exports: false */
(function(root, name, deps, factory) {

    // Node
    if (typeof deps === 'function') {
        factory = deps;
        deps = [];
    }

    if (typeof exports === 'object') {
        module.exports = factory.apply(root, deps.map(require));
    } else if (typeof define === 'function' && 'amd' in define) {
        //require js, here we assume the file is named as the lower
        //case module name.
        define(name.toLowerCase(), deps, factory);
    } else {
        // Browser
        var d, i = 0,
            global = root,
            old = global[name],
            mod;
        while ((d = deps[i]) !== undefined) deps[i++] = root[d];
        global[name] = mod = factory.apply(global, deps);
        //Export no 'conflict module', aliases the module.
        mod.noConflict = function() {
            global[name] = old;
            return mod;
        };
    }
}(this, 'GConfig', function() {

    /**
     * Extend method.
     * @param  {Object} target Source object
     * @return {Object}        Resulting object from
     *                         meging target to params.
     */
    var _extend = function extend(target) {
        var sources = [].slice.call(arguments, 1);
        sources.forEach(function(source) {
            for (var property in source) {
                if (source[property] && source[property].constructor &&
                    source[property].constructor === Object) {
                    target[property] = target[property] || {};
                    target[property] = extend(target[property], source[property]);
                } else target[property] = source[property];
            }
        });
        return target;
    };

    /**
     * Plug in implementation.
     * @param  {Function|Object} ext Plug in object.
     * @param  {Function|Object} src
     * @return {void}
     */
    var _using = function(ext, src, options) {
        if (typeof ext === 'function') ext(src, options);
        else if (ext && typeof ext.register === 'function') ext.register(src, options);
        else if (typeof ext === 'object') _extend(src, ext);
    };

    /**
     *
     * Based on [async-foreach]:https://github.com/cowboy/javascript-sync-async-foreach
     * @param  {Array}   arr
     * @param  {Function} done Callback
     * @return {void}
     */
    var _map = function(arr, done /*, ...rest*/ ) {
        var i = -1,
            len = arr.length,
            args = Array.prototype.slice.call(arguments, 2);
        (function next(result) {
            var each,
                async,
                abort = (typeof result === 'boolean');

            do {
                ++i;
            } while (!(i in arr) && i !== len);

            if (abort || i === len) {
                if (done) return done(result);
            }

            each = arr[i];
            result = each.apply({
                async: function() {
                    async = true;
                    return next;
                }
            }, args);

            if (!async) next(result);
        }());
    };

    /**
     * Shim console, make sure that if no console
     * available calls do not generate errors.
     * @return {Object} Console shim.
     */
    var _shimConsole = function(console) {

        if(console) return console;

        var empty = {},
            con = {},
            noop = function() {},
            properties = 'memory'.split(','),
            methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +
                'groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,' +
                'table,time,timeEnd,timeStamp,trace,warn').split(','),
            prop,
            method;

        while (method = methods.pop()) con[method] = noop;
        while (prop = properties.pop()) con[prop] = empty;

        return con;
    };

    var _shimRequire = function(){
        var loader = function(){};
        try{
            loader = require;
        }catch(e){
            console && console.warn('No require found');
        }

        return loader;
    };

    ///////////////////////////////////////////////////
    // CONSTRUCTOR
    ///////////////////////////////////////////////////

    var DEFAULTS = {
        namespace: 'app',
        autoinitialize: true
    };

    /**
     * GConfig constructor
     *
     * @param  {object} config Configuration object.
     */
    var GConfig = function(config) {

        config = config || {};

        config = _extend({}, this.constructor.DEFAULTS, config);

        this.data = config.data || {};

        this.namespaces = [];
        this.options = config;
        this.namespace = config.namespace;

        //TODO: Should we do methods instead of strings?
        this.loaders = this.loaders || [];

        this.initialized = false;

        if (config.autoinitialize) this.init(config);
    };

    GConfig.VERSION = '0.6.14';

    /**
     * GConfig default config object.
     */
    GConfig.defaults =
    GConfig.DEFAULTS = DEFAULTS;<commit_msg>gconfig.js: Bump<commit_after>"use strict";
/*
 * gconfig
 * https://github.com/goliatone/gconfig
 *
 * Copyright (c) 2013 goliatone
 * Licensed under the MIT license.
 */
/* jshint strict: false, plusplus: true */
/*global define: false, require: false, module: false, exports: false */
(function(root, name, deps, factory) {

    // Node
    if (typeof deps === 'function') {
        factory = deps;
        deps = [];
    }

    if (typeof exports === 'object') {
        module.exports = factory.apply(root, deps.map(require));
    } else if (typeof define === 'function' && 'amd' in define) {
        //require js, here we assume the file is named as the lower
        //case module name.
        define(name.toLowerCase(), deps, factory);
    } else {
        // Browser
        var d, i = 0,
            global = root,
            old = global[name],
            mod;
        while ((d = deps[i]) !== undefined) deps[i++] = root[d];
        global[name] = mod = factory.apply(global, deps);
        //Export no 'conflict module', aliases the module.
        mod.noConflict = function() {
            global[name] = old;
            return mod;
        };
    }
}(this, 'GConfig', function() {

    /**
     * Extend method.
     * @param  {Object} target Source object
     * @return {Object}        Resulting object from
     *                         meging target to params.
     */
    var _extend = function extend(target) {
        var sources = [].slice.call(arguments, 1);
        sources.forEach(function(source) {
            for (var property in source) {
                if (source[property] && source[property].constructor &&
                    source[property].constructor === Object) {
                    target[property] = target[property] || {};
                    target[property] = extend(target[property], source[property]);
                } else target[property] = source[property];
            }
        });
        return target;
    };

    /**
     * Plug in implementation.
     * @param  {Function|Object} ext Plug in object.
     * @param  {Function|Object} src
     * @return {void}
     */
    var _using = function(ext, src, options) {
        if (typeof ext === 'function') ext(src, options);
        else if (ext && typeof ext.register === 'function') ext.register(src, options);
        else if (typeof ext === 'object') _extend(src, ext);
    };

    /**
     *
     * Based on [async-foreach]:https://github.com/cowboy/javascript-sync-async-foreach
     * @param  {Array}   arr
     * @param  {Function} done Callback
     * @return {void}
     */
    var _map = function(arr, done /*, ...rest*/ ) {
        var i = -1,
            len = arr.length,
            args = Array.prototype.slice.call(arguments, 2);
        (function next(result) {
            var each,
                async,
                abort = (typeof result === 'boolean');

            do {
                ++i;
            } while (!(i in arr) && i !== len);

            if (abort || i === len) {
                if (done) return done(result);
            }

            each = arr[i];
            result = each.apply({
                async: function() {
                    async = true;
                    return next;
                }
            }, args);

            if (!async) next(result);
        }());
    };

    /**
     * Shim console, make sure that if no console
     * available calls do not generate errors.
     * @return {Object} Console shim.
     */
    var _shimConsole = function(console) {

        if(console) return console;

        var empty = {},
            con = {},
            noop = function() {},
            properties = 'memory'.split(','),
            methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +
                'groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,' +
                'table,time,timeEnd,timeStamp,trace,warn').split(','),
            prop,
            method;

        while (method = methods.pop()) con[method] = noop;
        while (prop = properties.pop()) con[prop] = empty;

        return con;
    };

    var _shimRequire = function(){
        var loader = function(){};
        try{
            loader = require;
        }catch(e){
            console && console.warn('No require found');
        }

        return loader;
    };

    ///////////////////////////////////////////////////
    // CONSTRUCTOR
    ///////////////////////////////////////////////////

    var DEFAULTS = {
        namespace: 'app',
        autoinitialize: true
    };

    /**
     * GConfig constructor
     *
     * @param  {object} config Configuration object.
     */
    var GConfig = function(config) {

        config = config || {};

        config = _extend({}, this.constructor.DEFAULTS, config);

        this.data = config.data || {};

        this.namespaces = [];
        this.options = config;
        this.namespace = config.namespace;

        //TODO: Should we do methods instead of strings?
        this.loaders = this.loaders || [];

        this.initialized = false;

        if (config.autoinitialize) this.init(config);
    };

    GConfig.VERSION = '0.6.15';

    /**
     * GConfig default config object.
     */
    GConfig.defaults =
    GConfig.DEFAULTS = DEFAULTS;
{'fraction_non_alphanumeric': 0.15507970946137156, 'fraction_numerical': 0.002263937364399585, 'mean_word_length': 1.6171315724512465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6561642', 'n_tokens_mistral': 2953, 'n_tokens_neox': 2851, 'n_words': 754}