<commit_before>/**
 * adapter.js
 *
 * A jQuery/MooTools adapter for various DOM operations.
 * -----------------------------------------------------------------------------
 *
 * Composer.js is an MVC framework for creating and organizing javascript 
 * applications. For documentation, please visit:
 *
 *     http://lyonbros.github.com/composer.js/
 * 
 * -----------------------------------------------------------------------------
 *
 * Copyright (c) 2011, Lyon Bros Enterprises, LLC. (http://www.lyonbros.com)
 * 
 * Licensed under The MIT License. 
 * Redistributions of files must retain the above copyright notice.
 */
(function() {
	"use strict";

	var global = this;

	var has_sizzle = !!global.Sizzle;
	var has_jquery = !!global.jQuery;
	var has_slick = !!global.Slick;
	var has_moo = !!global.MooTools;

	var find = (function() {
		if(has_slick)
		{
			return function(context, selector) {
				context || (context = document);
				return Slick.find(context, selector);
			};
		}
		else if(has_sizzle)
		{
			return function(context, selector) {
				context || (context = document);
				return Sizzle.select(selector, context)[0];
			};
		}
		else if(has_jquery)
		{
			return function(context, selector) {
				context || (context = document);
				return jQuery(context).find(selector)[0];
			};
		}
		else if('querySelector' in document)
		{
			var scope = false;
			try { document.querySelector(':scope > h1'); scope = true; }
			catch(e) {}

			return function(context, selector) {
				context || (context = document);
				if(scope) selector = ':scope '+selector;
				return context.querySelector(selector);
			};
		}
		throw new Error('No selector engine present. Include Sizzle/jQuery or Slick/Mootools before loading composer (or use a modern browser with document.querySelector).');
	})();

	var match = (function() {
		if(has_slick)
		{
			return function(element, selector) {
				element || (element = document);
				return Slick.match(element, selector);
			};
		}
		else if(has_sizzle)
		{
			return function(element, selector) {
				element || (element = document);
				return Sizzle.matchesSelector(element, selector);
			};
		}
		else if(has_jquery)
		{
			return function(element, selector) {
				element || (element = document);
				return jQuery(element).is(selector);
			};
		}
		else if('querySelector' in document)
		{
			return function(element, selector) {
				element || (element = document);
				if('matches' in element) var domatch = element.matches;
				if('msMatchesSelector' in element) var domatch = element.msMatchesSelector;
				if('mozMatchesSelector' in element) var domatch = element.mozMatchesSelector;
				if('webkitMatchesSelector' in element) var domatch = element.webkitMatchesSelector;
				return domatch.call(element, selector);
			};
		}
		throw new Error('No selector engine present. Include Sizzle/jQuery or Slick/Mootools before loading composer.');
	})();


	var add_event = (function() {
		return function(el, ev, fn, selector) {
			if(selector)
			{
				el.addEventListener(ev, function(event) {
					var target = event.target || event.srcElement;
					while(target)
					{
						if(match(target, selector))
						{
							fn.apply(this, [event].concat(event.params || []));
							break;
						}
						target = target.parentNode;
						if(target == el.parentNode || target == document.body.parentNode)
						{
							target = false;
						}
					}
				});
			}
			else
			{<commit_msg>adding a backward compatibility fix for mootools users: wrapping add_event events in DOMEvent (this used to happen when we used non-native events)<commit_after>/**
 * adapter.js
 *
 * A jQuery/MooTools adapter for various DOM operations.
 * -----------------------------------------------------------------------------
 *
 * Composer.js is an MVC framework for creating and organizing javascript 
 * applications. For documentation, please visit:
 *
 *     http://lyonbros.github.com/composer.js/
 * 
 * -----------------------------------------------------------------------------
 *
 * Copyright (c) 2011, Lyon Bros Enterprises, LLC. (http://www.lyonbros.com)
 * 
 * Licensed under The MIT License. 
 * Redistributions of files must retain the above copyright notice.
 */
(function() {
	"use strict";

	var global = this;

	var has_sizzle = !!global.Sizzle;
	var has_jquery = !!global.jQuery;
	var has_slick = !!global.Slick;
	var has_moo = !!global.MooTools;

	var find = (function() {
		if(has_slick)
		{
			return function(context, selector) {
				context || (context = document);
				return Slick.find(context, selector);
			};
		}
		else if(has_sizzle)
		{
			return function(context, selector) {
				context || (context = document);
				return Sizzle.select(selector, context)[0];
			};
		}
		else if(has_jquery)
		{
			return function(context, selector) {
				context || (context = document);
				return jQuery(context).find(selector)[0];
			};
		}
		else if('querySelector' in document)
		{
			var scope = false;
			try { document.querySelector(':scope > h1'); scope = true; }
			catch(e) {}

			return function(context, selector) {
				context || (context = document);
				if(scope) selector = ':scope '+selector;
				return context.querySelector(selector);
			};
		}
		throw new Error('No selector engine present. Include Sizzle/jQuery or Slick/Mootools before loading composer (or use a modern browser with document.querySelector).');
	})();

	var match = (function() {
		if(has_slick)
		{
			return function(element, selector) {
				element || (element = document);
				return Slick.match(element, selector);
			};
		}
		else if(has_sizzle)
		{
			return function(element, selector) {
				element || (element = document);
				return Sizzle.matchesSelector(element, selector);
			};
		}
		else if(has_jquery)
		{
			return function(element, selector) {
				element || (element = document);
				return jQuery(element).is(selector);
			};
		}
		else if('querySelector' in document)
		{
			return function(element, selector) {
				element || (element = document);
				if('matches' in element) var domatch = element.matches;
				if('msMatchesSelector' in element) var domatch = element.msMatchesSelector;
				if('mozMatchesSelector' in element) var domatch = element.mozMatchesSelector;
				if('webkitMatchesSelector' in element) var domatch = element.webkitMatchesSelector;
				return domatch.call(element, selector);
			};
		}
		throw new Error('No selector engine present. Include Sizzle/jQuery or Slick/Mootools before loading composer.');
	})();


	var add_event = (function() {
		return function(el, ev, fn, selector) {
			if(selector)
			{
				el.addEventListener(ev, function(event) {
					// if we have a mootools event class, wrap the event in it
					if(event && window.MooTools && window.DOMEvent) event = new DOMEvent(event);
					var target = event.target || event.srcElement;
					while(target)
					{
						if(match(target, selector))
						{
							fn.apply(this, [event].concat(event.params || []));
							break;
						}
						target = target.parentNode;
						if(target == el.parentNode || target == document.body.parentNode)
						{
							target = false;
						}
					}
				});
			}
			else
			{
{'fraction_non_alphanumeric': 0.16548166736372508, 'fraction_numerical': 0.0019517635577861424, 'mean_word_length': 2.7579884756416972, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4283385', 'n_tokens_mistral': 2567, 'n_tokens_neox': 2089, 'n_words': 555}