<commit_before>;(function () {
	var roundNumber = function (number, decimals) {
		return Math.round(number * Math.pow(10, decimals)) / Math.pow(10, decimals);
	},

	toArray = function (object) {
		return [].slice.call(object);
	},

	convert = function (value, from, to, base, dpi, decimals) {
		var units = from + '-' + to,
			result,
			formulas = {
				'cm-em': value / 0.42175176,
				'cm-in': value * 0.39,
				'cm-mm': value * 10,
				'cm-pc': value / 0.42175176,
				'cm-pt': value * 28.3464566929,
				'cm-%': value / base * 100 / 2.54 * dpi,
				'cm-px': value / 2.54 * dpi,

				'em-cm': value * 0.42175176,
				'em-in': value * 0.166044,
				'em-mm': value / 0.237106301584,
				'em-pc': value,
				'em-pt': value * 11.955168,
				'em-%': value * 100,
				'em-px': value * base,

				'in-cm': value * 2.54,
				'in-em': value / 0.166044,
				'in-mm': value * 2.54 * 10,
				'in-pc': value / 0.166044,
				'in-pt': value / 0.014842519685,
				'in-%': value / base * 100 * dpi,
				'in-px': value * dpi,

				'mm-cm': value / 10,
				'mm-em': value * 0.237106301584,
				'mm-in': value * 0.39 / 10,
				'mm-pc': value / 4.42175176,
				'mm-pt': value / 0.352777777778,
				'mm-%': value / base * 100 / 2.54 * dpi / 10,
				'mm-px': value / 2.54 * dpi / 10,

				'pc-cm': value * 0.42175176,
				'pc-em': value,
				'pc-in': value * 0.166044,
				'pc-mm': value * 4.42175176,
				'pc-pt': value / 0.0836458341698,
				'pc-%': value * 100,
				'pc-px': value * base,

				'pt-cm': value / 28.3464566929,
				'pt-em': value / 11.955168,
				'pt-in': value * 0.014842519685,
				'pt-mm': value * 0.352777777778,
				'pt-pc': value * 0.0836458341698,
				'pt-%': value / (base - 4) * 100,
				'pt-px': value * 96 / 72,

				'%-cm': value * base / 100 * 2.54 / dpi,
				'%-em': value / 100,
				'%-in': value * base / 100 / dpi,
				'%-mm': value * base / 100 * 2.54 / dpi * 10,
				'%-pc': value / 100,
				'%-pt': value * (base - 4) / 100,
				'%-px': value * base / 100,

				'px-cm': value * 2.54 / dpi,
				'px-em': value / base,
				'px-in': value / dpi,
				'px-mm': value * 2.54 / dpi * 10,
				'px-pc': value / base,
				'px-pt': value * 72 / 96,
				'px-%': value / base * 100
			};

		result = formulas[units] || value;

		return (isNaN(result) ? 'N/A' : roundNumber(result, decimals) + to);
	},

	setupForm = function () {
		var selects = document.querySelectorAll('select'),
			settings = document.querySelectorAll('.settings input'),
			fragment = document.createDocumentFragment(),
			options = [],
			units = ['cm', 'em', 'in', 'mm', 'pc', 'pt', '%', 'px'];

		// Add the units
		units.forEach(function (unit) {
			var option = document.createElement('option');

			option.value = unit;
			option.textContent = unit;

			fragment.appendChild(option);
		});

		toArray(selects).forEach(function (select) {
			var fromUnit = localStorage.getItem('from-unit'),
				toUnit = localStorage.getItem('to-unit');

			select.appendChild(fragment.cloneNode(true));
		});<commit_msg>Auto save from value and selected units<commit_after>;(function () {
	var roundNumber = function (number, decimals) {
		return Math.round(number * Math.pow(10, decimals)) / Math.pow(10, decimals);
	},

	toArray = function (object) {
		return [].slice.call(object);
	},

	convert = function (value, from, to, base, dpi, decimals) {
		var units = from + '-' + to,
			result,
			formulas = {
				'cm-em': value / 0.42175176,
				'cm-in': value * 0.39,
				'cm-mm': value * 10,
				'cm-pc': value / 0.42175176,
				'cm-pt': value * 28.3464566929,
				'cm-%': value / base * 100 / 2.54 * dpi,
				'cm-px': value / 2.54 * dpi,

				'em-cm': value * 0.42175176,
				'em-in': value * 0.166044,
				'em-mm': value / 0.237106301584,
				'em-pc': value,
				'em-pt': value * 11.955168,
				'em-%': value * 100,
				'em-px': value * base,

				'in-cm': value * 2.54,
				'in-em': value / 0.166044,
				'in-mm': value * 2.54 * 10,
				'in-pc': value / 0.166044,
				'in-pt': value / 0.014842519685,
				'in-%': value / base * 100 * dpi,
				'in-px': value * dpi,

				'mm-cm': value / 10,
				'mm-em': value * 0.237106301584,
				'mm-in': value * 0.39 / 10,
				'mm-pc': value / 4.42175176,
				'mm-pt': value / 0.352777777778,
				'mm-%': value / base * 100 / 2.54 * dpi / 10,
				'mm-px': value / 2.54 * dpi / 10,

				'pc-cm': value * 0.42175176,
				'pc-em': value,
				'pc-in': value * 0.166044,
				'pc-mm': value * 4.42175176,
				'pc-pt': value / 0.0836458341698,
				'pc-%': value * 100,
				'pc-px': value * base,

				'pt-cm': value / 28.3464566929,
				'pt-em': value / 11.955168,
				'pt-in': value * 0.014842519685,
				'pt-mm': value * 0.352777777778,
				'pt-pc': value * 0.0836458341698,
				'pt-%': value / (base - 4) * 100,
				'pt-px': value * 96 / 72,

				'%-cm': value * base / 100 * 2.54 / dpi,
				'%-em': value / 100,
				'%-in': value * base / 100 / dpi,
				'%-mm': value * base / 100 * 2.54 / dpi * 10,
				'%-pc': value / 100,
				'%-pt': value * (base - 4) / 100,
				'%-px': value * base / 100,

				'px-cm': value * 2.54 / dpi,
				'px-em': value / base,
				'px-in': value / dpi,
				'px-mm': value * 2.54 / dpi * 10,
				'px-pc': value / base,
				'px-pt': value * 72 / 96,
				'px-%': value / base * 100
			};

		result = formulas[units] || value;

		return (isNaN(result) ? 'N/A' : roundNumber(result, decimals) + to);
	},

	setupForm = function () {
		var from = document.querySelector('.from'),
			selects = document.querySelectorAll('select'),
			settings = document.querySelectorAll('.settings input'),
			fragment = document.createDocumentFragment(),
			options = [],
			units = ['cm', 'em', 'in', 'mm', 'pc', 'pt', '%', 'px'];

		// Set from value
		from.value = localStorage.getItem(from.name) || '';

		// Add the units
		units.forEach(function (unit) {
			var option = document.createElement('option');

			option.value = unit;
			option.textContent = unit;

			fragment.appendChild(option);
		});

		toArray(selects).forEach(function (select) {
			var unit = localStorage.getItem(select.name),
				selected;

			if (unit) {
				selected = fragment.querySelector('[value=' + unit + ']');
				selected.defaultSelected = true;
			}

			select.appendChild(fragment.cloneNode(true));

			if (selected) {
				selected.defaultSelected = false;
			}
		});
{'fraction_non_alphanumeric': 0.20414673046251994, 'fraction_numerical': 0.10717703349282297, 'mean_word_length': 2.3933982683982684, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '84027', 'n_tokens_mistral': 3400, 'n_tokens_neox': 2440, 'n_words': 583}