<commit_before>package com.enjapan.sbt.packer

import sbt.IO
import java.net.URL

object UbuntuAMIFinder {
  
  def find(instanceType:String = "ebs", hvm:Boolean = false):Map[String, Map[String,String]] = {
    IO.readLinesURL(new URL("https://cloud-images.ubuntu.com/query/trusty/server/released.current.txt"))
    .map { _.split("\t")}
    .filter {x => x(4) == instanceType && x(10) == (if (hvm) "hvm" else "paravirtual")}
    .foldLeft(Map.empty[String,Map[String,String]]) { (mapping,x) => 
      val el = (x(6) -> (mapping.get(x(6)).getOrElse(Map.empty[String,String]) + (x(5) -> x(7))))
      mapping + el
    }
  }

}<commit_msg>Added ubuntu version as parameter for AMI finder<commit_after>package com.enjapan.sbt.packer

import sbt.IO
import java.net.URL

object UbuntuAMIFinder {
  
  def find(version:String = "trusty", instanceType:String = "ebs", hvm:Boolean = false):Map[String, Map[String,String]] = {
    IO.readLinesURL(new URL(s"https://cloud-images.ubuntu.com/query/${version}/server/released.current.txt"))
    .map { _.split("\t")}
    .filter {x => x(4) == instanceType && x(10) == (if (hvm) "hvm" else "paravirtual")}
    .foldLeft(Map.empty[String,Map[String,String]]) { (mapping,x) => 
      val el = (x(6) -> (mapping.get(x(6)).getOrElse(Map.empty[String,String]) + (x(5) -> x(7))))
      mapping + el
    }
  }

}
{'fraction_non_alphanumeric': 0.19835943325876212, 'fraction_numerical': 0.010439970171513796, 'mean_word_length': 3.9888475836431225, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '7042018', 'n_tokens_mistral': 523, 'n_tokens_neox': 501, 'n_words': 85}