<commit_before>package sttp.client3.sse

import scala.util.Try

case class ServerSentEvent(
    data: Option[String] = None,
    eventType: Option[String] = None,
    id: Option[String] = None,
    retry: Option[Int] = None
)

object ServerSentEvent {
  def parseEvent(event: List[String]): ServerSentEvent = {
    event.foldLeft(ServerSentEvent()) { (event, line) =>
      line.split(":") match {
        case "data" :: content      => combineData(event, content.mkString(":"))
        case "id" :: content        => event.copy(id = Some(content.mkString(":")))
        case "retry" :: content     => event.copy(retry = Try(content.mkString(":").toInt).toOption)
        case "eventType" :: content => event.copy(eventType = Some(content.mkString(":")))<commit_msg>pattern match on list<commit_after>package sttp.client3.sse

import scala.util.Try

case class ServerSentEvent(
    data: Option[String] = None,
    eventType: Option[String] = None,
    id: Option[String] = None,
    retry: Option[Int] = None
)

object ServerSentEvent {
  def parseEvent(event: List[String]): ServerSentEvent = {
    event.foldLeft(ServerSentEvent()) { (event, line) =>
      line.split(":").toList match {
        case "data" :: content      => combineData(event, content.mkString(":"))
        case "id" :: content        => event.copy(id = Some(content.mkString(":")))
        case "retry" :: content     => event.copy(retry = Try(content.mkString(":").toInt).toOption)
        case "eventType" :: content => event.copy(eventType = Some(content.mkString(":")))
{'fraction_non_alphanumeric': 0.16354234001292825, 'fraction_numerical': 0.001292824822236587, 'mean_word_length': 3.62089552238806, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 13, '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': '2978810', 'n_tokens_mistral': 480, 'n_tokens_neox': 483, 'n_words': 102}