<commit_before>var Flow = require('./flow');
var Instance = require('./instance');

// client flag
engine.client = true;

// extend engine with flow emitter
engine = Flow(engine);

// listen to core engine events
engine.mind('C', {call: '@/C'}).mind('M', {call: '@/M'});

// data handlers
engine.handlers = {
    transform: require('./transform')
};

// load entrypoint
Instance();

/**
 * Empties all caches and reloads the modules.
 *
 * @public
 * @param {boolean} Don't remove the DOM nodes.
 * @todo check for memory leaks
 */
engine.reload = function (keepDom) {
  
    // engine.emit('reload', keepDom);
    
    // close the websocket and reconnect immedialtey
    Socket.close(3000);
};<commit_msg>client side core module instance load method<commit_after>var Flow = require('./flow');
var Instance = require('./instance');

// client flag
engine.client = true;

// extend engine with flow emitter
engine = Flow(engine);

// listen to core engine events
engine.mind('C', {call: '@/C'}).mind('M', {call: '@/M'});


// data handlers
engine.handlers = {
    transform: require('./transform')
};

/**
 * Create server module instances
 */
engine.load = function (name, callback) {
    
    // ensure callback
    callback = callback || function () {};
    
    // get composition
    engine.flow('C').data(function (err, composition) {
        
        if (err) {
            return callback(err);
        }
        
        // require module
        require(composition.module, function (module) {
            
            if (err) {
                return callback(err);
            }
            
            // create instance
            Instance(module, composition, callback);
        });
    }).write(null, name);
};

/**
 * Empties all caches and reloads the modules.
 *
 * @public
 * @param {boolean} Don't remove the DOM nodes.
 * @todo be aware of memory leaks
 */
engine.reload = function (keepDom) {
    // ..
};

// load entrypoint
engine.load();
{'fraction_non_alphanumeric': 0.1536113936927772, 'fraction_numerical': 0.002034587995930824, 'mean_word_length': 2.4630281690140845, 'pattern_counts': {'":': 0, '<': 3, '<?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': '727558', 'n_tokens_mistral': 574, 'n_tokens_neox': 560, 'n_words': 170}