<commit_before>function MAX_CITIES() {
	// This limit is imposed by Google Maps. You can't have more than 8 waypoints
	// unless you're a "premium" customer (when you can have 23). So we're currently
	// limited to 8 cities plus the start and end cities which, for TSP, have to be
	// the same. This means we have a maximum total of 9 cities.
	// 
	// I'm not yet clear
	// on whether I can hack around this by making multiple requests and displaying
	// them all, or whether this will fundamentally limit what the size of a tour
	// that we can work with.
	return 9;
}

function make_tour_request(cities) {
	var numCities = cities.length;
	if (numCities > MAX_CITIES()) {
		throw "MAX CITIES EXCEEDED";
	}
	var index;
	var start = cities[0];
	var end = cities[numCities-1];
	var wayPts = new Array();
	for (index=1; index<numCities; ++index) {
		wayPts.push({location: cities[index], stopover:true});
	}
	
	var tourRequest = {
		origin: start,
		destination: start,
		waypoints: wayPts,
		provideRouteAlternatives: false,
		travelMode: google.maps.TravelMode.DRIVING,
		unitSystem: google.maps.UnitSystem.IMPERIAL
	}
	
	return tourRequest;
}<commit_msg>Commented out the definition of end, which we don't seem to ever use. I should actually just remove it, but this will do for now.<commit_after>function MAX_CITIES() {
	// This limit is imposed by Google Maps. You can't have more than 8 waypoints
	// unless you're a "premium" customer (when you can have 23). So we're currently
	// limited to 8 cities plus the start and end cities which, for TSP, have to be
	// the same. This means we have a maximum total of 9 cities.
	// 
	// I'm not yet clear
	// on whether I can hack around this by making multiple requests and displaying
	// them all, or whether this will fundamentally limit what the size of a tour
	// that we can work with.
	return 9;
}

function make_tour_request(cities) {
	var numCities = cities.length;
	if (numCities > MAX_CITIES()) {
		throw "MAX CITIES EXCEEDED";
	}
	var index;
	var start = cities[0];
	// var end = cities[numCities-1];
	var wayPts = new Array();
	for (index=1; index<numCities; ++index) {
		wayPts.push({location: cities[index], stopover:true});
	}
	
	var tourRequest = {
		origin: start,
		destination: start,
		waypoints: wayPts,
		provideRouteAlternatives: false,
		travelMode: google.maps.TravelMode.DRIVING,
		unitSystem: google.maps.UnitSystem.IMPERIAL
	}
	
	return tourRequest;
}
{'fraction_non_alphanumeric': 0.09765142150803462, 'fraction_numerical': 0.007416563658838072, 'mean_word_length': 3.7237354085603114, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '741185', 'n_tokens_mistral': 836, 'n_tokens_neox': 763, 'n_words': 308}