<commit_before>var observable = function (base) {
	var eventListenersByType = {};
	base.addEventListener = function (type, listener, priority) {
		if (!listener) {
			listener = type;
			type = 'DefaultType';
		}
		if (!priority) {
			priority = 0;
		}
		eventListenersByType[type] = eventListenersByType[type] || [];
		eventListenersByType[type][priority] = eventListenersByType[type][priority] || [];
		eventListenersByType[type][priority].push(listener);
	};
	base.listeners = function (type) {
		var listenersByType = eventListenersByType[type || 'DefaultType'] || [],
		result = [], i;
		for (i = listenersByType.length - 1; i >= 0; i -= 1) {
			Array.prototype.push.apply(result, listenersByType[i]);
		}
		return result;
	};
	base.removeEventListener=function(type,listener){
		if (!listener) {
			listener = type;
			type = 'DefaultType';
		}
		if (eventListenersByType[type]){
			eventListenersByType[type]=eventListenersByType[type].filter(function(x){x!=listener;});
		}
	};
	base.dispatchEvent = function () {
		var eventArguments, eventType, listeners, i;
		if (arguments.length === 1) {
			eventArguments = arguments;
			eventType = 'DefaultType';
		} else {
			eventArguments = Array.prototype.slice.call(arguments, 1);
			eventType = arguments[0];
		}
		listeners = base.listeners(eventType);<commit_msg>merging new version of observable<commit_after>var observable = function (base) {
	var eventListenersByType = {};
  var eventSinks=[];
	base.addEventListener = function (type, listener, priority) {
		if (!listener) {
			listener = type;
			type = 'DefaultType';
		}
		if (!priority) {
			priority = 0;
		}
		eventListenersByType[type] = eventListenersByType[type] || [];
		eventListenersByType[type][priority] = eventListenersByType[type][priority] || [];
		eventListenersByType[type][priority].push(listener);
	};
	base.listeners = function (type) {
		var listenersByType = eventListenersByType[type || 'DefaultType'] || [],
		result = [], i;
		for (i = listenersByType.length - 1; i >= 0; i -= 1) {
			Array.prototype.push.apply(result, listenersByType[i]);
		}
		return result;
	};
	base.removeEventListener=function(type,listener){
		if (!listener) {
			listener = type;
			type = 'DefaultType';
		}
		if (eventListenersByType[type]){
			eventListenersByType[type]=eventListenersByType[type].filter(function(x){x!=listener;});
		}
	};
  base.addEventSink=function(eventSink){
    eventSinks.push(eventSink);

  }
	base.dispatchEvent = function () {
		var eventArguments, eventType, listeners, i;
		if (arguments.length === 1) {
			eventArguments = arguments;
			eventType = 'DefaultType';
		} else {
			eventArguments = Array.prototype.slice.call(arguments, 1);
			eventType = arguments[0];
		}
		for (var i in eventSinks) {
      try{
        eventSinks[i].apply(base,arguments);
			} catch (e) {
				console.log(e);
      }
    }

		listeners = base.listeners(eventType);
{'fraction_non_alphanumeric': 0.15015533310321022, 'fraction_numerical': 0.004832585433206766, 'mean_word_length': 4.386617100371748, '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': '743551', 'n_tokens_mistral': 1022, 'n_tokens_neox': 935, 'n_words': 175}