<commit_before>var debug = require('debug')('initialize');

function Initializer() {
  this._phases = [];
}

Initializer.prototype.init = function(app, cb) {
  var self = this
    , phases = this._phases
    , idx = 0;
  
  function next(err) {
    if (err) { return cb(err); }
    
    var phase = phases[idx++];
    // all done
    if (!phase) { return cb && cb(); }
    
    try {
      debug('%s', phase.name || 'anonymous');
      var arity = phase.length;
      if (arity == 1) {
        phase(next);
      } else {
        phase();
        next();
      }
    } catch (ex) {
      next(ex);
    }
  }
  next();
}

Initializer.prototype.phase = function(fn) {
  this._phases.push(fn);
}


module.exports = Initializer;
<commit_msg>Remove app argument from init.<commit_after>var debug = require('debug')('initialize');

function Initializer() {
  this._phases = [];
}

Initializer.prototype.init = function(cb) {
  var self = this
    , phases = this._phases
    , idx = 0;
  
  function next(err) {
    if (err) { return cb(err); }
    
    var phase = phases[idx++];
    // all done
    if (!phase) { return cb && cb(); }
    
    try {
      debug('%s', phase.name || 'anonymous');
      var arity = phase.length;
      if (arity == 1) {
        phase(next);
      } else {
        phase();
        next();
      }
    } catch (ex) {
      next(ex);
    }
  }
  next();
}

Initializer.prototype.phase = function(fn) {
  this._phases.push(fn);
}


module.exports = Initializer;

{'fraction_non_alphanumeric': 0.16823687752355315, 'fraction_numerical': 0.0026917900403768506, 'mean_word_length': 2.184154175588865, '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': '1259008', 'n_tokens_mistral': 511, 'n_tokens_neox': 504, 'n_words': 113}