<commit_before>(function(global) {
    'use strict';
    
    if (typeof module !== 'undefined' && module.exports)
        module.exports = new Ruff();
    else
        global.ruff = new Ruff();
    
    function Ruff() {
        function ra(generator) {
            var events  = new Events(),
                gen     = generator();
            
            function nextItem(error, result) {
                var item = gen.next(result);
                
                if (error)
                    events.emit('error', error);
                else if (!item.done)
                    item.value(nextItem);
                
                if (item.done)
                    events.emit('end');
            }
            
            nextItem();
          
            return events;
        }
        
        function Events() {
            this._all = {};
        }
        
        Events.prototype.on = function(event, callback) {
            var funcs = this._all[event];
            
            if (funcs)
                funcs.push(callback);
            else
                this._all[event] = [callback];
            
            return events;
        };
        
        Events.prototype.emit = function(event, data) {
            var funcs = this._all[event];
            
            if (funcs)
                funcs.forEach(function(fn) {
                    fn(data);
                });
            else if (event === 'error')
                throw data;<commit_msg>fix(ruff) Events on return: events -> this<commit_after>(function(global) {
    'use strict';
    
    if (typeof module !== 'undefined' && module.exports)
        module.exports = new Ruff();
    else
        global.ruff = new Ruff();
    
    function Ruff() {
        function ra(generator) {
            var events  = new Events(),
                gen     = generator();
            
            function nextItem(error, result) {
                var item = gen.next(result);
                
                if (error)
                    events.emit('error', error);
                else if (!item.done)
                    item.value(nextItem);
                
                if (item.done)
                    events.emit('end');
            }
            
            nextItem();
          
            return events;
        }
        
        function Events() {
            this._all = {};
        }
        
        Events.prototype.on = function(event, callback) {
            var funcs = this._all[event];
            
            if (funcs)
                funcs.push(callback);
            else
                this._all[event] = [callback];
            
            return this;
        };
        
        Events.prototype.emit = function(event, data) {
            var funcs = this._all[event];
            
            if (funcs)
                funcs.forEach(function(fn) {
                    fn(data);
                });
            else if (event === 'error')
                throw data;
{'fraction_non_alphanumeric': 0.1048951048951049, 'fraction_numerical': 0.0, 'mean_word_length': 0.9659685863874345, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '593189', 'n_tokens_mistral': 750, 'n_tokens_neox': 717, 'n_words': 160}