<commit_before>(() => {
  "use strict";
  
	const init = () => {
		if (navigator.geolocation && sessionStorage.getItem("last_location")==null) {
            navigator.geolocation.getCurrentPosition(successFunction, (e) => console.log("failed: "+e.message));
			console.log("inside");
		} else {
			console.log("no location or item set");
		}
	};
	
    const successFunction = (position) => {
        let lat = position.coords.latitude;
        let lng = position.coords.longitude;
		let response = JSON.parse(httpGet("https://maps.googleapis.com/maps/api/geocode/json?latlng="+lat+","+lng+"&key=<KEY>"));
		//let response = JSON.parse(httpGet("https://maps.googleapis.com/maps/api/geocode/json?latlng=41.025389,16.554028&key=<KEY>"));
        console.log(response);
        let region = response.results[0].address_components.find((obj) => obj.types[0] == "administrative_area_level_1").long_name;
		let regionElement = document.createElement("option");
		regionElement.innerHTML = region;
		regionElement.selected = "selected";
		$("#dropdown-menu form select").add(regionElement);
		$("#dropdown-menu form select").form.submit();
		sessionStorage.setItem("last_location", region);
    };

	const httpGet = (url) => {
		let xmlHttp = new XMLHttpRequest();
		xmlHttp.open( "GET", url, false ); // false for synchronous request
		xmlHttp.send( null );
		return xmlHttp.responseText;
	}

	const $ = document.querySelector.bind(document);
	const $$ = document.querySelectorAll.bind(document);
	
	init();
	
})();<commit_msg>Fixed redirect loop in iOS<commit_after>(() => {
  "use strict";
  
	const init = () => {
		if (navigator.geolocation && sessionStorage.getItem("last_location")==null) {
            navigator.geolocation.getCurrentPosition(successFunction, (e) => console.log("failed: "+e.message));
			console.log("inside");
		} else {
			console.log("no location or item set");
		}
	};
	
    const successFunction = (position) => {
        let lat = position.coords.latitude;
        let lng = position.coords.longitude;
		let response = JSON.parse(httpGet("https://maps.googleapis.com/maps/api/geocode/json?latlng="+lat+","+lng+"&key=<KEY>"));
		//let response = JSON.parse(httpGet("https://maps.googleapis.com/maps/api/geocode/json?latlng=41.025389,16.554028&key=<KEY>"));
        console.log(response);
        let region = response.results[0].address_components.find((obj) => obj.types[0] == "administrative_area_level_1").long_name;
		let regionElement = document.createElement("option");
		regionElement.innerHTML = region;
		regionElement.selected = "selected";
	    	sessionStorage.setItem("last_location", region);
		$("#dropdown-menu form select").add(regionElement);
		$("#dropdown-menu form select").form.submit();
    };

	const httpGet = (url) => {
		let xmlHttp = new XMLHttpRequest();
		xmlHttp.open( "GET", url, false ); // false for synchronous request
		xmlHttp.send( null );
		return xmlHttp.responseText;
	}

	const $ = document.querySelector.bind(document);
	const $$ = document.querySelectorAll.bind(document);
	
	init();
	
})();
{'fraction_non_alphanumeric': 0.17271835132482827, 'fraction_numerical': 0.012430487405953549, 'mean_word_length': 4.299826689774696, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '1146915', 'n_tokens_mistral': 1026, 'n_tokens_neox': 961, 'n_words': 162}