<commit_before>module.exports = {
  log: function(source, msg) {
    var date = new Date().toUTCString()
    console.log("\n[" + date + "]" + source + " " + msg + "\n")
  },

  success: function() {
    return JSON.stringify({'Success':''})
  },

  error: function(e) {
    return JSON.stringify({'Error':e})
  },

  getHash: function(id) {
    var data = new Date() + id;
    var hash = require('crypto').createHash('md5').update(data).digest('hex');
    return hash
  },

  getUser: function(models, facebookId) {
    return new Promise(function(resolve, reject) {
      models.User.findOne({
        where: { facebookId: facebookId }
      })
      .then(user => {
        if (user) {
          resolve(user)
        } else {
          reject('Error: No User with facebookId:' + facebookId)
        }
      })
    })
  },

  getGroup: function(models, groupHash) {
    return new Promise(function(resolve, reject) {
      models.Group.findOne({
        where: { hash: groupHash }
      })
      .then(group => {
        if (group) {
          resolve(group)
        } else {
          reject('Error: No Group with hash:' + groupHash)
        }
      })
    })
  },
}<commit_msg>Better date in log statements<commit_after>module.exports = {
  log: function(source, msg) {
    var date = new Date()
    var timestamp = date.getDay() + "/" +
                    date.getMonth() + "/" +
                    date.getFullYear() + " " +
                    date.getHours() + ":" +
                    date.getMinutes() + ":" +
                    date.getSeconds()
    console.log("\n[" + timestamp + "]" + source + " " + msg + "\n")
  },

  success: function() {
    return JSON.stringify({'Success':''})
  },

  error: function(e) {
    return JSON.stringify({'Error':e})
  },

  getHash: function(id) {
    var data = new Date() + id;
    var hash = require('crypto').createHash('md5').update(data).digest('hex');
    return hash
  },

  getUser: function(models, facebookId) {
    return new Promise(function(resolve, reject) {
      models.User.findOne({
        where: { facebookId: facebookId }
      })
      .then(user => {
        if (user) {
          resolve(user)
        } else {
          reject('Error: No User with facebookId:' + facebookId)
        }
      })
    })
  },

  getGroup: function(models, groupHash) {
    return new Promise(function(resolve, reject) {
      models.Group.findOne({
        where: { hash: groupHash }
      })
      .then(group => {
        if (group) {
          resolve(group)
        } else {
          reject('Error: No Group with hash:' + groupHash)
        }
      })
    })
  },
}
{'fraction_non_alphanumeric': 0.16197718631178706, 'fraction_numerical': 0.0007604562737642585, 'mean_word_length': 1.9796149490373727, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 7, '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': '459786', 'n_tokens_mistral': 831, 'n_tokens_neox': 799, 'n_words': 166}