<commit_before>var Renderer = require('./Renderer.js');
var EventEmitter = require('events');

function errorHandler(msg) {
    throw new Error(msg);
}

function Boo(stream, original, filtered, progressBar) {
    // inherit from EventEmitter
    EventEmitter.call(this);

    this.progressBar = progressBar;
    this.originalRenderer = new Renderer(original, errorHandler, null);

    this.filteredRenderer = new Renderer(filtered, errorHandler, function () {
        // create a muted, invisible video element tostream the camera/mic
        // output to
        this.video = document.createElement('video');
        this.video.style = 'display:none';
        this.video.muted = true;
        this.video.src = window.URL.createObjectURL(stream);
        document.body.appendChild(this.video);
        this.video.play();

        this.video.addEventListener('loadedmetadata', function () {
            var w = this.video.videoWidth;
            var h = this.video.videoHeight;
            this.filteredRenderer.setSize(w, h);
            this.originalRenderer.setSize(w, h);
        }.bind(this));

        this.filteredRenderer.nextEffect();

        this.video.addEventListener('loadeddata', function () {
            this.emit('ready');
            window.requestAnimationFrame(this._tick.bind(this));
            this.canvasStream = filtered.captureStream(12);
            this.canvasStream.addTrack(this.stream.getAudioTracks()[0]);
            this.recorder = new MediaRecorder(this.canvasStream);
        }.bind(this), false);
    }.bind(this));

    this.stream = stream;
}
<commit_msg>Rename variables and add callback name for readability<commit_after>var Renderer = require('./Renderer.js');
var EventEmitter = require('events');

function errorHandler(msg) {
    throw new Error(msg);
}

function Boo(stream, originalCanvas, filteredCanvas, progressBar) {
    // inherit from EventEmitter
    EventEmitter.call(this);

    this.progressBar = progressBar;
    this.originalRenderer = new Renderer(originalCanvas, errorHandler, null);

    this.filteredRenderer = new Renderer(filteredCanvas, errorHandler, function onStreamReady() {
        // create a muted, invisible video element to stream 
        // the camera/mic output to
        this.video = document.createElement('video');
        this.video.style = 'display:none';
        this.video.muted = true;
        this.video.src = window.URL.createObjectURL(stream);
        document.body.appendChild(this.video);
        this.video.play();

        this.video.addEventListener('loadedmetadata', function () {
            var w = this.video.videoWidth;
            var h = this.video.videoHeight;
            this.filteredRenderer.setSize(w, h);
            this.originalRenderer.setSize(w, h);
        }.bind(this));

        this.filteredRenderer.nextEffect();

        this.video.addEventListener('loadeddata', function () {
            this.emit('ready');
            window.requestAnimationFrame(this._tick.bind(this));
            this.canvasStream = filteredCanvas.captureStream(12);
            this.canvasStream.addTrack(this.stream.getAudioTracks()[0]);
            this.recorder = new MediaRecorder(this.canvasStream);
        }.bind(this), false);
    }.bind(this));

    this.stream = stream;
}

{'fraction_non_alphanumeric': 0.12339645693341478, 'fraction_numerical': 0.0018326206475259622, 'mean_word_length': 2.8529411764705883, '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': '1915785', 'n_tokens_mistral': 889, 'n_tokens_neox': 865, 'n_words': 173}