<commit_before>// vim:ts=4:sts=4:sw=4:
// this module can be loaded both as a CommonJS module and
// as a browser script.  If included as a script, it constructs
// a Q_COMM global property with its API and requires
// Q and UUID to be provided before its execution
// by the epynomous scripts/modules.
(function (definition) {
    var global = this;
    // RequireJS
    if (typeof define === "function") {
        define(function (require, exports) {
            definition(require, exports);
        });
    // CommonJS
    } else if (typeof exports === "object") {
        definition(require, exports);
    // <script>
    } else {
        definition(
            function (id) {
                return global[id.toUpperCase()];
            },
            Q_COMM = {}
        );
    }
})
(function (require, exports) {

var Q = require("q");
var UUID = require("uuid");

function debug() {
    //typeof console !== "undefined" && console.log.apply(console, arguments);
}

var rootId = "";

var has = Object.prototype.hasOwnProperty;

/**
 * @param connection
 * @param local
 */
exports.Connection = Connection;
function Connection(connection, local, options) {
    connection = adapt(connection);
    options = options || {};
    var makeId = options.makeId || function () {
        return UUID.generate();
    };
    var locals = Lru(options.max || Infinity);

    var debugKey = Math.floor(Math.random() * 256).toString(16);
    function _debug() {
        debug.apply(null, [debugKey].concat(Array.prototype.slice.call(arguments)));
    }

    // message reciever loop
    Q.when(connection.get(), get).end();
    function get(message) {
        _debug("message receiver loop", message);
        Q.when(connection.get(), get).end();
        receive(message);
    }

    // message receiver
    function receive(message) {
        message = JSON.parse(message);
        _debug(message);
        if (!receivers[message.type])
            return; // ignore bad message types
        if (!locals.has(message.to))
            return; // ignore messages to non-existant or forgotten promises
        receivers[message.type](message);
    }

    // message receiver handlers by message type<commit_msg>Fix zero padding in debug identifiers.<commit_after>// vim:ts=4:sts=4:sw=4:
// this module can be loaded both as a CommonJS module and
// as a browser script.  If included as a script, it constructs
// a Q_COMM global property with its API and requires
// Q and UUID to be provided before its execution
// by the epynomous scripts/modules.
(function (definition) {
    var global = this;
    // RequireJS
    if (typeof define === "function") {
        define(function (require, exports) {
            definition(require, exports);
        });
    // CommonJS
    } else if (typeof exports === "object") {
        definition(require, exports);
    // <script>
    } else {
        definition(
            function (id) {
                return global[id.toUpperCase()];
            },
            Q_COMM = {}
        );
    }
})
(function (require, exports) {

var Q = require("q");
var UUID = require("uuid");

function debug() {
    //typeof console !== "undefined" && console.log.apply(console, arguments);
}

var rootId = "";

var has = Object.prototype.hasOwnProperty;

/**
 * @param connection
 * @param local
 */
exports.Connection = Connection;
function Connection(connection, local, options) {
    connection = adapt(connection);
    options = options || {};
    var makeId = options.makeId || function () {
        return UUID.generate();
    };
    var locals = Lru(options.max || Infinity);

    var debugKey = Math.random().toString(16).slice(2, 4);
    function _debug() {
        debug.apply(null, [debugKey].concat(Array.prototype.slice.call(arguments)));
    }

    // message reciever loop
    Q.when(connection.get(), get).end();
    function get(message) {
        _debug("message receiver loop", message);
        Q.when(connection.get(), get).end();
        receive(message);
    }

    // message receiver
    function receive(message) {
        message = JSON.parse(message);
        _debug(message);
        if (!receivers[message.type])
            return; // ignore bad message types
        if (!locals.has(message.to))
            return; // ignore messages to non-existant or forgotten promises
        receivers[message.type](message);
    }

    // message receiver handlers by message type
{'fraction_non_alphanumeric': 0.13401129943502824, 'fraction_numerical': 0.003389830508474576, 'mean_word_length': 2.518282988871224, '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': '2513014', 'n_tokens_mistral': 1234, 'n_tokens_neox': 1214, 'n_words': 354}