<commit_before>var battery = navigator.battery || navigator.webkitBattery || navigator.mozBattery;

function log(message){
  document.querySelector("#data").innerHTML += message + "<br />";
}

if (battery) {
	log("Battery level: " + battery.level);
	log("Battery charging: " + battery.charging);
	log("Battery discharging time: ", battery.dischargingTime);
	battery.addEventListener("chargingchange", function(e) {
	  log("Battery chargingchange event: " + battery.charging);
	}, false);
} else {
	log("Shame! The Battery API is not supported on this platform.")
}<commit_msg>  Merge branch 'master' of https://github.com/samdutton/simpl<commit_after>var battery = navigator.battery || navigator.webkitBattery || navigator.mozBattery;

function log(message){
  document.querySelector("#data").innerHTML += message + "<br />";
}

function logBattery(battery) {
	log("Battery level: " + battery.level);
	log("Battery charging: " + battery.charging);
	log("Battery discharging time: ", battery.dischargingTime);
	battery.addEventListener("chargingchange", function(e) {
	  log("Battery chargingchange event: " + battery.charging);
	}, false);
}

if(navigator.getBattery) {
	navigator.getBattery().then(logBattery, function() {
		log("There was an error while getting the battery state.");
	});
} else if (battery) {
	logBattery(battery);
} else {
	log("Shame! The Battery API is not supported on this platform.")
}
{'fraction_non_alphanumeric': 0.15166548547129696, 'fraction_numerical': 0.0, 'mean_word_length': 5.660377358490566, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '2083877', 'n_tokens_mistral': 443, 'n_tokens_neox': 430, 'n_words': 101}