<commit_before>/**
 * @namespace Lyria
 * Lyria namespace decleration
 */
define('lyria/eventmap', function() {'use strict';

  /**
   * This is directly taken from
   * https://github.com/elysion-powered/elyssa/blob/master/src/core/events.coffee
   * Just using a different namespace
   */
  var __slice = [].slice;

  // Lyria.EventMap
  return (function() {
    var eventFunctions, eventMap;

    eventMap = {};

    eventFunctions = {};

    function EventMap() {
      eventMap = {};
      eventFunctions = {};
    }


    EventMap.prototype.validEvents = [];

    EventMap.prototype.on = function(eventName, eventFunction) {
      if (!eventFunction) {
        return;
      }
      if (this.validEvents.length > 0) {
        if (validEvents.indexOf(eventName) === -1) {
          return;
        }
      }
      eventMap[eventName] = {
        event: eventFunction,
        id: -1,
        type: ''
      };
      return this;
    };

    EventMap.prototype.off = function(eventName) {
      if (!eventName) {
        return;
      }
      if (eventMap[eventName].type === 'once' || eventMap[eventName].type === 'repeat') {
        if (eventMap[eventName].type === 'repeat') {
          window.clearInterval(eventMap[eventName].id);
        }
        if (eventMap[eventName].type === 'once') {
          window.clearTimeout(eventMap[eventName].id);
        }
      }
      if (eventMap[eventName]) {
        delete eventMap[eventName];
      }
      return this;
    };

    EventMap.prototype.trigger = function() {
      var args, context, eventName, interval, name, repeat, triggerFunction;
      eventName = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
      if (eventName == null) {
        return;
      }
      if ( typeof eventName === 'object') {
        name = eventName.name, interval = eventName.interval, repeat = eventName.repeat, context = eventName.context;
      } else {
        name = eventName;
      }
      if (interval == null) {
        interval = 0;
      }
      if (repeat == null) {
        repeat = false;
      }
      if (context == null) {
        context = this;
      }
      triggerFunction = function() {
        if (eventMap[name]) {
          return eventMap[name].event.apply(context, args);
        }
      };
      if (interval) {
        if (repeat) {
          eventMap[name].type = 'repeat';
          eventMap[name].id = window.setInterval(triggerFunction, interval);
        } else {
          eventMap[name].type = 'once';
          eventMap[name].id = window.setTimeout(triggerFunction, interval);
        }
      } else {
        eventMap[name].type = 'direct';
        triggerFunction.call(this);
      }
      return this;
    };

    return EventMap;

  })();
});

define('lyria/events', ['lyria/eventmap'], function(EventMap) {
  var instance = instance || new EventMap();

  return instance;
});<commit_msg>Updated events.js to only contain lyria/events<commit_after>define('lyria/events', ['lyria/eventmap'], function(EventMap) {
  var instance = instance || new EventMap();

  return instance;
});
{'fraction_non_alphanumeric': 0.14290333010022632, 'fraction_numerical': 0.0022631749110895573, 'mean_word_length': 2.222916666666667, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 1, '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': '861083', 'n_tokens_mistral': 922, 'n_tokens_neox': 901, 'n_words': 188}