<commit_before>var gData;

function init() {
	if ( !window.arguments) window.close();
	gData = window.arguments[0];
	document.getElementById('sbSourcePreTag').value = gData.preTag;
	document.getElementById('sbSourcePreContext').value = gData.preContext;
	document.getElementById('sbSourceValue').value = gData.value;
	document.getElementById('sbSourcePostContext').value = gData.postContext;
	document.getElementById('sbSourcePostTag').value = gData.postTag;
	document.getElementById('sbSourceValue').select();
}

function accept() {
	gData.preContext = document.getElementById('sbSourcePreContext').value;
	gData.value = document.getElementById('sbSourceValue').value;
	gData.postContext = document.getElementById('sbSourcePostContext').value;
	gData.result = 1;
}<commit_msg>Hide context boxes if they are not needed.<commit_after>var gData;

function init() {
	if ( !window.arguments) window.close();
	gData = window.arguments[0];
	document.getElementById('sbSourcePreTag').value = gData.preTag;
	document.getElementById('sbSourcePreContext').value = gData.preContext;
	document.getElementById('sbSourceValue').value = gData.value;
	document.getElementById('sbSourcePostContext').value = gData.postContext;
	document.getElementById('sbSourcePostTag').value = gData.postTag;

	if (!gData.preTag) document.getElementById('sbSourcePreTag').hidden = true;
	if (!gData.preContext) document.getElementById('sbSourcePreContext').hidden = true;
	if (!gData.postContext) document.getElementById('sbSourcePostContext').hidden = true;
	if (!gData.postTag) document.getElementById('sbSourcePostTag').hidden = true;

	document.getElementById('sbSourceValue').select();
}

function accept() {
	gData.preContext = document.getElementById('sbSourcePreContext').value;
	gData.value = document.getElementById('sbSourceValue').value;
	gData.postContext = document.getElementById('sbSourcePostContext').value;
	gData.result = 1;
}
{'fraction_non_alphanumeric': 0.1395713538944067, 'fraction_numerical': 0.0020909566126502874, 'mean_word_length': 7.582959641255606, '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': '3857475', 'n_tokens_mistral': 546, 'n_tokens_neox': 540, 'n_words': 83}