<commit_before>package lila.base

import java.util.concurrent.TimeUnit
import scala.concurrent.duration._
import scala.concurrent.Future
import scala.util.Try

import com.typesafe.config.Config
import org.joda.time.{ DateTime, Duration }
import ornicar.scalalib.Zero
import scalaz._
import Scalaz._

import LilaTypes._

final class PimpedOption[A](private val self: Option[A]) extends AnyVal {

  import scalaz.std.{ option => o }

  def fold[X](some: A => X, none: => X): X = self.fold(none)(some)

  def |(a: => A): A = self getOrElse a

  def unary_~(implicit z: Zero[A]): A = self getOrElse z.zero
  def orDefault(implicit z: Zero[A]): A = self getOrElse z.zero

  def toSuccess[E](e: => E): scalaz.Validation[E, A] = o.toSuccess(self)(e)

  def toFailure[B](b: => B): scalaz.Validation[A, B] = o.toFailure(self)(b)

  def toTry(err: => Exception): Try[A] =
    self.fold[Try[A]](scala.util.Failure(err))(scala.util.Success.apply)

  def err(message: => String): A = self.getOrElse(sys.error(message))

  def ifNone(n: => Unit): Unit = if (self.isEmpty) n

  def has(a: A) = self contains a
}

final class PimpedString(private val s: String) extends AnyVal {

  def boot[A](v: => A): A = lila.common.Chronometer.syncEffect(v) { lap =>
    lila.log.boot.info(s"${lap.millis}ms $s")
  }
}

final class PimpedConfig(private val config: Config) extends AnyVal {

  def millis(name: String): Int = config.getDuration(name, TimeUnit.MILLISECONDS).toInt
  def seconds(name: String): Int = config.getDuration(name, TimeUnit.SECONDS).toInt
  def duration(name: String): FiniteDuration = millis(name).millis
}

final class PimpedDateTime(private val date: DateTime) extends AnyVal {
  def getSeconds: Long = date.getMillis / 1000
  def getCentis: Long = date.getMillis / 10
  def toNow: Duration = new Duration(date, DateTime.now)
}
<commit_msg>remove return type<commit_after>package lila.base

import java.util.concurrent.TimeUnit
import scala.concurrent.duration._
import scala.concurrent.Future
import scala.util.Try

import com.typesafe.config.Config
import org.joda.time.{ DateTime, Duration }
import ornicar.scalalib.Zero
import scalaz._
import Scalaz._

import LilaTypes._

final class PimpedOption[A](private val self: Option[A]) extends AnyVal {

  import scalaz.std.{ option => o }

  def fold[X](some: A => X, none: => X): X = self.fold(none)(some)

  def |(a: => A): A = self getOrElse a

  def unary_~(implicit z: Zero[A]): A = self getOrElse z.zero
  def orDefault(implicit z: Zero[A]): A = self getOrElse z.zero

  def toSuccess[E](e: => E): scalaz.Validation[E, A] = o.toSuccess(self)(e)

  def toFailure[B](b: => B): scalaz.Validation[A, B] = o.toFailure(self)(b)

  def toTry(err: => Exception): Try[A] =
    self.fold[Try[A]](scala.util.Failure(err))(scala.util.Success.apply)

  def err(message: => String): A = self.getOrElse(sys.error(message))

  def ifNone(n: => Unit): Unit = if (self.isEmpty) n

  def has(a: A) = self contains a
}

final class PimpedString(private val s: String) extends AnyVal {

  def boot[A](v: => A): A = lila.common.Chronometer.syncEffect(v) { lap =>
    lila.log.boot.info(s"${lap.millis}ms $s")
  }
}

final class PimpedConfig(private val config: Config) extends AnyVal {

  def millis(name: String): Int = config.getDuration(name, TimeUnit.MILLISECONDS).toInt
  def seconds(name: String): Int = config.getDuration(name, TimeUnit.SECONDS).toInt
  def duration(name: String): FiniteDuration = millis(name).millis
}

final class PimpedDateTime(private val date: DateTime) extends AnyVal {
  def getSeconds: Long = date.getMillis / 1000
  def getCentis: Long = date.getMillis / 10
  def toNow = new Duration(date, DateTime.now)
}

{'fraction_non_alphanumeric': 0.1429349305744623, 'fraction_numerical': 0.003267084127416281, 'mean_word_length': 4.5, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, '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': '2132135', 'n_tokens_mistral': 1346, 'n_tokens_neox': 1288, 'n_words': 335}