<commit_before>package lila.chat

import org.joda.time.DateTime

import lila.user.User

final class ChatPanic {

  private var until: Option[DateTime] = none

  def allowed(u: User, tighter: Boolean): Boolean =
    !(enabled || tighter) || {
      u.count.gameH > 10 && u.createdSinceDays(1) && u.isVerified
    }
  def allowed(u: User): Boolean = allowed(u, false)

  def allowed(id: User.ID, fetch: User.ID => Fu[Option[User]]): Fu[Boolean] =
    if (enabled) fetch(id) dmap { _ ?? allowed }
    else fuTrue

  def enabled =
    until exists { d =>
      d.isAfterNow || {
        until = none
        false
      }
    }

  def get = until<commit_msg>fix chat panic<commit_after>package lila.chat

import org.joda.time.DateTime

import lila.user.User

final class ChatPanic {

  private var until: Option[DateTime] = none

  def allowed(u: User, tighter: Boolean): Boolean =
    !(enabled || tighter) || {
      (u.count.gameH > 10 && u.createdSinceDays(1)) || u.isVerified
    }
  def allowed(u: User): Boolean = allowed(u, false)

  def allowed(id: User.ID, fetch: User.ID => Fu[Option[User]]): Fu[Boolean] =
    if (enabled) fetch(id) dmap { _ ?? allowed }
    else fuTrue

  def enabled =
    until exists { d =>
      d.isAfterNow || {
        until = none
        false
      }
    }

  def get = until
{'fraction_non_alphanumeric': 0.13272311212814644, 'fraction_numerical': 0.004576659038901602, 'mean_word_length': 2.737891737891738, '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': '6597263', 'n_tokens_mistral': 452, 'n_tokens_neox': 431, 'n_words': 117}