<commit_before>/**
 * @preserve EventEmitter v3.0.0
 * 
 * Copyright 2011, <NAME> (<EMAIL>)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * https://github.com/Wolfy87/EventEmitter
 */

function EventEmitter() {
	// Initialise variables
	var listeners = {},
		instance = this;
	
	/**
	 * Passes every listener for a specified event to a function one at a time
	 */
	instance.eachListener = function(type, callback) {
		// Initialise variables
		var i = null,
			possibleListeners = null;
		
		// Only loop if the type exists
		if(listeners.hasOwnProperty(type)) {
			possibleListeners = listeners[type];
			
			for(i = 0; i < possibleListeners.length; i += 1) {
				if(callback.call(instance, possibleListeners[i]) === false) {
					break;
				}
			}
		}
	};
	
	/**
	 * Event class
	 * Contains Event methods and property storage
	 */
	instance.Event = function(type, listener, scope, once) {
		// Initialise variables
		var instance = this;
		
		// Store arguments
		instance.type = type;
		instance.listener = listener;
		instance.active = true;
		instance.once = once;
		
		/**
		 * Executes the listener
		 */
		instance.fire = function(args) {
			// Only execute if the event is active
			if(instance.active) {
				this.listener.apply(scope || this, args);
			}
			
			// Disable the event if this is a once only event
			if(instance.once) {
				instance.active = false;
			}
		};
	};
	
	/**
	 * Adds an event listener for the specified event
	 */
	instance.addListener = function(type, listener, scope, once) {
		// Create the listener array if it does not exist yet
		if(!listeners.hasOwnProperty(type)) {<commit_msg>Moved the looping method under the event class<commit_after>/**
 * @preserve EventEmitter v3.0.0
 * 
 * Copyright 2011, <NAME> (<EMAIL>ell.<EMAIL>)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * https://github.com/Wolfy87/EventEmitter
 */

function EventEmitter() {
	// Initialise variables
	var listeners = {},
		instance = this;
	
	/**
	 * Event class
	 * Contains Event methods and property storage
	 */
	instance.Event = function(type, listener, scope, once) {
		// Initialise variables
		var instance = this;
		
		// Store arguments
		instance.type = type;
		instance.listener = listener;
		instance.active = true;
		instance.once = once;
		
		/**
		 * Executes the listener
		 */
		instance.fire = function(args) {
			// Only execute if the event is active
			if(instance.active) {
				this.listener.apply(scope || this, args);
			}
			
			// Disable the event if this is a once only event
			if(instance.once) {
				instance.active = false;
			}
		};
	};
	
	/**
	 * Passes every listener for a specified event to a function one at a time
	 */
	instance.eachListener = function(type, callback) {
		// Initialise variables
		var i = null,
			possibleListeners = null;
		
		// Only loop if the type exists
		if(listeners.hasOwnProperty(type)) {
			possibleListeners = listeners[type];
			
			for(i = 0; i < possibleListeners.length; i += 1) {
				if(callback.call(instance, possibleListeners[i]) === false) {
					break;
				}
			}
		}
	};
	
	/**
	 * Adds an event listener for the specified event
	 */
	instance.addListener = function(type, listener, scope, once) {
		// Create the listener array if it does not exist yet
		if(!listeners.hasOwnProperty(type)) {
{'fraction_non_alphanumeric': 0.11851628468033776, 'fraction_numerical': 0.007237635705669481, 'mean_word_length': 2.9441141498216408, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 8, 'https://': 2, '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': '6395363', 'n_tokens_mistral': 1167, 'n_tokens_neox': 984, 'n_words': 309}