<commit_before>$(document).ready(function() {
  const maps = document.querySelectorAll('.map');
  if (!maps) return;
  maps.forEach((map) => {
    const coords = JSON.parse(map.dataset.coords);
    // const bounds = new L.LatLngBounds(coords);
    // map.fitBounds(bounds);
    const thisMap = L.map(map).setView([coords[0], coords[1]], 15);
    L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}@2x.png', {
      attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, <a href="https://carto.com/attribution">CARTO</a>'
    }).addTo(thisMap);
    for (let i = 0; i < coords.length / 2; i++) {
      const marker = L.marker([coords[i], coords[i + 1]]).addTo(thisMap);
    }
    thisMap.scrollWheelZoom.disable();
  });
});<commit_msg>leaflet better handling null values and fitting to bounds<commit_after>$(document).ready(function() {
  const maps = document.querySelectorAll('.map');
  if (!maps) return;
  maps.forEach((map) => {
    const coords = JSON.parse(map.dataset.coords);
    if (coords.length === 0) return;
    const thisMap = L.map(map).setView([coords[0], coords[1]], 15);
    L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}@2x.png', {
      attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, <a href="https://carto.com/attribution">CARTO</a>'
    }).addTo(thisMap);
    const bounds = [];
    for (let i = 0; i < coords.length; i += 2) {
      const marker = L.marker([coords[i], coords[i + 1]]).addTo(thisMap);
      bounds.push([coords[i], coords[i + 1]]);
    }
    thisMap.fitBounds(bounds).zoomOut();
    thisMap.scrollWheelZoom.disable();
  });
});
{'fraction_non_alphanumeric': 0.2110787172011662, 'fraction_numerical': 0.010495626822157435, 'mean_word_length': 3.902857142857143, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '5241062', 'n_tokens_mistral': 642, 'n_tokens_neox': 619, 'n_words': 99}