<commit_before>Element.prototype.addClass = function(cname) {
	if (!this.className) {
		this.className = cname;
	}
	else {
		var a = this.className.split(" ");
		if (a.indexOf(cname) == -1) {
			a.push(cname);
			this.className = a.join(" ");
		}
	}
}
Element.prototype.removeClass = function(cname) {
	if (this.className) {
		if (this.className == cname) {
			this.className = "";
		}
		else {
			var a = this.className.split(" ");
			var i = a.indexOf(cname);
			if (i != -1) {
				a.splice(i, 1);
				this.className = a.join(" ");
			}
		}
	}
}

Element.prototype.hasClass = function(cname) {
	return (this.className.match("(^| )"+cname+"( |$)") ? true : false);
}

if (typeof(document.getElementsByClassName) != "function") {
	HTMLDocument.prototype.getElementsByClassName = function(cname) {
		var a = [];
		var re = new RegExp('(^| )'+cname+'( |$)');
		var els = this.getElementsByTagName("*");
		for(var i=0,j=els.length; i<j; i++)
				if(re.test(els[i].className))a.push(els[i]);
		return a;
	}
	Element.prototype.getElementsByClassName = function(cname) {
		var a = [];
		var re = new RegExp('(^| )'+cname+'( |$)');
		var els = this.getElementsByTagName("*");
		for(var i=0,j=els.length; i<j; i++)
				if(re.test(els[i].className))a.push(els[i]);
		return a;
	}
}

HTMLDocument.prototype.getElementByClassName = function(cname) {
	var els = this.getElementsByClassName(cname);
	if (els.length)
		return els[0];
	return null;
}
Element.prototype.getElementByClassName = function(cname) {
	var els = this.getElementsByClassName(cname);
	if (els.length)
		return els[0];
	return null;
}

Element.prototype.trigger = function(type) {
	if ("createEvent" in document) {
    var evt = document.createEvent("HTMLEvents");
    evt.initEvent(type, false, true);
    this.dispatchEvent(evt);
	}
	else
    this.fireEvent("on"+type);
}

Element.prototype.expand = function() {
	var t = getStyle(this, "transition-duration");
	t = parseInt(parseFloat(t.replace("s", ""))*1000);
	var inner;
	for (var i=0; i<this.childNodes.length; i++) {
		if (this.childNodes[i].nodeType == 1) {
			inner = this.childNodes[i];
			break;
		}
	}
	if (!inner)
		return;
	var el = this;
	this.style.height = "0px";
	this.addClass("active");
	setTimeout(function() {
		el.style.height = inner.offsetHeight+"px";
		setTimeout(function(){
			el.addClass("no-transition");
			el.style.height = "auto";
			el.style.overflow = "visible";
			setTimeout(function() {
				el.removeClass("no-transition");
			}, 1);
		}, t);
	}, 1);
}
Element.prototype.collapse = function() {
	var t = getStyle(this, "transition-duration");
	t = parseInt(parseFloat(t.replace("s", ""))*1000);
	var inner;
	for (var i=0; i<this.childNodes.length; i++) {
		if (this.childNodes[i].nodeType == 1) {
			inner = this.childNodes[i];
			break;
		}
	}
	if (!inner)
		return;
	var el = this;
	this.removeClass("active");
	this.addClass("no-transition");
	this.style.height = inner.offsetHeight+"px";
	this.style.overflow = "hidden";
	setTimeout(function() {
		el.removeClass("no-transition");
		setTimeout(function(){
			el.style.height = "0";
		}, 1);
	}, 1);
}
Element.prototype.expandCollapse = function() {
	if (this.hasClass("active"))
		this.collapse();
	else
		this.expand();
}

