<commit_before>//FIRE AND FORGET
var http = require('http');
var url = require('url');

var init = function (emitter) {
    "use strict";
    return function(callback){
    emitter.on("NEWSTATE", function (data) {
        //Just act on delivered
        if (data.state === "Delivered") {
            do_callback(data);
        }
    });
    callback && callback(null);
};
};

function do_callback(data) {
    "use strict";
    if (data.callback) {
        var options = url.parse(data.callback);
        var cb_req = http.request(options);  //FIRE AND FORGET
        var str_data = JSON.stringify(data);
        cb_req.on('error', function foo(err) {
            console.log('callback err::' + err);
        });
        cb_req.write(str_data);
        cb_req.end();
    }
}<commit_msg>exports init method<commit_after>//FIRE AND FORGET
var http = require('http');
var url = require('url');

var init = function (emitter) {
    "use strict";
    return function(callback){
    emitter.on("NEWSTATE", function (data) {
        //Just act on delivered
        if (data.state === "Delivered") {
            do_callback(data);
        }
    });
    callback && callback(null);
};
};

function do_callback(data) {
    "use strict";
    if (data.callback) {
        var options = url.parse(data.callback);
        var cb_req = http.request(options);  //FIRE AND FORGET
        var str_data = JSON.stringify(data);
        cb_req.on('error', function foo(err) {
            console.log('callback err::' + err);
        });
        cb_req.write(str_data);
        cb_req.end();
    }
}

exports.init = init;
{'fraction_non_alphanumeric': 0.1520650813516896, 'fraction_numerical': 0.0, 'mean_word_length': 2.3734177215189876, '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': '3359711', 'n_tokens_mistral': 499, 'n_tokens_neox': 491, 'n_words': 116}