<commit_before>package lila.rating

import chess.Speed

sealed abstract class PerfType(
    val id: Perf.ID,
    val key: Perf.Key,
    val name: String,
    val title: String,
    val iconChar: Char
) {

  def iconString = iconChar.toString
}

object PerfType {

  case object UltraBullet extends PerfType(
    0,
    key = "ultraBullet",
    name = Speed.UltraBullet.name,
    title = Speed.UltraBullet.title,
    iconChar = '{'
  )

  case object Bullet extends PerfType(
    1,
    key = "bullet",
    name = Speed.Bullet.name,
    title = Speed.Bullet.title,
    iconChar = 'T'
  )

  case object Blitz extends PerfType(
    2,
    key = "blitz",
    name = Speed.Blitz.name,
    title = Speed.Blitz.title,
    iconChar = ')'
  )

  case object Classical extends PerfType(
    3,
    key = "classical",
    name = Speed.Classical.name,
    title = Speed.Classical.title,
    iconChar = '+'
  )

  case object Correspondence extends PerfType(
    4,
    key = "correspondence",
    name = "Correspondence",
    title = "Correspondence (days per turn)",
    iconChar = ';'
  )

  case object Standard extends PerfType(
    5,
    key = "standard",
    name = chess.variant.Standard.name,
    title = "Standard rules of chess",
    iconChar = '8'
  )

  case object Chess960 extends PerfType(
    11,
    key = "chess960",
    name = chess.variant.Chess960.name,
    title = "Chess960 variant",
    iconChar = '''
  )

  case object KingOfTheHill extends PerfType(
    12,
    key = "kingOfTheHill",
    name = chess.variant.KingOfTheHill.name,
    title = "King of the Hill variant",
    iconChar = '('
  )

  case object Antichess extends PerfType(
    13,
    key = "antichess",
    name = chess.variant.Antichess.name,
    title = "Antichess variant",
    iconChar = '@'
  )

  case object Atomic extends PerfType(
    14,
    key = "atomic",
    name = chess.variant.Atomic.name,
    title = "Atomic variant",
    iconChar = '>'
  )

  case object ThreeCheck extends PerfType(
    15,
    key = "threeCheck",
    name = chess.variant.ThreeCheck.name,
    title = "Three-check variant",
    iconChar = '.'
  )

  case object Horde extends PerfType(
    16,
    key = "horde",
    name = chess.variant.Horde.name,
    title = "Horde variant",
    iconChar = '_'
  )

  case object RacingKings extends PerfType(
    17,
    key = "racingKings",
    name = chess.variant.RacingKings.name,
    title = "Racing kings variant",
    iconChar = ''
  )

  case object Crazyhouse extends PerfType(
    18,
    key = "crazyhouse",
    name = chess.variant.Crazyhouse.name,
    title = "Crazyhouse variant",
    iconChar = ''
  )

  case object Puzzle extends PerfType(
    20,
    key = "puzzle",
    name = "Training",
    title = "Training puzzles",
    iconChar = '-'
  )

  val all: List[PerfType] = List(UltraBullet, Bullet, Blitz, Classical, Correspondence, Standard, Crazyhouse, Chess960, KingOfTheHill, ThreeCheck, Antichess, Atomic, Horde, RacingKings, Puzzle)
  val byKey = all map { p => (p.key, p) } toMap
  val byId = all map { p => (p.id, p) } toMap

  val default = Standard

  def apply(key: Perf.Key): Option[PerfType] = byKey get key
  def orDefault(key: Perf.Key): PerfType = apply(key) | default

  def apply(id: Perf.ID): Option[PerfType] = byId get id

  def name(key: Perf.Key): Option[String] = apply(key) map (_.name)

  def id2key(id: Perf.ID): Option[Perf.Key] = byId get id map (_.key)

  val nonPuzzle: List[PerfType] = List(UltraBullet, Bullet, Blitz, Classical, Correspondence, Crazyhouse, Chess960, KingOfTheHill, ThreeCheck, Antichess, Atomic, Horde, RacingKings)
  val nonGame: List[PerfType] = List(Puzzle)
  val leaderboardable: List[PerfType] = List(Bullet, Blitz, Classical, Crazyhouse, Chess960, KingOfTheHill, ThreeCheck, Antichess, Atomic, Horde, RacingKings)
  val variants: List[PerfType] = List(Crazyhouse, Chess960, KingOfTheHill, ThreeCheck, Antichess, Atomic, Horde, RacingKings)
  val standard: List[PerfType] = List(Bullet, Blitz, Classical, Correspondence)

  def isGame(pt: PerfType) = !nonGame.contains(pt)
<commit_msg>enable rating distribution for UltraBullet<commit_after>package lila.rating

import chess.Speed

sealed abstract class PerfType(
    val id: Perf.ID,
    val key: Perf.Key,
    val name: String,
    val title: String,
    val iconChar: Char
) {

  def iconString = iconChar.toString
}

object PerfType {

  case object UltraBullet extends PerfType(
    0,
    key = "ultraBullet",
    name = Speed.UltraBullet.name,
    title = Speed.UltraBullet.title,
    iconChar = '{'
  )

  case object Bullet extends PerfType(
    1,
    key = "bullet",
    name = Speed.Bullet.name,
    title = Speed.Bullet.title,
    iconChar = 'T'
  )

  case object Blitz extends PerfType(
    2,
    key = "blitz",
    name = Speed.Blitz.name,
    title = Speed.Blitz.title,
    iconChar = ')'
  )

  case object Classical extends PerfType(
    3,
    key = "classical",
    name = Speed.Classical.name,
    title = Speed.Classical.title,
    iconChar = '+'
  )

  case object Correspondence extends PerfType(
    4,
    key = "correspondence",
    name = "Correspondence",
    title = "Correspondence (days per turn)",
    iconChar = ';'
  )

  case object Standard extends PerfType(
    5,
    key = "standard",
    name = chess.variant.Standard.name,
    title = "Standard rules of chess",
    iconChar = '8'
  )

  case object Chess960 extends PerfType(
    11,
    key = "chess960",
    name = chess.variant.Chess960.name,
    title = "Chess960 variant",
    iconChar = '''
  )

