<commit_before>function MainViewModel() {
  self = this;
  self.emails = ko.observableArray();
  self.next_url = ko.observable('/api/email/?page_size=7');
  self.previous_url = ko.observable();

  self.fetchEmails = function(url) {
    $.get(url, function(data) {
        console.log(data);
        self.next_url(data['next']);
        self.previous_url(data['previous']);
        self.emails(_.map(data['results'], function(email) {
          email.header = $.parseJSON(email.header);
          return email;
      }));
    });
  };

  self.fetchNextEmails = function() {
    self.fetchEmails(self.next_url());<commit_msg>added moment date for display and set page_size to 8<commit_after>function MainViewModel() {
  self = this;
  self.emails = ko.observableArray();
  self.next_url = ko.observable('/api/email/?page_size=8');
  self.previous_url = ko.observable();

  self.fetchEmails = function(url) {
    $.get(url, function(data) {
        console.log(data);
        self.next_url(data['next']);
        self.previous_url(data['previous']);
        self.emails(_.map(data['results'], function(email) {
          email.date = moment.utc(email.date).local().format('YYYY-MM-DD\THH:mm:ss');
          email.header = $.parseJSON(email.header);
          return email;
      }));
    });
  };

  self.fetchNextEmails = function() {
    self.fetchEmails(self.next_url());
{'fraction_non_alphanumeric': 0.17067833698030635, 'fraction_numerical': 0.002188183807439825, 'mean_word_length': 3.1957186544342506, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7573982', 'n_tokens_mistral': 450, 'n_tokens_neox': 442, 'n_words': 62}