<commit_before>//////////////////////////////////////////////////////////
// Utility functions
function createXmlHttpRequest() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		return new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		throw "XMLHttpRequest not available";
	}
}
function parseQuery() {
	var parts = document.location.search.substr(1).split("&");
	var out = {};
	var tmp;
	for (var i in parts) {
		tmp = parts[i].split("=");
		out[tmp[0]] = tmp[1] ? tmp[1] : true;
	}
	return out;
}
function foreach(vs, f) {
	vs = toArray(vs);
	for (var i in vs) {
		f(vs[i]);
	}
}
function toArray(object) {
	if (!object) return [];
	else if (object.constructor == Array) return object;
	else return [object];
}
/**
 * Load a service into the current page.
 * If a service with the same name was loaded, it will be replaced.
 * If onLoad is provided, it names a function which will be called
 * when the service is ready.
 */
function loadService(name, url, onReady) {
	var old = document.getElementById(name);
	if (old != null) {
		old.parentNode.removeChild(old);
		delete old;
	}
	var head = document.getElementsByTagName("head")[0];
	var script = document.createElement('script');
	script.id = name;
	script.type = "text/javascript";
	script.src = url + "?js" + (onReady ? "&func="+encodeURIComponent(onReady) : "");
	head.appendChild(script);
}
function renderTimestamp(value) {
	document.getElementById("timestamp").innerHTML = value;
}
function renderPublication(p) {
	var pubs = document.getElementById("publications");
	pubs.innerHTML += '<div class="publication">' + publicationToHtml(p.value) + '</div>';
	renderTimestamp(p.timestamp);
	pubs.scrollTop = pubs.scrollHeight;
}
function renderTokenError(p) {
	var pubs = document.getElementById("publications");
	pubs.innerHTML += '<div class="error">'
		+ p.message
		+ (p.location
			? ' at '
				+ p.location.filename
				+ ':' + p.location.line
				+ '(' + p.location.column + ')'
			: '')
		+ '</div>';
	renderTimestamp(p.timestamp);
	pubs.scrollTop = pubs.scrollHeight;
}
function renderPrintln(p) {
	var pubs = document.getElementById("publications");
	pubs.innerHTML += '<div class="print">' + p.line + '</div>';
	renderTimestamp(p.timestamp);
	pubs.scrollTop = pubs.scrollHeight;
}
function escapeHtml(v) {
	v = v.replace(/&/g, '&amp;');
	v = v.replace(/</g, '&lt;');
	// FIXME: escape other special characters
	return v;
}
/**
 * Convert arbitrary JSON values to
 * pretty-printed HTML
 */
function jsonToHtml(v) {
	switch (typeof v) {
		case 'boolean':
			return '<font color="blue">' + v + '</font>'
		case 'number':
			return v+'';
		case 'string':
			return '<font color="grey">"'
				+ escapeHtml(v)
					.replace('"', '\\"')
					.replace('\\', '\\\\')
				+ '"</font>';
		case 'object':
			if (v == null) return 'null';
			if (v.constructor == Array) {
				var tmp = [];<commit_msg>Temporarily remove syntax highlighting of publications for the demo<commit_after>//////////////////////////////////////////////////////////
// Utility functions
function createXmlHttpRequest() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		return new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		throw "XMLHttpRequest not available";
	}
}
function parseQuery() {
	var parts = document.location.search.substr(1).split("&");
	var out = {};
	var tmp;
	for (var i in parts) {
		tmp = parts[i].split("=");
		out[tmp[0]] = tmp[1] ? tmp[1] : true;
	}
	return out;
}
function foreach(vs, f) {
	vs = toArray(vs);
	for (var i in vs) {
		f(vs[i]);
	}
}
function toArray(object) {
	if (!object) return [];
	else if (object.constructor == Array) return object;
	else return [object];
}
/**
 * Load a service into the current page.
 * If a service with the same name was loaded, it will be replaced.
 * If onLoad is provided, it names a function which will be called
 * when the service is ready.
 */
function loadService(name, url, onReady) {
	var old = document.getElementById(name);
	if (old != null) {
		old.parentNode.removeChild(old);
		delete old;
	}
	var head = document.getElementsByTagName("head")[0];
	var script = document.createElement('script');
	script.id = name;
	script.type = "text/javascript";
	script.src = url + "?js" + (onReady ? "&func="+encodeURIComponent(onReady) : "");
	head.appendChild(script);
}
function renderTimestamp(value) {
	document.getElementById("timestamp").innerHTML = value;
}
function renderPublication(p) {
	var pubs = document.getElementById("publications");
	pubs.innerHTML += '<div class="publication">' + publicationToHtml(p.value) + '</div>';
	renderTimestamp(p.timestamp);
	pubs.scrollTop = pubs.scrollHeight;
}
function renderTokenError(p) {
	var pubs = document.getElementById("publications");
	pubs.innerHTML += '<div class="error">'
		+ p.message
		+ (p.location
			? ' at '
				+ p.location.filename
				+ ':' + p.location.line
				+ '(' + p.location.column + ')'
			: '')
		+ '</div>';
	renderTimestamp(p.timestamp);
	pubs.scrollTop = pubs.scrollHeight;
}
function renderPrintln(p) {
	var pubs = document.getElementById("publications");
	pubs.innerHTML += '<div class="print">' + p.line + '</div>';
	renderTimestamp(p.timestamp);
	pubs.scrollTop = pubs.scrollHeight;
}
function escapeHtml(v) {
	v = v.replace(/&/g, '&amp;');
	v = v.replace(/</g, '&lt;');
	// FIXME: escape other special characters
	return v;
}
/**
 * Convert arbitrary JSON values to
 * pretty-printed HTML
 */
function jsonToHtml(v) {
	switch (typeof v) {
		case 'boolean':
		case 'number':
			return v+'';
		case 'string':
			return '"' + escapeHtml(v)
					.replace('"', '\\"')
					.replace('\\', '\\\\')
				+ '"';
		case 'object':
			if (v == null) return 'null';
			if (v.constructor == Array) {
				var tmp = [];
{'fraction_non_alphanumeric': 0.19054193993786675, 'fraction_numerical': 0.0017259233690024164, 'mean_word_length': 3.6583601286173635, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, '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': '1952290', 'n_tokens_mistral': 2000, 'n_tokens_neox': 1899, 'n_words': 482}