if (typeof(window.addEventListener) != "function") {<commit_msg>Added height argument for Element.collapse().<commit_after>Element.prototype.addClass = function(cname) {
	if (!this.className) {
		this.className = cname;
	}
	else {
		var a = this.className.split(" ");
		if (a.indexOf(cname) == -1) {
			a.push(cname);
			this.className = a.join(" ");
		}
	}
}
Element.prototype.removeClass = function(cname) {
	if (this.className) {
		if (this.className == cname) {
			this.className = "";
		}
		else {
			var a = this.className.split(" ");
			var i = a.indexOf(cname);
			if (i != -1) {
				a.splice(i, 1);
				this.className = a.join(" ");
			}
		}
	}
}

Element.prototype.hasClass = function(cname) {
	return (this.className.match("(^| )"+cname+"( |$)") ? true : false);
}

if (typeof(document.getElementsByClassName) != "function") {
	HTMLDocument.prototype.getElementsByClassName = function(cname) {
		var a = [];
		var re = new RegExp('(^| )'+cname+'( |$)');
		var els = this.getElementsByTagName("*");
		for(var i=0,j=els.length; i<j; i++)
				if(re.test(els[i].className))a.push(els[i]);
		return a;
	}
	Element.prototype.getElementsByClassName = function(cname) {
		var a = [];
		var re = new RegExp('(^| )'+cname+'( |$)');
		var els = this.getElementsByTagName("*");
		for(var i=0,j=els.length; i<j; i++)
				if(re.test(els[i].className))a.push(els[i]);
		return a;
	}
}

HTMLDocument.prototype.getElementByClassName = function(cname) {
	var els = this.getElementsByClassName(cname);
	if (els.length)
		return els[0];
	return null;
}
Element.prototype.getElementByClassName = function(cname) {
	var els = this.getElementsByClassName(cname);
	if (els.length)
		return els[0];
	return null;
}

Element.prototype.trigger = function(type) {
	if ("createEvent" in document) {
    var evt = document.createEvent("HTMLEvents");
    evt.initEvent(type, false, true);
    this.dispatchEvent(evt);
	}
	else
    this.fireEvent("on"+type);
}

Element.prototype.expand = function() {
	var t = getStyle(this, "transition-duration");
	t = parseInt(parseFloat(t.replace("s", ""))*1000);
	var inner;
	for (var i=0; i<this.childNodes.length; i++) {
		if (this.childNodes[i].nodeType == 1) {
			inner = this.childNodes[i];
			break;
		}
	}
	if (!inner)
		return;
	var el = this;
	this.style.height = "0px";
	this.addClass("active");
	setTimeout(function() {
		el.style.height = inner.offsetHeight+"px";
		setTimeout(function(){
			el.addClass("no-transition");
			el.style.height = "auto";
			el.style.overflow = "visible";
			setTimeout(function() {
				el.removeClass("no-transition");
			}, 1);
		}, t);
	}, 1);
}
Element.prototype.collapse = function(height) {
	if (!height)
		height = 0;
	else if (typeof(height) == "number")
		height = height+"px";
	var t = getStyle(this, "transition-duration");
	t = parseInt(parseFloat(t.replace("s", ""))*1000);
	var inner;
	for (var i=0; i<this.childNodes.length; i++) {
		if (this.childNodes[i].nodeType == 1) {
			inner = this.childNodes[i];
			break;
		}
	}
	if (!inner)
		return;
	var el = this;
	this.removeClass("active");
	this.addClass("no-transition");
	this.style.height = inner.offsetHeight+"px";
	this.style.overflow = "hidden";
	setTimeout(function() {
		el.removeClass("no-transition");
		setTimeout(function(){
			el.style.height = height;
		}, 1);
	}, 1);
}
Element.prototype.expandCollapse = function(height) {
	if (this.hasClass("active"))
		this.collapse(height);
	else
		this.expand();
}

if (typeof(window.addEventListener) != "function") {
{'fraction_non_alphanumeric': 0.19342359767891681, 'fraction_numerical': 0.007439369141496801, 'mean_word_length': 4.077039274924472, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, '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': '225870', 'n_tokens_mistral': 2649, 'n_tokens_neox': 2479, 'n_words': 452}