<commit_before>if (navigator.geolocation) {
	navigator.geolocation.getCurrentPosition(function(position) {
		var lat = position.coords.latitude;
		var long = position.coords.longitude;
		var wCode = "";
		$.getJSON(
			"https://fcc-weather-api.glitch.me/api/current?lat=" + lat + "&lon=" + long,
			function(json) {
				$("#myLoc").html(json.name + ", " + json.sys.country);
				$("#myTemp").html(json.main.temp + " Celsius");
				// $("#myConditions").html(json.weather[0].main + ", " + json.weather[0].description);
				$("#myConditions").html(json.weather[0].description);
				//get weather condition string to make compairison for custom icons
				iCond = json.weather[0].id;

				// Fall back on default icons if no match is found
				if (getWeatherIcon(iCond) === -1) {
					$("#icon").html("<img src=" + json.weather[0].icon + ">");
				} else {
					// Use my included icon pack
					$("#icon").html(getWeatherIcon(iCond));
				}
			}
		);
	});
} else {
	$("#myLoc").html("Cannot Determine Location");
}
<commit_msg>Adds: User can now switch   units of temperature via clicking on the temperature.<commit_after>if (navigator.geolocation) {
	navigator.geolocation.getCurrentPosition(function(position) {
		var lat = position.coords.latitude;
		var long = position.coords.longitude;
		var wCode = "";
		var temp = "";
		//default units from api are metric
		var tUnit = "C"
		$.getJSON(
			"https://fcc-weather-api.glitch.me/api/current?lat=" + lat + "&lon=" + long,
			function(json) {
				$("#myLoc").html(json.name + ", " + json.sys.country);
				var temp = json.main.temp;
				$("#myTemp").text(temp + " C");
				
				// Change the temperature units
				$("#myTemp").on('click', function() {
					//if C >>> F 
					if(tUnit === "C") { 
						temp = parseFloat(temp) * 1.8 + 32;
						tUnit = "F";
					} else { 
						temp = (parseFloat(temp) - 32) / 1.8;
						tUnit = "C";
					}
					// Render the html
					$("#myTemp").text(temp.toFixed(2) + " " + tUnit);

				});
				// $("#myConditions").html(json.weather[0].main + ", " + json.weather[0].description);
				$("#myConditions").html(json.weather[0].description);
				//get weather condition string to make compairison for custom icons
				iCond = json.weather[0].id;

				// Fall back on default icons if no match is found
				if (getWeatherIcon(iCond) === -1) {
					$("#icon").html("<img src=" + json.weather[0].icon + ">");
				} else {
					// Use my included icon pack
					$("#icon").html(getWeatherIcon(iCond));
				}
			}
		);
	});
} else {
	$("#myLoc").html("Cannot Determine Location");
}



{'fraction_non_alphanumeric': 0.1943146417445483, 'fraction_numerical': 0.008177570093457943, 'mean_word_length': 3.020344287949922, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 2, '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': '646892', 'n_tokens_mistral': 1052, 'n_tokens_neox': 868, 'n_words': 181}