  case object KingOfTheHill extends PerfType(
    12,
    key = "kingOfTheHill",
    name = chess.variant.KingOfTheHill.name,
    title = "King of the Hill variant",
    iconChar = '('
  )

  case object Antichess extends PerfType(
    13,
    key = "antichess",
    name = chess.variant.Antichess.name,
    title = "Antichess variant",
    iconChar = '@'
  )

  case object Atomic extends PerfType(
    14,
    key = "atomic",
    name = chess.variant.Atomic.name,
    title = "Atomic variant",
    iconChar = '>'
  )

  case object ThreeCheck extends PerfType(
    15,
    key = "threeCheck",
    name = chess.variant.ThreeCheck.name,
    title = "Three-check variant",
    iconChar = '.'
  )

  case object Horde extends PerfType(
    16,
    key = "horde",
    name = chess.variant.Horde.name,
    title = "Horde variant",
    iconChar = '_'
  )

  case object RacingKings extends PerfType(
    17,
    key = "racingKings",
    name = chess.variant.RacingKings.name,
    title = "Racing kings variant",
    iconChar = ''
  )

  case object Crazyhouse extends PerfType(
    18,
    key = "crazyhouse",
    name = chess.variant.Crazyhouse.name,
    title = "Crazyhouse variant",
    iconChar = ''
  )

  case object Puzzle extends PerfType(
    20,
    key = "puzzle",
    name = "Training",
    title = "Training puzzles",
    iconChar = '-'
  )

  val all: List[PerfType] = List(UltraBullet, Bullet, Blitz, Classical, Correspondence, Standard, Crazyhouse, Chess960, KingOfTheHill, ThreeCheck, Antichess, Atomic, Horde, RacingKings, Puzzle)
  val byKey = all map { p => (p.key, p) } toMap
  val byId = all map { p => (p.id, p) } toMap

  val default = Standard

  def apply(key: Perf.Key): Option[PerfType] = byKey get key
  def orDefault(key: Perf.Key): PerfType = apply(key) | default

  def apply(id: Perf.ID): Option[PerfType] = byId get id

  def name(key: Perf.Key): Option[String] = apply(key) map (_.name)

  def id2key(id: Perf.ID): Option[Perf.Key] = byId get id map (_.key)

  val nonPuzzle: List[PerfType] = List(UltraBullet, Bullet, Blitz, Classical, Correspondence, Crazyhouse, Chess960, KingOfTheHill, ThreeCheck, Antichess, Atomic, Horde, RacingKings)
  val nonGame: List[PerfType] = List(Puzzle)
  val leaderboardable: List[PerfType] = List(UltraBullet, Bullet, Blitz, Classical, Crazyhouse, Chess960, KingOfTheHill, ThreeCheck, Antichess, Atomic, Horde, RacingKings)
  val variants: List[PerfType] = List(Crazyhouse, Chess960, KingOfTheHill, ThreeCheck, Antichess, Atomic, Horde, RacingKings)
  val standard: List[PerfType] = List(Bullet, Blitz, Classical, Correspondence)

  def isGame(pt: PerfType) = !nonGame.contains(pt)

{'fraction_non_alphanumeric': 0.1165321594521888, 'fraction_numerical': 0.012227928588897041, 'mean_word_length': 3.1224798387096775, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4026722', 'n_tokens_mistral': 3018, 'n_tokens_neox': 2814, 'n_words': 755}