<commit_before><!DOCTYPE html>
<html>

<head>
  <title>Getting started - Underscore.map.reduce</title>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore.js"></script>
</head>

<body>
  <div>Example output:</div>
  <div id="output"></div>
  <script>
    var people = [{
      name: "<NAME>",
      birthYear: 1953,
      awardYear: 2009
    }, {
      name: "<NAME>",
      birthYear: 1936,
      awardYear: 2010
    }, {
      name: "<NAME>",
      birthYear: 1931,
      awardYear: 2011
    }, {
      name: "<NAME>",
      birthYear: 1955,
      awardYear: 2012
    }, {
      name: "<NAME>",
      birthYear: 1931,
      awardYear: 2013
    }, {
      name: "<NAME>",
      birthYear: 1945,
      awardYear: 2014
    }];


    $(document).ready(function() {
      var peopleWithAwardAge = _.map(people, function(person) {
        return {
          name: person.name,
          awardAge: person.awardYear - person.birthYear
        };
      });

      var averageAwardAge = _.reduce(peopleWithAwardAge, function(memo, person) {
        return memo + person.awardAge;
      }, 0) / peopleWithAwardAge.length;

      $("#output").html("<br />Award age for people:");
      _.each(peopleWithAwardAge, function(person) {
        var existingContent = $("#output").html();
        var newContent = " - " + person.name + " was " + person.awardAge + " years old";
        $("#output").html(existingContent + "<br />" + newContent);
      });

      $("#output").html($("#output").html() + "<br /><br />" + "Average award age is " + Math.floor(averageAwardAge) + " years old.");
    });
  </script>
</body>

</html><commit_msg>improved UI code<commit_after><!DOCTYPE html>
<html>

<head>
  <title>Getting started - Underscore.map.reduce</title>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore.js"></script>
</head>

<body>
  <div>Example output:</div>
  <div id="output"></div>
  <script>
    var people = [{
      name: "<NAME>",
      birthYear: 1953,
      awardYear: 2009
    }, {
      name: "<NAME>",
      birthYear: 1936,
      awardYear: 2010
    }, {
      name: "<NAME>",
      birthYear: 1931,
      awardYear: 2011
    }, {
      name: "<NAME>",
      birthYear: 1955,
      awardYear: 2012
    }, {
      name: "<NAME>",
      birthYear: 1931,
      awardYear: 2013
    }, {
      name: "<NAME>",
      birthYear: 1945,
      awardYear: 2014
    }];


    $(document).ready(function() {
      var peopleWithAwardAge = _.map(people, function(person) {
        return {
          name: person.name,
          awardAge: person.awardYear - person.birthYear
        };
      });

      var averageAwardAge = _.reduce(peopleWithAwardAge, function(memo, person) {
        return memo + person.awardAge;
      }, 0) / peopleWithAwardAge.length;

      var outputContent = "<br />Award age for people:";
      _.each(peopleWithAwardAge, function(person) {
        outputContent += "<br />";
        outputContent += " - " + person.name + " was " + person.awardAge + " years old";
      });

      outputContent += "<br /><br />" + "Average award age is " + Math.floor(averageAwardAge) + " years old.";
      $("#output").html(outputContent);
    });
  </script>
</body>

</html>
{'fraction_non_alphanumeric': 0.17757009345794392, 'fraction_numerical': 0.03271028037383177, 'mean_word_length': 2.4181636726546905, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 61, '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': '7652476', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1115, 'n_words': 219}