<commit_before>var Stream  = require('stream').Stream
  , util    = require('util')
  , _       = require('underscore')
  ;

util.inherits(Bolt, Stream);

/* ========================================================================== *
 *  UTILITIES                                                                 *
 * ========================================================================== */
function EmitContinuation (stream) {
  var self = function (err, data) {
    if (err)
      self.err = err;
    else
      self.data = data;

    self.done = true;

    stream._next();
  };
  return self;
};

/* ========================================================================== *
 *  PRIVATE / UTIL FUNCTIONS                                                  *
 * ========================================================================== */

Bolt.prototype._next = function () {
  var emission = this._emissionQueue[0];

  while (emission && emission.done) {
    if (emission.data)
      this.emit('data', emission.data);<commit_msg>IMPROVED - Added the ability for in order bolt to emit multiple data packets per call<commit_after>var Stream  = require('stream').Stream
  , util    = require('util')
  , _       = require('underscore')
  ;

util.inherits(Bolt, Stream);

/* ========================================================================== *
 *  UTILITIES                                                                 *
 * ========================================================================== */
function EmitContinuation (stream) {
  var self = function (err, data) {
    if (err)
      self.err = err;
    else if (Array.isArray(data))
      self.data = data;
    else
      self.data = [data];

    self.done = true;

    stream._next();
  };
  return self;
};

/* ========================================================================== *
 *  PRIVATE / UTIL FUNCTIONS                                                  *
 * ========================================================================== */

Bolt.prototype._next = function () {
  var emission  = this._emissionQueue[0]
    , self      = this
    ;

  while (emission && emission.done) {
    if (emission.data)
      _.each(emission.data, function (dataItem) {
        if (typeof dataItem !== 'undefined')
          self.emit('data', dataItem);
      })

{'fraction_non_alphanumeric': 0.35027765912003417, 'fraction_numerical': 0.0008543357539513029, 'mean_word_length': 2.5059880239520957, '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': '6051721', 'n_tokens_mistral': 582, 'n_tokens_neox': 519, 'n_words': 115}