<commit_before>package im.mange.flakeless.innards

import java.nio.file.Paths

import im.mange.little.file.Filepath
import im.mange.little.json.{LittleJodaSerialisers, LittleSerialisers}
import org.json4s.{NoTypeHints, _}
import org.json4s.native.{JsonParser, Serialization}
import org.json4s.native.Serialization._
import org.json4s.native.JsonMethods._

//TODO: pull out the json bit to another thing

private [flakeless] case class FlightDataRecorder() {
  private val dataByFlightNumber: scala.collection.concurrent.TrieMap[Int, Seq[DataPoint]] =
    new scala.collection.concurrent.TrieMap()

  def record(flightNumber: Int, description: String) {
    val current = dataByFlightNumber.getOrElse(flightNumber, Seq.empty[DataPoint])
    dataByFlightNumber.update(flightNumber, current :+ DataPoint(flightNumber, System.currentTimeMillis(), Some(description), None, None))
  }
  def record(flightNumber: Int, command: Command, context: Context) {
    val current = dataByFlightNumber.getOrElse(flightNumber, Seq.empty[DataPoint])
    dataByFlightNumber.update(flightNumber, current :+ DataPoint(flightNumber, System.currentTimeMillis(), None, Some(command), Some(context)))
  }

  def data(flightNumber: Int): Seq[DataPoint] = dataByFlightNumber.getOrElse(flightNumber, Nil)

  def write(flightNumber: Int, outputDirectory: String) {<commit_msg>cosmetic<commit_after>package im.mange.flakeless.innards

import java.nio.file.Paths

import im.mange.little.file.Filepath
import im.mange.little.json.{LittleJodaSerialisers, LittleSerialisers}
import org.json4s.{NoTypeHints, _}
import org.json4s.native.{JsonParser, Serialization}
import org.json4s.native.Serialization._
import org.json4s.native.JsonMethods._

//TODO: pull out the json bit to another thing

private [flakeless] case class FlightDataRecorder() {
  private val dataByFlightNumber: scala.collection.concurrent.TrieMap[Int, Seq[DataPoint]] =
    new scala.collection.concurrent.TrieMap()

  def record(flightNumber: Int, description: String) {
    val current = dataByFlightNumber.getOrElse(flightNumber, Seq.empty[DataPoint])
    dataByFlightNumber.update(flightNumber, current :+ DataPoint(flightNumber, System.currentTimeMillis(), Some(description), None, None))
  }

  def record(flightNumber: Int, command: Command, context: Context) {
    val current = dataByFlightNumber.getOrElse(flightNumber, Seq.empty[DataPoint])
    dataByFlightNumber.update(flightNumber, current :+ DataPoint(flightNumber, System.currentTimeMillis(), None, Some(command), Some(context)))
  }

  def data(flightNumber: Int): Seq[DataPoint] = dataByFlightNumber.getOrElse(flightNumber, Nil)

  def write(flightNumber: Int, outputDirectory: String) {
{'fraction_non_alphanumeric': 0.10929368029739776, 'fraction_numerical': 0.002973977695167286, 'mean_word_length': 6.392857142857143, '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': '4627370', 'n_tokens_mistral': 873, 'n_tokens_neox': 832, 'n_words': 168}