<commit_before>Acceptance.Event = Acceptance.Class({
  initialize: function(nativeEvent) {
    this._event = nativeEvent;
  },
  
  stopDefault: function() {
    if (this._event.preventDefault) this._event.preventDefault();
    else this._event.returnValue = false;
  }
}, {
  _registry: [],
  
  on: function(element, eventName, callback, scope) {
    if (!element || element.nodeType !== 1) return;
    
    var wrapped = function(event) {
      callback.call(scope, new Acceptance.Event(event));
    };
    
    if (element.addEventListener)
      element.addEventListener(eventName, wrapped, false);
    else
      element.attachEvent('on' + eventName, wrapped);
    
    this._registry.push({
      _element:   element,
      _type:      eventName,
      _callback:  callback,
      _scope:     scope,
      _handler:   wrapped
    });
    
    element = null;
    wrapped = null;
  },
  
  detach: function(element, eventName, callback, scope) {
    var i = this._registry.length, register;
    while (i--) {
      register = this._registry[i];
      
      if ((element   && element   !== register._element  ) ||
          (eventName && eventName !== register._type     ) ||
          (callback  && callback  !== register._callback ) ||
          (scope     && scope     !== register._scope    ))
        continue;
      
      if (register._element.removeEventListener)
        register._element.removeEventListener(register._type, register._handler, false);
      else
        register._element.detachEvent('on' + register._type, register._handler);
      
      register._element  = null;
      register._callback = null;
      register = null;
      
      this._registry.splice(i,1);
    }
  },
  
  ENV: this
});

Acceptance.Event.on(Acceptance.Event.ENV, 'unload',
    Acceptance.Event.remove,
    Acceptance.Event);
<commit_msg>Event handler clean method name was incorrect.<commit_after>Acceptance.Event = Acceptance.Class({
  initialize: function(nativeEvent) {
    this._event = nativeEvent;
  },
  
  stopDefault: function() {
    if (this._event.preventDefault) this._event.preventDefault();
    else this._event.returnValue = false;
  }
}, {
  _registry: [],
  
  on: function(element, eventName, callback, scope) {
    if (!element || element.nodeType !== 1) return;
    
    var wrapped = function(event) {
      callback.call(scope, new Acceptance.Event(event));
    };
    
    if (element.addEventListener)
      element.addEventListener(eventName, wrapped, false);
    else
      element.attachEvent('on' + eventName, wrapped);
    
    this._registry.push({
      _element:   element,
      _type:      eventName,
      _callback:  callback,
      _scope:     scope,
      _handler:   wrapped
    });
    
    element = null;
    wrapped = null;
  },
  
  detach: function(element, eventName, callback, scope) {
    var i = this._registry.length, register;
    while (i--) {
      register = this._registry[i];
      
      if ((element   && element   !== register._element  ) ||
          (eventName && eventName !== register._type     ) ||
          (callback  && callback  !== register._callback ) ||
          (scope     && scope     !== register._scope    ))
        continue;
      
      if (register._element.removeEventListener)
        register._element.removeEventListener(register._type, register._handler, false);
      else
        register._element.detachEvent('on' + register._type, register._handler);
      
      register._element  = null;
      register._callback = null;
      register = null;
      
      this._registry.splice(i,1);
    }
  },
  
  ENV: this
});

Acceptance.Event.on(Acceptance.Event.ENV, 'unload',
    Acceptance.Event.detach,
    Acceptance.Event);

{'fraction_non_alphanumeric': 0.1266469481043291, 'fraction_numerical': 0.0010755579456843238, 'mean_word_length': 2.45724907063197, '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': '4510741', 'n_tokens_mistral': 1066, 'n_tokens_neox': 1077, 'n_words': 214}