<commit_before>package ambiguity
import scala.collection.{mutable => smutable}

object Utility {
  def notImplemented[A]: A = throw new NotImplementedError("not implemented.")

  def toMapList[A,B](c: Iterable[(A,B)]): Map[A,List[B]] =
    c.groupBy(_._1).mapValues(_.map(_._2).toList)

  def toMapSet[A,B](c: Iterable[(A,B)]): Map[A,Set[B]] =
    c.groupBy(_._1).mapValues(_.map(_._2).toSet)

  def doWhile(f: => Boolean): Unit =
    if (f) doWhile(f)

  def splitWhitespace(s: String): List[String] =
    s.split("""\s+""").toList match {
      case "" :: x => x
      case x => x
    }

  def escape(raw: String): String = {
    import scala.reflect.runtime.universe._
    Literal(Constant(raw)).toString
  }

  // Iterate a function until referential equality fixpoint is reached
  def fixRef[A <: AnyRef](x: A)(f: A => A): A = {
    val fx = f(x)
    if (x eq fx) x else fixRef(fx)(f)
  }

  def allSome[A](xs: List[Option[A]]): Option[List[A]] = xs match {
    case Nil => Some(Nil)
    case None::_ => None
    case Some(x)::xs => allSome(xs) match {
      case None => None
      case Some(xs) => Some(x::xs)
    }
  }

  // Memoize the fixpoint of a recursive function
  def fixpoint[A,B](base: B, f: (A => B, A) => B): A => B = {
    val done = smutable.Map[A,B]()
    val next = smutable.Map[A,B]()
    val active = smutable.Set[A]()
    var changed = false
    def fix(a: A): B = {
      done get a match {
        case Some(b) => b
        case None => next get a match {
          case None =>
            changed = true
            active += a
            next(a) = base
            val b = f(fix,a)
            if (b != base)
              next(a) = b
            b
          case Some(b) =>
            if (active contains a)
              b
            else {
              active += a
              val c = f(fix,a)<commit_msg>ambiguity.Utility: Don't rename mutable to smutable<commit_after>package ambiguity
import scala.collection.mutable

object Utility {
  def notImplemented[A]: A = throw new NotImplementedError("not implemented.")

  def toMapList[A,B](c: Iterable[(A,B)]): Map[A,List[B]] =
    c.groupBy(_._1).mapValues(_.map(_._2).toList)

  def toMapSet[A,B](c: Iterable[(A,B)]): Map[A,Set[B]] =
    c.groupBy(_._1).mapValues(_.map(_._2).toSet)

  def doWhile(f: => Boolean): Unit =
    if (f) doWhile(f)

  def splitWhitespace(s: String): List[String] =
    s.split("""\s+""").toList match {
      case "" :: x => x
      case x => x
    }

  def escape(raw: String): String = {
    import scala.reflect.runtime.universe._
    Literal(Constant(raw)).toString
  }

  // Iterate a function until referential equality fixpoint is reached
  def fixRef[A <: AnyRef](x: A)(f: A => A): A = {
    val fx = f(x)
    if (x eq fx) x else fixRef(fx)(f)
  }

  def allSome[A](xs: List[Option[A]]): Option[List[A]] = xs match {
    case Nil => Some(Nil)
    case None::_ => None
    case Some(x)::xs => allSome(xs) match {
      case None => None
      case Some(xs) => Some(x::xs)
    }
  }

  // Memoize the fixpoint of a recursive function
  def fixpoint[A,B](base: B, f: (A => B, A) => B): A => B = {
    val done = mutable.Map[A,B]()
    val next = mutable.Map[A,B]()
    val active = mutable.Set[A]()
    var changed = false
    def fix(a: A): B = {
      done get a match {
        case Some(b) => b
        case None => next get a match {
          case None =>
            changed = true
            active += a
            next(a) = base
            val b = f(fix,a)
            if (b != base)
              next(a) = b
            b
          case Some(b) =>
            if (active contains a)
              b
            else {
              active += a
              val c = f(fix,a)
{'fraction_non_alphanumeric': 0.1591704820899542, 'fraction_numerical': 0.0021545919741448962, 'mean_word_length': 2.1288963774220724, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 36, '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': '129096', 'n_tokens_mistral': 1331, 'n_tokens_neox': 1299, 'n_words': 351}