<commit_before>
const request = require('request')
const fs = require('fs')
const cheerio = require('cheerio')
const tableparser = require('cheerio-tableparser')

let url = 'http://travel-made-simple.com/carry-on-size-chart/'
request(url, (err, res, body)=> {
  const $ = cheerio.load(body)
  tableparser($)
  let table = $(".carryonsize").parsetable(false,false,true)

  let airlines = []
  for(let i=1; i<table[0].length; i++){
    airlines.push({
      name: table[0][i],
      imperial: {
        height: Number(table[1][i]),
        width:  Number(table[2][i]),
        depth:  Number(table[3][i]),
        linear: Number(table[4][i]),
        weight: Number(table[5][i])
      },
      metric: {
        height: Number(table[1][i])*2.54, //Inches -> Centimeters
        width:  Number(table[2][i])*2.54,
        depth:  Number(table[3][i])*2.54,
        linear: Number(table[4][i])*2.54,
        weight: Number(table[5][i])*0.453592 //Pounds -> Kilo
      }
    })
  }
  writeOut(airlines)
})

function writeOut(file){
  fs.writeFile("./airline_list.json", JSON.stringify(file), (err) => {
      if (err) {
        console.error(err)
      }
      else{
        console.log('airline_list.json created.')
      }
  })
}
<commit_msg>added comments<commit_after>
const request = require('request')
const fs = require('fs')
const cheerio = require('cheerio')
const tableparser = require('cheerio-tableparser')

let url = 'http://travel-made-simple.com/carry-on-size-chart/'
request(url, (err, res, body)=> {
  const $ = cheerio.load(body)
  tableparser($)
  let table = $(".carryonsize").parsetable(false,false,true)

  let airlines = []
  for(let i=1; i<table[0].length; i++){
    airlines.push({
      name: table[0][i],
      imperial: {
        height: Number(table[1][i]), //Inches
        width:  Number(table[2][i]),
        depth:  Number(table[3][i]),
        linear: Number(table[4][i]),
        weight: Number(table[5][i]) //Pounds
      },
      metric: {
        height: Number(table[1][i])*2.54, //Inches -> Centimeters
        width:  Number(table[2][i])*2.54,
        depth:  Number(table[3][i])*2.54,
        linear: Number(table[4][i])*2.54,
        weight: Number(table[5][i])*0.453592 //Pounds -> Kilo
      }
    })
  }
  writeOut(airlines)
})

function writeOut(file){
  fs.writeFile("./airline_list.json", JSON.stringify(file), (err) => {
      if (err) {
        console.error(err)
      }
      else{
        console.log('airline_list.json created.')
      }
  })
}

{'fraction_non_alphanumeric': 0.19414360208584036, 'fraction_numerical': 0.025671881267549136, 'mean_word_length': 2.8606811145510838, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '2160008', 'n_tokens_mistral': 918, 'n_tokens_neox': 895, 'n_words': 149}