<commit_before>var express = require('express');
var async = require('async');
var glob = require('glob');

require('colors');

var logger = require('./logger');
var requestUtils = require('./request');
var file = require('./file');
var static = require('./static');
var setup = require('./setup');

var server = null;

exports.run = function(argv, cb) {

    logger.setStealthMode(argv.stealthmode);

    console.log('\n', '   Bootstrapping   '.bold.inverse, '\n');

    var app = express();
    app.use(requestUtils.headers);
    if (!argv.disableCORS) {
        app.use(requestUtils.corsHeaders);
    }
    app.use(requestUtils.logger);
    app.use(requestUtils.getBody);

    if (argv.staticPaths) {
        static.setupRoutes(app, argv.staticPaths, argv.pathDelimiter);
    }

    var startServer = function (){
        server = setup.startServer(argv, app, cb);
    };

    glob(argv.sourceFiles, {} , function (err, files) {
        if (err) {
            console.error('Failed to parse contracts path.', err);
            process.exit(1);
        }

        var seriesFunctions = files.map(function(filePath){
            return file.readFile(app, filePath);
        });

        seriesFunctions.push(startServer);

        if (cb) {
            seriesFunctions.push(cb);
        }

        async.series(seriesFunctions, function(err) {
            if (err) {
                console.error('Drakov returned an error.', err);
                process.exit(1);
            }
        });
<commit_msg>cb was missed<commit_after>var express = require('express');
var async = require('async');
var glob = require('glob');

require('colors');

var logger = require('./logger');
var requestUtils = require('./request');
var file = require('./file');
var static = require('./static');
var setup = require('./setup');

var server = null;

exports.run = function(argv, cb) {

    logger.setStealthMode(argv.stealthmode);

    console.log('\n', '   Bootstrapping   '.bold.inverse, '\n');

    var app = express();
    app.use(requestUtils.headers);
    if (!argv.disableCORS) {
        app.use(requestUtils.corsHeaders);
    }
    app.use(requestUtils.logger);
    app.use(requestUtils.getBody);

    if (argv.staticPaths) {
        static.setupRoutes(app, argv.staticPaths, argv.pathDelimiter);
    }

    var startServer = function (cb){
        server = setup.startServer(argv, app, cb);
    };

    glob(argv.sourceFiles, {} , function (err, files) {
        if (err) {
            console.error('Failed to parse contracts path.', err);
            process.exit(1);
        }

        var seriesFunctions = files.map(function(filePath){
            return file.readFile(app, filePath);
        });

        seriesFunctions.push(startServer);

        if (cb) {
            seriesFunctions.push(cb);
        }

        async.series(seriesFunctions, function(err) {
            if (err) {
                console.error('Drakov returned an error.', err);
                process.exit(1);
            }
        });

{'fraction_non_alphanumeric': 0.1514950166112957, 'fraction_numerical': 0.00132890365448505, 'mean_word_length': 2.4254835039817975, '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': '4573744', 'n_tokens_mistral': 880, 'n_tokens_neox': 859, 'n_words': 183}