<commit_before>//- JavaScript source code

//- server.js ~~
//                                                      ~~ (c) SRW, 06 Oct 2012
//                                                  ~~ last updated 14 Dec 2014

(function () {
    'use strict';

 // Pragmas

    /*jshint maxparams: 1, quotmark: single, strict: true */

    /*jslint indent: 4, maxlen: 80, node: true */

    /*properties
        cpus, enable_api_server, enable_cors, enable_web_server, env, hostname,
        IP, launch_service, length, log, match_hostname, OPENSHIFT_INTERNAL_IP,
        OPENSHIFT_INTERNAL_PORT, OPENSHIFT_NODEJS_IP, OPENSHIFT_NODEJS_PORT,
        parse, persistent_storage, port, PORT, QM_API_STRING, QM_HOSTNAME,
        QM_LOG_STRING, QM_WEB_STRING, static_content, trafficlog_storage,
        TRAVIS, VCAP_APP_HOST, VCAP_APP_PORT, VMC_APP_PORT, worker_procs
    */

 // Declarations

    var options, parse, qm;

 // Definitions

    options = {
        log: require('./custom').log,
        worker_procs: require('os').cpus().length
    };

    parse = require('./custom').parse;

    qm = require('qm');

 // Invocations

    if (process.env.IP !== undefined) {
     // This is for debugging on Cloud9.
        options.hostname = process.env.IP;
    }

    if (process.env.OPENSHIFT_NODEJS_IP !== undefined) {
     // This is for use with OpenShift.
        options.hostname = process.env.OPENSHIFT_NODEJS_IP;
    } else if (process.env.OPENSHIFT_INTERNAL_IP !== undefined) {
     // This is an outdated environment variable for use with OpenShift.
        options.hostname = process.env.OPENSHIFT_INTERNAL_IP;
    }

    if (process.env.OPENSHIFT_NODEJS_PORT !== undefined) {
     // This is for use with OpenShift.
        options.port = process.env.OPENSHIFT_NODEJS_PORT;
    } else if (process.env.OPENSHIFT_INTERNAL_PORT !== undefined) {
     // This is an outdated environment variable for use with OpenShift.
        options.port = process.env.OPENSHIFT_INTERNAL_PORT;
    }

    if (process.env.PORT !== undefined) {
     // This is for use with Heroku.
        options.port = process.env.PORT;
    }

    if (process.env.QM_API_STRING !== undefined) {
     // This is a custom environment variable I define prior to deployment.
        options.enable_api_server = true;
        options.enable_cors = true;
        options.persistent_storage = parse(process.env.QM_API_STRING);
    }

    if (process.env.QM_HOSTNAME !== undefined) {
     // This is a custom environment variable I define prior to deployment.
        options.hostname = process.env.QM_HOSTNAME;
        options.match_hostname = true;
    }

    if (process.env.QM_LOG_STRING !== undefined) {
     // This is a custom environment variable I define prior to deployment.
        options.trafficlog_storage = parse(process.env.QM_LOG_STRING);
    }

    if (process.env.QM_WEB_STRING !== undefined) {
     // This is a custom environment variable I define prior to deployment.
        options.enable_web_server = true;
        options.static_content = parse(process.env.QM_WEB_STRING);
    }

    if (process.env.TRAVIS === 'true') {
     // This is for use with Travis CI, where the VMs run on 1.5 virtual cores.
        options.worker_procs = 1;
    }

    if (process.env.VCAP_APP_HOST !== undefined) {
     // This is for Cloud Foundry platforms like AppFog and IBM Bluemix.
        options.hostname = process.env.VCAP_APP_HOST;
    }

    if (process.env.VCAP_APP_PORT !== undefined) {
     // This is for Cloud Foundry platforms like AppFog and IBM Bluemix.
        options.port = process.env.VCAP_APP_PORT;
    }

    if (process.env.VMC_APP_PORT !== undefined) {<commit_msg>Increase concurrency for Node.js app on Travis CI<commit_after>//- JavaScript source code

//- server.js ~~
//                                                      ~~ (c) SRW, 06 Oct 2012
//                                                  ~~ last updated 23 Dec 2014

(function () {
    'use strict';

 // Pragmas

    /*jshint maxparams: 1, quotmark: single, strict: true */

    /*jslint indent: 4, maxlen: 80, node: true */

    /*properties
        cpus, enable_api_server, enable_cors, enable_web_server, env, hostname,
        IP, launch_service, length, log, match_hostname, OPENSHIFT_INTERNAL_IP,
        OPENSHIFT_INTERNAL_PORT, OPENSHIFT_NODEJS_IP, OPENSHIFT_NODEJS_PORT,
        parse, persistent_storage, port, PORT, QM_API_STRING, QM_HOSTNAME,
        QM_LOG_STRING, QM_WEB_STRING, static_content, trafficlog_storage,
        TRAVIS, VCAP_APP_HOST, VCAP_APP_PORT, VMC_APP_PORT, worker_procs
    */

 // Declarations

    var options, parse, qm;

 // Definitions

    options = {
        log: require('./custom').log,
        worker_procs: require('os').cpus().length
    };

    parse = require('./custom').parse;

    qm = require('qm');

 // Invocations

    if (process.env.IP !== undefined) {
     // This is for debugging on Cloud9.
        options.hostname = process.env.IP;
    }

    if (process.env.OPENSHIFT_NODEJS_IP !== undefined) {
     // This is for use with OpenShift.
        options.hostname = process.env.OPENSHIFT_NODEJS_IP;
    } else if (process.env.OPENSHIFT_INTERNAL_IP !== undefined) {
     // This is an outdated environment variable for use with OpenShift.
        options.hostname = process.env.OPENSHIFT_INTERNAL_IP;
    }

    if (process.env.OPENSHIFT_NODEJS_PORT !== undefined) {
     // This is for use with OpenShift.
        options.port = process.env.OPENSHIFT_NODEJS_PORT;
    } else if (process.env.OPENSHIFT_INTERNAL_PORT !== undefined) {
     // This is an outdated environment variable for use with OpenShift.
        options.port = process.env.OPENSHIFT_INTERNAL_PORT;
    }

    if (process.env.PORT !== undefined) {
     // This is for use with Heroku.
        options.port = process.env.PORT;
    }

    if (process.env.QM_API_STRING !== undefined) {
     // This is a custom environment variable I define prior to deployment.
        options.enable_api_server = true;
        options.enable_cors = true;
        options.persistent_storage = parse(process.env.QM_API_STRING);
    }

    if (process.env.QM_HOSTNAME !== undefined) {
     // This is a custom environment variable I define prior to deployment.
        options.hostname = process.env.QM_HOSTNAME;
        options.match_hostname = true;
    }

    if (process.env.QM_LOG_STRING !== undefined) {
     // This is a custom environment variable I define prior to deployment.
        options.trafficlog_storage = parse(process.env.QM_LOG_STRING);
    }

    if (process.env.QM_WEB_STRING !== undefined) {
     // This is a custom environment variable I define prior to deployment.
        options.enable_web_server = true;
        options.static_content = parse(process.env.QM_WEB_STRING);
    }

    if (process.env.TRAVIS === 'true') {
     // This is for use with Travis CI. On their original infrastructure, the
     // VMs run on 1.5 cores with burst capacity, so it was best to set
     // `options.worker_procs = 1`. The new infrastructure, based on Docker
     // containers, offers 2 dedicated cores. See http://goo.gl/6x9Df6.
        options.worker_procs = 2;
    }

    if (process.env.VCAP_APP_HOST !== undefined) {
     // This is for Cloud Foundry platforms like AppFog and IBM Bluemix.
        options.hostname = process.env.VCAP_APP_HOST;
    }

    if (process.env.VCAP_APP_PORT !== undefined) {
     // This is for Cloud Foundry platforms like AppFog and IBM Bluemix.
        options.port = process.env.VCAP_APP_PORT;
    }

    if (process.env.VMC_APP_PORT !== undefined) {
{'fraction_non_alphanumeric': 0.10288283522877546, 'fraction_numerical': 0.005950806664903465, 'mean_word_length': 2.4852534562211983, '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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3063339', 'n_tokens_mistral': 2359, 'n_tokens_neox': 2263, 'n_words': 599}