<commit_before>var Stream = require('stream');

exports.Net = Stream.PassThrough;

// writable
exports.Event = function (options) {
   
    options = options || {};
    if (typeof options.objectMode === 'undefined') {
        options.objectMode = true;
    }
 
    var sequence = Stream.Transform({
        objectMode: options.objectMode ? true : false,
        transform: function (chunk, enc, next) {

            var push;
            var pos = -1;
            var handler;
            var runSeq = function (err, data) {

                if (err && data) {
                    data = err;
                    err = null;
                    push = true;
                } else {
                    push = false;
                }

                // emit error
                if (err) {
                    return next(err);
                };

                // just push data to readable if data and error is true
                if (push) {
                    return sequence.push(data);
                }

                // get handler
                if (!(handler = sequence.seq[++pos])) {
                    return next(null, data);
                }

                // call next data handler
                if (!handler[4]) {

                    // once handler
                    if (handler[3]) {
                        handler[4] = true;
                    }

                    handler[0].call(handler[2], handler[1], data, runSeq);
                } else {
                    runSeq(null, data);
                }
            };

            if (!sequence.seq) {
                sequence.once('sequence', runSeq.bind(this, null, chunk));
                return;
            }

            runSeq(null, chunk);
        }
    });
    sequence.resume();
    return sequence;
};<commit_msg>export an pass throught stream<commit_after>var Stream = require('stream');

exports.Pass = function () {
    return Stream.PassThrough({objectMode: true});
};

// writable
exports.Event = function (options) {
   
    options = options || {};
    if (typeof options.objectMode === 'undefined') {
        options.objectMode = true;
    }
 
    var sequence = Stream.Transform({
        objectMode: options.objectMode ? true : false,
        transform: function (chunk, enc, next) {

            var push;
            var pos = -1;
            var handler;
            var runSeq = function (err, data) {

                if (err && data) {
                    data = err;
                    err = null;
                    push = true;
                } else {
                    push = false;
                }

                // emit error
                if (err) {
                    return next(err);
                };

                // just push data to readable if data and error is true
                if (push) {
                    return sequence.push(data);
                }

                // get handler
                if (!(handler = sequence.seq[++pos])) {
                    return next(null, data);
                }

                // call next data handler
                if (!handler[4]) {

                    // once handler
                    if (handler[3]) {
                        handler[4] = true;
                    }

                    handler[0].call(handler[2], handler[1], data, runSeq);
                } else {
                    runSeq(null, data);
                }
            };

            if (!sequence.seq) {
                sequence.once('sequence', runSeq.bind(this, null, chunk));
                return;
            }

            runSeq(null, chunk);
        }
    });

    return sequence;
};
{'fraction_non_alphanumeric': 0.10766721044045677, 'fraction_numerical': 0.0038064165307232192, 'mean_word_length': 0.9929577464788732, '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': '4281912', 'n_tokens_mistral': 936, 'n_tokens_neox': 845, 'n_words': 232}