<commit_before><script src="//maps.google.com/maps/api/js?v=3.18&sensor=false&client=&key=AIzaSyCDRuqzgxQ1yfXK0MzEyK2F0YvPYbK-4Hk&libraries=geometry,places&language=&hl=&region="></script> 
<script src="//google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.14/src/markerclusterer_packed.js"></script>
<script src='//google-maps-utility-library-v3.googlecode.com/svn/tags/infobox/1.1.9/src/infobox_packed.js' type='text/javascript'></script> <!-- only if you need custom infoboxes -->


<div class="row">
  <div class="col-md-3">
     <h2>Calculate your route</h2>
    <form id="calculate-route" name="calculate-route" action="#" method="get">
      <label for="from">From:</label>
      <input id="from" name="from" required="required" placeholder="An address" size="30" type="text">
      <br>
      <label for="to">To:</label>
      <input id="to" name="to" required="required" placeholder="Another address" size="30" type="text">
      <br>
      <input type="submit">
      <input type="reset">
    </form>
  </div>
  <div class="col-md-9">
    <input id="pac-input" class="controls" type="text" placeholder="Search Box">
    <div id="directions" style='width: 800px; height: 400px;'></div>
  </div>
  <p id="error"></p>
</div>
<style>
  #map {
      width: 500px;
      height: 400px;
      margin-top: 10px;
  }
  #target {
    width: 345px;
  }
</style>
<script>
var currentlocation;
var directionsDisplay = new google.maps.DirectionsRenderer();
var directionsService = new google.maps.DirectionsService();
var handler = Gmaps.build('Google');

// Create the google map
handler.buildMap({ internal: {id: 'directions'}}, function(){
  if(navigator.geolocation)
    navigator.geolocation.getCurrentPosition(displayOnMap);
  directionsDisplay.setMap(handler.getMap());
});

// Add the search bar
var input = document.getElementById('pac-input');
var searchBox = new google.maps.places.SearchBox(input);
var map = handler.map.serviceObject;

map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
map.addListener('bounds_changed', function() {
    searchBox.setBounds(map.getBounds());
  });

searchBox.addListener('places_changed', function() {
  var places = searchBox.getPlaces();

  if (places.length == 0) {
    return;
  }
  // For each place, display a route to it.
  var bounds = new google.maps.LatLngBounds();
  places.forEach(function(place) {
    calcRoute(currentlocation, place.geometry.location);
    if (place.geometry.viewport) {
      // Only geocodes have viewport.
      bounds.union(place.geometry.viewport);
    } else {
      bounds.extend(place.geometry.location);
    }
  });
  map.fitBounds(bounds);
});
// ----- end search bar

function displayOnMap(position){
  currentlocation = position;
  var marker = handler.addMarker({
    lat: position.coords.latitude,
    lng: position.coords.longitude
  });
  handler.map.centerOn(marker);
};

// Used for a route between 2 chosen points
function calculateRoute(from, to) {
  var directionsRequest = {
    origin: from,
    destination: to,
    travelMode: google.maps.DirectionsTravelMode.DRIVING,
    unitSystem: google.maps.UnitSystem.METRIC
  };
  directionsService.route(directionsRequest, function(response, status) {
    if (status == google.maps.DirectionsStatus.OK) {    
      directionsDisplay.setDirections(response);
    }
  });
}

// Used for route between current position and some other position.
function calcRoute(position, destination) {
  var origin      = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
  var request = {
      origin:      origin,
      destination: destination,
      travelMode:  google.maps.TravelMode.DRIVING
  };
  directionsService.route(request, function(response, status) {
    if (status == google.maps.DirectionsStatus.OK) {
      directionsDisplay.setDirections(response);
    }
  });
}

