<commit_before>var cp_fork = require('child_process').fork;

// Identify this better
var id = 0;

function Child ( options ){
    var self = this;
    self.id = id++;
    self.options = options || {};
    self.command = self.options.command || null;
    self.args = self.options.args || undefined;
    self.process = undefined;
    self.respawnCount = 0;
    self.respawnMax = self.options.respawnMax;
    self.debugLevel = self.options.debugLevel || 0;
    self.onExit = function childOnExit( code, signal){
        self.process = undefined;
        self.pid = undefined;
        if(typeof self.options.onExit === 'function') self.options.onExit( code, signal );
    };
    self.onClose = function childOnClose(){
        if(typeof self.options.onClose === 'function') self.options.onClose();<commit_msg>Prepare arguments array if given an object<commit_after>var cp_fork = require('child_process').fork;

// Identify this better
var id = 0;

function prepareArgs( args ){
    var argArray = [];
    if(args.constructor === Array) return args;
    for(var i in args){
        argArray.push(i,args[i]);
    }
    return argArray;
}

function Child ( options ){
    var self = this;
    self.id = id++;
    self.options = options || {};
    self.command = self.options.command || null;
    self.args = prepareArgs(self.options.args || undefined);
    self.process = undefined;
    self.respawnCount = 0;
    self.respawnMax = self.options.respawnMax;
    self.debugLevel = self.options.debugLevel || 0;
    self.onExit = function childOnExit( code, signal){
        self.process = undefined;
        self.pid = undefined;
        if(typeof self.options.onExit === 'function') self.options.onExit( code, signal );
    };
    self.onClose = function childOnClose(){
        if(typeof self.options.onClose === 'function') self.options.onClose();
{'fraction_non_alphanumeric': 0.13633894622487777, 'fraction_numerical': 0.0032590983161325366, 'mean_word_length': 3.0933333333333333, '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': '561286', 'n_tokens_mistral': 558, 'n_tokens_neox': 547, 'n_words': 133}