<commit_before>/*jshint curly:false,forin:false*/

AnimationFrame.shim();

window.castor =
{
	_hasClass: function( el, className ) {
		if( el.classList ) return el.classList.contains( className );
		else return new RegExp( '\\b' + className + '\\b' ).test( el.className );
	},
	_addClass: function( el, className ) {
		if( el.classList ) el.classList.add( className );
		else if( !this._hasClass( el, className )) el.className += ' ' + className;
	},
	_removeClass: function( el, className ) {
		if( el.classList ) el.classList.remove( className );
		else el.className = el.className.replace( new RegExp( '\\b' + className + '\\b', 'g' ), '' );
	},
	_toggleClass: function( el, className ) {
		if( !this._hasClass( el, className )) this._addClass( el, className );
		else this._removeClass( el, className );
	},
	_isString: function( str ) {
		return Object.prototype.toString.call( str ) === "[object String]";
	},
	_on: function( type, el, handler ) {
		if( !el )return;
		el.addEventListener( type, handler, false );
	},
	_off: function( type, el, handler ) {
		if( !el )return;
		el.removeEventListener( type, handler, false );
	},
	_cssEventEnd: function( eventType ) {
		var el = document.createElement('fakeelement');
		var cssEvents = {
			animation: {
				animation:'animationend',
				WebkitAnimation:'webkitAnimationEnd',
				MozAnimation:'animationend',
				OAnimation:'oAnimationEnd oanimationend',
			},
			transition: {
				transition:'transitionend',
				WebkitTransition:'webkitTransitionEnd',
				MozTransition:'transitionend',
				OTransition:'oTransitionEnd otransitionend',
			},
		};
		if( cssEvents.hasOwnProperty( eventType )) {
			for( eventEnd in cssEvents[eventType] ) {
				if( el.style[eventEnd] !== undefined ) {
					return cssEvents[eventType][eventEnd];
				}
			}
		}
	},
	// see: https://github.com/angus-c/just#just-extend
	_extend: function()
	{
		var args = [].slice.call( arguments );
		var deep = false;
		if( typeof args[0] === 'boolean' ) {
			deep = args.shift();<commit_msg>allow passing multiple classnames to class methods<commit_after>/*jshint curly:false,forin:false*/

AnimationFrame.shim();

window.castor =
{
	_hasClass: function( el, className ) {
		if( el.classList ) return el.classList.contains( className );
		else return new RegExp( '\\b' + className + '\\b' ).test( el.className );
	},
	_addClass: function( el, className ) {
		className.split( ' ' ).forEach( function( str ) {
			if( el.classList ) el.classList.add( str );
			else if( !this._hasClass( el, str )) el.className += ' ' + str;
		});
		return el;
	},
	_removeClass: function( el, className ) {
		className.split( ' ' ).forEach( function( str ) {
			if( el.classList ) el.classList.remove( str );
			else el.className = el.className.replace( new RegExp( '\\b' + str + '\\b', 'g' ), '' );
		});
		return el;
	},
	_toggleClass: function( el, className ) {
		if( !this._hasClass( el, className )) this._addClass( el, className );
		else this._removeClass( el, className );
	},
	_isString: function( str ) {
		return Object.prototype.toString.call( str ) === "[object String]";
	},
	_on: function( type, el, handler ) {
		if( !el )return;
		el.addEventListener( type, handler, false );
	},
	_off: function( type, el, handler ) {
		if( !el )return;
		el.removeEventListener( type, handler, false );
	},
	_cssEventEnd: function( eventType ) {
		var el = document.createElement('fakeelement');
		var cssEvents = {
			animation: {
				animation:'animationend',
				WebkitAnimation:'webkitAnimationEnd',
				MozAnimation:'animationend',
				OAnimation:'oAnimationEnd oanimationend',
			},
			transition: {
				transition:'transitionend',
				WebkitTransition:'webkitTransitionEnd',
				MozTransition:'transitionend',
				OTransition:'oTransitionEnd otransitionend',
			},
		};
		if( cssEvents.hasOwnProperty( eventType )) {
			for( var eventEnd in cssEvents[eventType] ) {
				if( el.style[eventEnd] !== undefined ) {
					return cssEvents[eventType][eventEnd];
				}
			}
		}
	},
	// see: https://github.com/angus-c/just#just-extend
	_extend: function()
	{
		var args = [].slice.call( arguments );
		var deep = false;
		if( typeof args[0] === 'boolean' ) {
			deep = args.shift();
{'fraction_non_alphanumeric': 0.1607440973050322, 'fraction_numerical': 0.0004769854519437157, 'mean_word_length': 3.8317972350230414, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6230828', 'n_tokens_mistral': 1501, 'n_tokens_neox': 1364, 'n_words': 318}