<commit_before>var express = require('express'),
    orm = require('orm'),
    fs = require('fs'),
    data_init = require('./config/data_menu'),
    config = require('./config/config'),
    clientSessions = require('client-sessions'),
    http = require('http');
var app = express();
orm.db = orm.connect(config.db, function(err, db) {
    if (err) {
        console.log('Error conectandose a la Base de Datos', err);
        return;
    }
    console.log('Connect to Database');
});
var modelsPath = __dirname + '/app/models';
fs.readdirSync(modelsPath).forEach(function(file) {
    if (file.indexOf('.js') >= 0) {
        require(modelsPath + '/' + file);
    }
});
require('./config/schemas_db')(orm);
require('./config/express')(app, config, clientSessions);
require('./config/routes')(app, data_init);
//app.listen(config.port);
var nicknames = {};
/* Servidor de chat */
var server = http.createServer(app).listen(config.port);
var io = require('socket.io').listen(server);
io.sockets.on('connection', function(socket) {
    socket.on('user message', function(msg) {
        socket.broadcast.emit('user message', socket.nickname, msg);
    });
    socket.on('nickname', function(nick, fn) {
        if (nicknames[nick]) {
            fn(true);
        } else {
            fn(false);
            nicknames[nick] = socket.nickname = nick;
            socket.broadcast.emit('announcement', nick + ' connected');
            io.sockets.emit('nicknames', nicknames);
        }
    });
    socket.on('disconnect', function() {
        if (!socket.nickname) return;
        delete nicknames[socket.nickname];
        socket.broadcast.emit('announcement', socket.nickname + ' disconnected');
        socket.broadcast.emit('nicknames', nicknames);
    });
});<commit_msg>formato<commit_after>var express = require('express'),
    orm = require('orm'),
    fs = require('fs'),
    data_init = require('./config/data_menu'),
    config = require('./config/config'),
    clientSessions = require('client-sessions'),
    http = require('http');
var app = express();
orm.db = orm.connect(config.db, function(err, db) {
    if (err) {
        console.log('Error conectandose a la Base de Datos', err);
        return;
    }
    console.log('Connect to Database');
});
var modelsPath = __dirname + '/app/models';
fs.readdirSync(modelsPath).forEach(function(file) {
    if (file.indexOf('.js') >= 0) {
        require(modelsPath + '/' + file);
    }
});
require('./config/schemas_db')(orm);
require('./config/express')(app, config, clientSessions);
require('./config/routes')(app, data_init);
//app.listen(config.port);

var nicknames = {};
/* Servidor de chat */
var server = http.createServer(app).listen(config.port);
var io = require('socket.io').listen(server);
io.sockets.on('connection', function(socket) {
    socket.on('user message', function(msg) {
        socket.broadcast.emit('user message', socket.nickname, msg);
    });
    socket.on('nickname', function(nick, fn) {
        if (nicknames[nick]) {
            fn(true);
        } else {
            fn(false);
            nicknames[nick] = socket.nickname = nick;
            socket.broadcast.emit('announcement', nick + ' connected');
            io.sockets.emit('nicknames', nicknames);
        }
    });
    socket.on('disconnect', function() {
        if (!socket.nickname) return;
        delete nicknames[socket.nickname];
        socket.broadcast.emit('announcement', socket.nickname + ' disconnected');
        socket.broadcast.emit('nicknames', nicknames);
    });
});
{'fraction_non_alphanumeric': 0.17878359264497878, 'fraction_numerical': 0.0005657708628005657, 'mean_word_length': 3.1796690307328603, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2504589', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1062, 'n_words': 202}