<commit_before>(function (root, factory) {

  if (typeof define === 'function' && define.amd) {
      // AMD. Register as an anonymous module.
      define(factory);
  } else if (typeof module === 'object' && module.exports) {
    // Node. Does not work with strict CommonJS, but
    // only CommonJS-like environments that support module.exports,
    // like Node.
    module.exports = factory();
  } else {
    // Browser globals (root is window)
    root.Events = factory();
  }

})(this, function () {
	'use strict';

  function extend (dest, src) {
    for( var key in src ) {
      dest[key] = src[key];
    }
    return dest;
  }

  function Event (name) {
    this.name = name;
  }

  Event.prototype.preventDefault = function () {
    this.defaultPrevented = true;
  };

  function addHandler (listeners, eventName, handler, useCapture) {
    if( !listeners[eventName] ) {
      listeners[eventName] = [];
    }

    if( useCapture ) {
      listeners[eventName].unshift(handler);
    } else {
      listeners[eventName].push(handler);
    }
  }

  function removeHandler (listeners, handler) {
    var found = listeners.indexOf(handler);
    if( found >= 0 ) listeners.splice(found, 1);
  }

  function removeOnce( listeners, handler ) {
    for( var key in listeners ) {
      removeHandler(listeners[key], handler);
    }
    delete handler.__run_once;
  }

  function extendMethods (evt, target, prefix) {
    target[prefix + 'on'] = evt.on.bind(evt);
    target[prefix + 'once'] = evt.once.bind(evt);
    target[prefix + 'off'] = evt.off.bind(evt);
    target[prefix + 'trigger'] = evt.trigger.bind(evt);
  }

  function Events (target, prefix) {
    this.listeners = {};
    if( target ) {
      extendMethods(this, target, prefix);
    }
  }

  extend(Events.prototype, {
    on: function (eventName, handler, useCapture) {
      var listeners = this.listeners;
      ( eventName instanceof Array ? eventName : eventName.split(/ +/) ).forEach(function (eventName) {
        addHandler(listeners, eventName, handler, useCapture);
      });
    },<commit_msg>external methods can be prefixed<commit_after>(function (root, factory) {

  if (typeof define === 'function' && define.amd) {
      // AMD. Register as an anonymous module.
      define(factory);
  } else if (typeof module === 'object' && module.exports) {
    // Node. Does not work with strict CommonJS, but
    // only CommonJS-like environments that support module.exports,
    // like Node.
    module.exports = factory();
  } else {
    // Browser globals (root is window)
    root.Events = factory();
  }

})(this, function () {
	'use strict';

  function extend (dest, src) {
    for( var key in src ) {
      dest[key] = src[key];
    }
    return dest;
  }

  function Event (name) {
    this.name = name;
  }

  Event.prototype.preventDefault = function () {
    this.defaultPrevented = true;
  };

  function addHandler (listeners, eventName, handler, useCapture) {
    if( !listeners[eventName] ) {
      listeners[eventName] = [];
    }

    if( useCapture ) {
      listeners[eventName].unshift(handler);
    } else {
      listeners[eventName].push(handler);
    }
  }

  function removeHandler (listeners, handler) {
    var found = listeners.indexOf(handler);
    if( found >= 0 ) listeners.splice(found, 1);
  }

  function removeOnce( listeners, handler ) {
    for( var key in listeners ) {
      removeHandler(listeners[key], handler);
    }
    delete handler.__run_once;
  }

  function extendMethods (evt, target, prefix) {
    target[prefix + 'on'] = evt.on.bind(evt);
    target[prefix + 'once'] = evt.once.bind(evt);
    target[prefix + 'off'] = evt.off.bind(evt);
    target[prefix + 'trigger'] = evt.trigger.bind(evt);
  }

  function Events (target, prefix) {
    this.listeners = {};
    if( target ) {
      extendMethods(this, target, prefix || '');
    }
  }

  extend(Events.prototype, {
    on: function (eventName, handler, useCapture) {
      var listeners = this.listeners;
      ( eventName instanceof Array ? eventName : eventName.split(/ +/) ).forEach(function (eventName) {
        addHandler(listeners, eventName, handler, useCapture);
      });
    },
{'fraction_non_alphanumeric': 0.14145288899544473, 'fraction_numerical': 0.0009590026372572524, 'mean_word_length': 2.87372330547818, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4372081', 'n_tokens_mistral': 1288, 'n_tokens_neox': 1283, 'n_words': 322}