$(document).ready(function() {

  // If the browser supports the Geolocation API
  if (typeof navigator.geolocation == "undefined") {<commit_msg>added multiple paths<commit_after><script src="//maps.google.com/maps/api/js?v=3.18&sensor=false&client=&key=AIzaSyCDRuqzgxQ1yfXK0MzEyK2F0YvPYbK-4Hk&libraries=geometry,places&language=&hl=&region="></script> 
<script src="//google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.14/src/markerclusterer_packed.js"></script>
<script src='//google-maps-utility-library-v3.googlecode.com/svn/tags/infobox/1.1.9/src/infobox_packed.js' type='text/javascript'></script> <!-- only if you need custom infoboxes -->


<div class="row">
  <div class="col-md-3">
     <h2>Calculate your route</h2>
    <form id="calculate-route" name="calculate-route" action="#" method="get">
      <label for="from">From:</label>
      <input id="from" name="from" required="required" placeholder="An address" size="30" type="text">
      <br>
      <label for="to">To:</label>
      <input id="to" name="to" required="required" placeholder="Another address" size="30" type="text">
      <br>
      <input type="submit">
      <input type="reset">
    </form>
  </div>
  <div class="col-md-9">
    <input id="pac-input" class="controls" type="text" placeholder="Search Box">
    <div id="directions" style='width: 800px; height: 400px;'></div>
  </div>
  <p id="error"></p>
</div>
<style>
  #map {
      width: 500px;
      height: 400px;
      margin-top: 10px;
  }
  #target {
    width: 345px;
  }
</style>
<script>
var currentlocation;
var directionsDisplay = new google.maps.DirectionsRenderer();
var directionRenderers = new Array();
directionRenderers[0] = new google.maps.DirectionsRenderer();
directionRenderers[1] = new google.maps.DirectionsRenderer();
directionRenderers[2] = new google.maps.DirectionsRenderer();
var directionsService = new google.maps.DirectionsService();
var handler = Gmaps.build('Google');

// Create the google map
handler.buildMap({ internal: {id: 'directions'}}, function(){
  if(navigator.geolocation)
    navigator.geolocation.getCurrentPosition(displayOnMap);
  directionsDisplay.setMap(handler.getMap());
  directionRenderers[0].setMap(handler.getMap());
  directionRenderers[1].setMap(handler.getMap());
  directionRenderers[2].setMap(handler.getMap());
});

// Add the search bar
var input = document.getElementById('pac-input');
var searchBox = new google.maps.places.SearchBox(input);
var map = handler.map.serviceObject;

map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
map.addListener('bounds_changed', function() {
    searchBox.setBounds(map.getBounds());
  });

searchBox.addListener('places_changed', function() {
  var places = searchBox.getPlaces();

  if (places.length == 0) {
    return;
  }
  // For each place, display a route to it.
  var bounds = new google.maps.LatLngBounds();
  places.forEach(function(place) {
    calcRoute(currentlocation, place.geometry.location);
    if (place.geometry.viewport) {
      // Only geocodes have viewport.
      bounds.union(place.geometry.viewport);
    } else {
      bounds.extend(place.geometry.location);
    }
  });
  map.fitBounds(bounds);
});
// ----- end search bar

function displayOnMap(position){
  currentlocation = position;
  var marker = handler.addMarker({
    lat: position.coords.latitude,
    lng: position.coords.longitude
  });
  handler.map.centerOn(marker);
};

// Used for a route between 2 chosen points
function calculateRoute(from, to) {
  var directionsRequest = {
    origin: from,
    destination: to,
    travelMode: google.maps.DirectionsTravelMode.DRIVING,
    unitSystem: google.maps.UnitSystem.METRIC,
    provideRouteAlternatives: true,
  };
  directionsService.route(directionsRequest, function(response, status) {
    if (status == google.maps.DirectionsStatus.OK) {    
      // Clear the old routes
      for (var i = 0, len = directionRenderers.length; i < len; i++){
        directionRenderers[i].setMap(null);
      }
      for (var i = 0, len = response.routes.length; i < len; i++) {
        // Display at most 3 routes
        if (i< 3) {
          directionRenderers[i] = new google.maps.DirectionsRenderer({
            map: map,
            directions: response,
            routeIndex: i
          });  
        }
      }
    }
  });
}

// Used for route between current position and some other position.
function calcRoute(position, destination) {
  var origin      = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
  var request = {
    origin:      origin,
    destination: destination,
    travelMode: google.maps.DirectionsTravelMode.DRIVING,
    unitSystem: google.maps.UnitSystem.METRIC,
    provideRouteAlternatives: true,
  };
  directionsService.route(request, function(response, status) {
      // Clear the old routes
      for (var i = 0, len = directionRenderers.length; i < len; i++){
        directionRenderers[i].setMap(null);
      }
      for (var i = 0, len = response.routes.length; i < len; i++) {
        // Display at most 3 routes
        if (i< 3) {
          directionRenderers[i] = new google.maps.DirectionsRenderer({
            map: map,
            directions: response,
            routeIndex: i
          });  
        }
      }
  });
}

$(document).ready(function() {

  // If the browser supports the Geolocation API
  if (typeof navigator.geolocation == "undefined") {
{'fraction_non_alphanumeric': 0.14906632324533162, 'fraction_numerical': 0.010946555054732776, 'mean_word_length': 3.7352642276422765, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 73, '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': '4101697', 'n_tokens_mistral': 3045, 'n_tokens_neox': 2964, 'n_words': 597}