<commit_before>(function(lib, undefined) {
    /*global lib*/
    "use strict";
    
    lib.widget.helpers = {};
    
    lib.extend(lib.widget.helpers, {
        _addEvent: function _addEvent(target, type, callback) {
            var bound = lib.bind(callback, this);
            if (!this.__events) {
                this.__events = [];
            }
            
            this.__events.push([target, type, callback, bound]);
            lib.event.add(target, type, bound);
        },
        
        _removeEvent: function _removeEvent(target, type, callback) {
            if (this.__events) {
                lib.array.forEach(this.__events, function(event, i, array) {
                    var match = true, hit = false;
                    if (target) {
                        match = (match && target === event[0]);
                    }
                    if (type) {
                        match = (match && type === event[1]);
                    }
                    if (callback) {
                        match = (match && callback === event[2]);
                    }
                    
                    if (match) {
                        if (!hit) {
                            hit = true;
                            lib.event.remove(event[0], event[1], event[3]);
                        }
                        
                        array.splice(i, 0);
                    }
                });
            }
        },
        
        _dispatchEvent: function _dispatchEvent(type, args) {
            lib.event.dispatch(this.element, type, args);
        },
        
        _dispose: function _dispose() {
            this._removeEvent();
            if (this.element.__events) {
                delete this.element.__events;
            }
        },
        
        _elementize: function _elementize(element) {
            var type = lib.util.getType(this);
            if (!element.__widgets) {
                element.__widgets = {};
            }
            if (!element.__widgets[type]) {
                element.__widgets[type] = this;
                this.element = element;
            }
        }
    });<commit_msg>event's wasn't been cleared properly<commit_after>(function(lib, undefined) {
    /*global lib*/
    "use strict";
    
    lib.widget.helpers = {};
    
    lib.extend(lib.widget.helpers, {
        _addEvent: function _addEvent(target, type, callback) {
            var bound = lib.bind(callback, this);
            if (!this.__events) {
                this.__events = [];
            }
            
            this.__events.push([target, type, callback, bound]);
            lib.event.add(target, type, bound);
        },
        
        _removeEvent: function _removeEvent(target, type, callback) {
            if (this.__events) {
                var events = this.__events;
                lib.array.forEach(events, function(event, i) {
                    var match = true;
                    if (target) {
                        match = (match && target === event[0]);
                    }
                    if (type) {
                        match = (match && type === event[1]);
                    }
                    if (callback) {
                        match = (match && callback === event[2]);
                    }
                    
                    if (match) {
                        lib.event.remove(event[0], event[1], event[3]);
                        events[i] = null;
                    }
                });
                this.__events = lib.array.filter(events, function(event) {
                    return event !== null;
                });
            }
        },
        
        _dispatchEvent: function _dispatchEvent(type, args) {
            lib.event.dispatch(this.element, type, args);
        },
        
        _dispose: function _dispose() {
            this._removeEvent();
            if ("__events" in this) {
                delete this.__events;
            }
            delete this.element;
        },
        
        _elementize: function _elementize(element) {
            var type = lib.util.getType(this);
            if (!element.__widgets) {
                element.__widgets = {};
            }
            if (!element.__widgets[type]) {
                element.__widgets[type] = this;
                this.element = element;
            }
        }
    });
{'fraction_non_alphanumeric': 0.1148694665153235, 'fraction_numerical': 0.0029511918274687855, 'mean_word_length': 1.0454967502321262, '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': '6921412', 'n_tokens_mistral': 1103, 'n_tokens_neox': 1047, 'n_words': 214}