<commit_before>function getJsonFromUrl(hashBased) {
	var query;
	if (hashBased) {
		var pos = location.href.indexOf("?");
		if (pos==-1) return [];
		query = location.href.substr(pos+1);
	} else {
		query = location.search.substr(1);
	}
	var result = {};
	query.split("&").forEach(function(part) {
		if (!part) return;
		var item = part.split("=");
		var key = item[0];
		var val = decodeURIComponent(item[1]);
		var from = key.indexOf("[");
		if (from==-1) {
			result[key] = val;
		} else {
			var to = key.indexOf("]");
			var index = key.substring(from+1,to);
			key = key.substring(0,from);
			if (!result[key]) {
				result[key] = [];
			}
			if (!index) {
				result[key].push(val);
			} else {
				result[key][index] = val;
			}
		}
	});
	return result;
}

window.onload = function() {
	var params = getJsonFromUrl(window.location.search);
	if (document.querySelector("#signup") !== null) {
		document.querySelector("#flexid").value = params.flexid;
		document.querySelector("#flexidtype").value = params.flexidtype;
		var link = document.querySelector("#login");
		link.setAttribute("href", link.attributes.href+window.location.search);
	} else if (document.querySelector("#login") !== null) {
		var link = document.querySelector("#signup");
		link.setAttribute("href", link.attributes.href+window.location.search);
	}
};<commit_msg>Fix small JS bug<commit_after>function getJsonFromUrl(hashBased) {
	var query;
	if (hashBased) {
		var pos = location.href.indexOf("?");
		if (pos==-1) return [];
		query = location.href.substr(pos+1);
	} else {
		query = location.search.substr(1);
	}
	var result = {};
	query.split("&").forEach(function(part) {
		if (!part) return;
		var item = part.split("=");
		var key = item[0];
		var val = decodeURIComponent(item[1]);
		var from = key.indexOf("[");
		if (from==-1) {
			result[key] = val;
		} else {
			var to = key.indexOf("]");
			var index = key.substring(from+1,to);
			key = key.substring(0,from);
			if (!result[key]) {
				result[key] = [];
			}
			if (!index) {
				result[key].push(val);
			} else {
				result[key][index] = val;
			}
		}
	});
	return result;
}

window.onload = function() {
	var params = getJsonFromUrl(window.location.search);
	if (document.querySelector("#signup") !== null) {
		document.querySelector("#flexid").value = params.flexid;
		document.querySelector("#flexidtype").value = params.flexidtype;
		var link = document.querySelector("#login");
		link.setAttribute("href", link.href+window.location.search);
	} else if (document.querySelector("#login") !== null) {
		var link = document.querySelector("#signup");
		link.setAttribute("href", link.href+window.location.search);
	}
};
{'fraction_non_alphanumeric': 0.19287054409005627, 'fraction_numerical': 0.00600375234521576, 'mean_word_length': 4.10727969348659, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2606869', 'n_tokens_mistral': 992, 'n_tokens_neox': 923, 'n_words': 173}