<commit_before>function plotlyDate(isoDate) {
  var regex = /^(\d\d\d\d-\d\d-\d\d)T(\d\d:\d\d:\d\d).*/
  var result = isoDate.match(regex)
  return result.slice(1, 3).join(' ')
}

function mapDates(isoDates) {
  return isoDates.map(
    function(date) {
      return plotlyDate(date)
    }
  )
}

function extractY(hash, xpath) {
  xpath = (xpath == undefined ? '//value' : xpath)
  return JSON.search(hash, xpath)[0]
}

function getPoints(metrics, xpath) {
  return {
    x: metrics.map(function(metric) {
      return plotlyDate(metric['time'])
    }),
    y: y = metrics.map(function(metric) {
      return extractY(metric, xpath)
    })
  }
}

function extractData(hash, xpath) {
  xpath = (xpath == undefined ? '//value' : xpath)
  return JSON.search(hash, xpath)[0]
}

function extractValues(hash, xpath) {
  result = extractData(hash, xpath)
  keys = extractKeys(hash, xpath)
  return keys.map(key=>result[key])
}

function extractKeys(hash, xpath) {
  result = extractData(hash, xpath)
  return Object.keys(result)
}

function extractTitle(url) {
  var regex = /http.*metrics\/([^\/]*)[\/|\.].*/
  var result = url.match(regex)
  var words = result[1].split('-')
  return words.map(function(word) {
    return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()
  }).join(' ')
}

function snipExtension(path) {
  var bits = path.split('.')
  return bits.slice(0, bits.length - 1).join('.')
}

function extractNumber(hash) {<commit_msg>Need to be verbose here<commit_after>function plotlyDate(isoDate) {
  var regex = /^(\d\d\d\d-\d\d-\d\d)T(\d\d:\d\d:\d\d).*/
  var result = isoDate.match(regex)
  return result.slice(1, 3).join(' ')
}

function mapDates(isoDates) {
  return isoDates.map(
    function(date) {
      return plotlyDate(date)
    }
  )
}

function extractY(hash, xpath) {
  xpath = (xpath == undefined ? '//value' : xpath)
  return JSON.search(hash, xpath)[0]
}

function getPoints(metrics, xpath) {
  return {
    x: metrics.map(function(metric) {
      return plotlyDate(metric['time'])
    }),
    y: y = metrics.map(function(metric) {
      return extractY(metric, xpath)
    })
  }
}

function extractData(hash, xpath) {
  xpath = (xpath == undefined ? '//value' : xpath)
  return JSON.search(hash, xpath)[0]
}

function extractValues(hash, xpath) {
  result = extractData(hash, xpath)
  keys = extractKeys(hash, xpath)
  return keys.map(function(key) {
    return result[key]
  })
}

function extractKeys(hash, xpath) {
  result = extractData(hash, xpath)
  return Object.keys(result)
}

function extractTitle(url) {
  var regex = /http.*metrics\/([^\/]*)[\/|\.].*/
  var result = url.match(regex)
  var words = result[1].split('-')
  return words.map(function(word) {
    return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()
  }).join(' ')
}

function snipExtension(path) {
  var bits = path.split('.')
  return bits.slice(0, bits.length - 1).join('.')
}

function extractNumber(hash) {
{'fraction_non_alphanumeric': 0.17983651226158037, 'fraction_numerical': 0.006130790190735695, 'mean_word_length': 3.581903276131045, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '4491977', 'n_tokens_mistral': 1087, 'n_tokens_neox': 1087, 'n_words': 208}