<commit_before>function getCurrentTemperatures() {
  $.ajax({
      method: "GET",
      url: "temperatures/average",
      dataType: "json"
    })
    .done(function (temperatures) {
      var measurements = temperatures.measurements;
      if (measurements.length == 0)
        $('#temperatures').append('<p>No readings</p>');

      for (i = 0; i < measurements.length; i++) {
        var sensor = measurements[i].sensors[0];
        var celsius = Math.round(sensor.temperature.celsius * 10) / 10;
        var host = measurements[i].host;
        var name = sensor.name;
        var lastUpdate = moment.unix(measurements[i].seconds).format('ddd HH:mm a');
        var html =
            '<div class="temperature">' +
                '<h1><span class="temperature">' + celsius + ' °C</span></h1>' +
                '<p class="source">' + host + ' (' + name.toLowerCase() + ')</p>' +
                '<span class="updated small">updated: ' + lastUpdate + '</span>' +
            '</div>';
        $('#temperatures').append('' + html);
      }

    })
    .fail(function (jqXHR, textStatus) {
      console.log("Failed to get /temperature " + textStatus);
    })<commit_msg>#1 show individual sensor names if the url is /temperatures (or leave 'as is' if getting average temperatures).<commit_after>function getCurrentTemperatures() {
  $.ajax({
      method: "GET",
      url: "temperatures/average",
      dataType: "json"
    })
    .done(function (temperatures) {
      var measurements = temperatures.measurements;
      if (measurements.length == 0)
        $('#temperatures').append('<p>No readings</p>');

        for (i = 0; i < measurements.length; i++) {
          var measurement = measurements[i];
          var sensors = measurement.sensors;
          for (j = 0; j < sensors.length; j++) {
            var sensor = sensors[j];
            var celsius = Math.round(sensor.temperature.celsius * 10) / 10;
            var lastUpdate = moment.unix(measurement.seconds).format('ddd HH:mm a');
            var sensorDescription = ''
            if (sensors.length > 1) {
              sensorDescription = '<div class="updated small">sensor : ' + sensor.name.toLowerCase() + '</div>'
            }

            var html =
                '<div class="temperature">' +
                '<h1><span class="temperature">' + celsius + ' °C</span></h1>' +
                '<p class="source">' + measurement.host + '</p>' +
                 sensorDescription +
                '<div class="updated small">updated : ' + lastUpdate + '</div>' +
                '</div>';
            $('#temperatures').append('' + html);
          }
        }
      })
      .fail(function (jqXHR, textStatus) {
        console.log("Failed to get /temperature/average " + textStatus);
      })
{'fraction_non_alphanumeric': 0.1640230713770728, 'fraction_numerical': 0.007209805335255948, 'mean_word_length': 2.1605922551252847, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 30, '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': '4875326', 'n_tokens_mistral': 823, 'n_tokens_neox': 792, 'n_words': 180}