<commit_before>/**
 * Incident Theatres
 * An example movie cinema guide API written in NodeJS
 * @copyright 2013 <NAME>
 */

var orm = require('orm');
var express = require('express');
var appConfig = require('./config/application');
var dbConfig = require('./config/database');
var bindRoutes = require('./config/routes');
var errorHandler = require('./middlewares/errorHandler');


// Create application
var app = module.exports = express();

// Configure application
appConfig(app);

// Define models
app.models = {};
orm.connect(dbConfig, function(err, db) {
    var cinema = require('./models/cinema');
    var movie  = require('./models/movie');

    // Define all models
    app.models.cinema = cinema.define(db);
    app.models.movie  = movie.define(db);

    // Setup associations
    cinema.associations(db);
    movie.associations(db);
});
var modelsMiddleware = function(req, res, next) {
    req.models = app.models;
    next();
};
bindRoutes(app);

// Define middleware stack
app.use(modelsMiddleware);
app.use(app.router);
app.use(errorHandler);
<commit_msg>Be consistent with exporting at the bottom of files<commit_after>/**
 * Incident Theatres
 * An example movie cinema guide API written in NodeJS
 * @copyright 2013 <NAME>
 */

var orm = require('orm');
var express = require('express');
var appConfig = require('./config/application');
var dbConfig = require('./config/database');
var bindRoutes = require('./config/routes');
var errorHandler = require('./middlewares/errorHandler');


// Create application
var app = express();

// Configure application
appConfig(app);

// Define models
app.models = {};
orm.connect(dbConfig, function(err, db) {
    var cinema = require('./models/cinema');
    var movie  = require('./models/movie');

    // Define all models
    app.models.cinema = cinema.define(db);
    app.models.movie  = movie.define(db);

    // Setup associations
    cinema.associations(db);
    movie.associations(db);
});
var modelsMiddleware = function(req, res, next) {
    req.models = app.models;
    next();
};
bindRoutes(app);

// Define middleware stack
app.use(modelsMiddleware);
app.use(app.router);
app.use(errorHandler);

// Export application
module.exports = app;

{'fraction_non_alphanumeric': 0.15401987353206864, 'fraction_numerical': 0.0036133694670280035, 'mean_word_length': 4.01131221719457, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2674405', 'n_tokens_mistral': 661, 'n_tokens_neox': 649, 'n_words': 171}