<commit_before>'use strict';

var define = define ? define : require('amdefine')(module);

define(function(require) {
    /**
     * Module dependencies.
     */
    var utils = module.isClient
            ? require('danf/utils')
            : require('./utils'),
        objectsContainer = {
            has: function(id) {
                return undefined !== this.objects[id] ? true : false;
            },
            get: function(id) {
                if (!this.has(id)) {
                    throw new Error('The object "{0}" is not defined.'.format(id))
                }

                return this.objects[id];
            },
            set: function(id, object) {
                this.objects[id] = object;
            }
        }
    ;

    objectsContainer.objects = {};

    /**
     * Initialize a new framework.
     */
    function Framework() {
        this._initializers = [];
        this._objects = {};
        this.objectsContainer = objectsContainer;
    }

    /**
     * The object container.
     */
    Object.defineProperty(Framework.prototype, 'objectsContainer', {
        get: function() { return this._objectsContainer; },
        set: function(objectsContainer) { this._objectsContainer = objectsContainer; }
    });

    /**
     * Add an initializer.
     *
     * @param {object} initializer The initializer.
     * @api public
     */
    Framework.prototype.addInitializer = function(initializer) {
        this._initializers.push(initializer);
    }

    /**
     * Whether or not an object has been instanciated.
     *
     * @param {String} id The id of the object.
     * @api public
     */
    Framework.prototype.has = function(id) {
        return this._objectsContainer.has(id);
    }

    /**
     * Get an object.
     *
     * @param {String} id The id of the service.
     * @return {Object} The service object.
     * @api public
     */
    Framework.prototype.get = function(id) {
        return this._objectsContainer.get(id);
    }

    /**
     * Set an object.
     *
     * @param {String} id The id of the object.
     * @param {Object} service The object.
     * @api public
     */
    Framework.prototype.set = function(id, object) {
        this._objectsContainer.set(id, object);
    }

    /**
     * Build the framework.
     *
     * @param {object} configuration The application danf configuration.
     * @param {object} context The application context.
     * @api public
     */
    Framework.prototype.build = function(configuration, context) {
        // Instantiate objects.
        for (var i = 0; i < this._initializers.length; i++) {
            var initializer = this._initializers[i];

            if (initializer.instantiate) {
                initializer.instantiate(this);
            }
        }

        // Inject dependencies between objects.
        for (var i = 0; i < this._initializers.length; i++) {
            var initializer = this._initializers[i];

            if (initializer.inject) {
                initializer.inject(this);
            }
        }

        // Process.
        var modules = {
                'ajax-app': 'ajaxApp',
                'assets': 'assets',
                'configuration': 'configuration',
                'dependency-injection': 'dependencyInjection',
                'event': 'event',
                'file-system': 'fileSystem',
                'http': 'http',
                'manipulation': 'manipulation',
                'object': 'object',
                'rendering': 'rendering',
                'vendor': 'vendor'
            },
            danf = {
                parameters: {},
            }
        ;

        if (!module.isClient) {
            danf['assets'] = {
                'require.js': __dirname + '/../node_modules/requirejs/require.js',
                'main.js': __dirname + '/assets/main.js',
                'danf/config': __dirname + '/config',
                'danf/init.js': __dirname + '/init.js',
                'danf/utils.js': __dirname + '/utils.js',
                'danf/framework.js': __dirname + '/framework.js',
                'danf/initializer.js': __dirname + '/initializer.js'
            };
        }

        for (var path in modules) {
            var name = modules[path],
                modulePrefix = 'danf:{0}'.format(name),
                pathPrefixes = module.isClient
                    ? ['danf/config/{0}'.format(path), 'danf/config/{0}/client'.format(path)]
                    : ['./config/{0}'.format(path), './config/{0}/server'.format(path)],
                moduleConfig = {
                    'parameters': {},
                    'interfaces': {},
                    'services': {},
                    'classes': {}
                },
                hasServerConfig = false,
                handleError = function(error) {
                    if (-1 === error.message.indexOf('Cannot find module')
                        && -1 === error.message.indexOf('has not been loaded')
                    ) {
                        throw error;
                    }
                }<commit_msg>Add asset for danf images<commit_after>'use strict';

var define = define ? define : require('amdefine')(module);

define(function(require) {
    /**
     * Module dependencies.
     */
    var utils = module.isClient
            ? require('danf/utils')
            : require('./utils'),
        objectsContainer = {
            has: function(id) {
                return undefined !== this.objects[id] ? true : false;
            },
            get: function(id) {
                if (!this.has(id)) {
                    throw new Error('The object "{0}" is not defined.'.format(id))
                }

                return this.objects[id];
            },
            set: function(id, object) {
                this.objects[id] = object;
            }
        }
    ;

    objectsContainer.objects = {};

    /**
     * Initialize a new framework.
     */
    function Framework() {
        this._initializers = [];
        this._objects = {};
        this.objectsContainer = objectsContainer;
    }

    /**
     * The object container.
     */
    Object.defineProperty(Framework.prototype, 'objectsContainer', {
        get: function() { return this._objectsContainer; },
        set: function(objectsContainer) { this._objectsContainer = objectsContainer; }
    });

    /**
     * Add an initializer.
     *
     * @param {object} initializer The initializer.
     * @api public
     */
    Framework.prototype.addInitializer = function(initializer) {
        this._initializers.push(initializer);
    }

    /**
     * Whether or not an object has been instanciated.
     *
     * @param {String} id The id of the object.
     * @api public
     */
    Framework.prototype.has = function(id) {
        return this._objectsContainer.has(id);
    }

    /**
     * Get an object.
     *
     * @param {String} id The id of the service.
     * @return {Object} The service object.
     * @api public
     */
    Framework.prototype.get = function(id) {
        return this._objectsContainer.get(id);
    }

    /**
     * Set an object.
     *
     * @param {String} id The id of the object.
     * @param {Object} service The object.
     * @api public
     */
    Framework.prototype.set = function(id, object) {
        this._objectsContainer.set(id, object);
    }

    /**
     * Build the framework.
     *
     * @param {object} configuration The application danf configuration.
     * @param {object} context The application context.
     * @api public
     */
    Framework.prototype.build = function(configuration, context) {
        // Instantiate objects.
        for (var i = 0; i < this._initializers.length; i++) {
            var initializer = this._initializers[i];

            if (initializer.instantiate) {
                initializer.instantiate(this);
            }
        }

        // Inject dependencies between objects.
        for (var i = 0; i < this._initializers.length; i++) {
            var initializer = this._initializers[i];

            if (initializer.inject) {
                initializer.inject(this);
            }
        }

        // Process.
        var modules = {
                'ajax-app': 'ajaxApp',
                'assets': 'assets',
                'configuration': 'configuration',
                'dependency-injection': 'dependencyInjection',
                'event': 'event',
                'file-system': 'fileSystem',
                'http': 'http',
                'manipulation': 'manipulation',
                'object': 'object',
                'rendering': 'rendering',
                'vendor': 'vendor'
            },
            danf = {
                parameters: {},
            }
        ;

        if (!module.isClient) {
            danf['assets'] = {
                'require.js': __dirname + '/../node_modules/requirejs/require.js',
                'main.js': __dirname + '/assets/main.js',
                'danf/config': __dirname + '/config',
                'danf/init.js': __dirname + '/init.js',
                'danf/utils.js': __dirname + '/utils.js',
                'danf/framework.js': __dirname + '/framework.js',
                'danf/initializer.js': __dirname + '/initializer.js',
                'danf/img': __dirname + '/../img'
            };
        }

        for (var path in modules) {
            var name = modules[path],
                modulePrefix = 'danf:{0}'.format(name),
                pathPrefixes = module.isClient
                    ? ['danf/config/{0}'.format(path), 'danf/config/{0}/client'.format(path)]
                    : ['./config/{0}'.format(path), './config/{0}/server'.format(path)],
                moduleConfig = {
                    'parameters': {},
                    'interfaces': {},
                    'services': {},
                    'classes': {}
                },
                hasServerConfig = false,
                handleError = function(error) {
                    if (-1 === error.message.indexOf('Cannot find module')
                        && -1 === error.message.indexOf('has not been loaded')
                    ) {
                        throw error;
                    }
                }
{'fraction_non_alphanumeric': 0.13281326182350073, 'fraction_numerical': 0.0019502681618722574, 'mean_word_length': 1.4606525911708252, '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': '6152703', 'n_tokens_mistral': 2776, 'n_tokens_neox': 2635, 'n_words': 581}