<commit_before>package io.udash.rest

import com.avsystem.commons._
import io.udash.rest.raw.HttpErrorException
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.servlet.{ServletContextHandler, ServletHolder}
import org.scalatest.BeforeAndAfterAll
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.time.{Seconds, Span}
import sttp.client.{HttpError, SttpBackend}
import sttp.client.asynchttpclient.WebSocketHandler

import java.util.concurrent.Executors
import scala.concurrent.duration._
import scala.concurrent.{Await, ExecutionContext, Future}
import scala.util.Random

trait Waiter {
  def wait(millis: Int): Future[String]
}

object Waiter extends DefaultRestApiCompanion[Waiter]

object WaiterImpl extends Waiter {
  implicit val executionContext: ExecutionContext =
    ExecutionContext.fromExecutorService(Executors.newCachedThreadPool())

  override def wait(millis: Int): Future[String] = Future {
    Thread.sleep(millis)
    s"waited $millis"
  }
}

class RestServletTest extends AnyFunSuite with BeforeAndAfterAll {
  val port = Random.between(32768, 65536)<commit_msg>fixed scala 2.12 compilation<commit_after>package io.udash.rest

import com.avsystem.commons._
import io.udash.rest.raw.HttpErrorException
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.servlet.{ServletContextHandler, ServletHolder}
import org.scalatest.BeforeAndAfterAll
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.time.{Seconds, Span}
import sttp.client.{HttpError, SttpBackend}
import sttp.client.asynchttpclient.WebSocketHandler

import java.util.concurrent.Executors
import scala.concurrent.duration._
import scala.concurrent.{Await, ExecutionContext, Future}
import scala.util.Random

trait Waiter {
  def wait(millis: Int): Future[String]
}

object Waiter extends DefaultRestApiCompanion[Waiter]

object WaiterImpl extends Waiter {
  implicit val executionContext: ExecutionContext =
    ExecutionContext.fromExecutorService(Executors.newCachedThreadPool())

  override def wait(millis: Int): Future[String] = Future {
    Thread.sleep(millis)
    s"waited $millis"
  }
}

class RestServletTest extends AnyFunSuite with BeforeAndAfterAll {
  val port: Int = 32768 + Random.nextInt(32768)
{'fraction_non_alphanumeric': 0.08673250322026621, 'fraction_numerical': 0.0098754830399313, 'mean_word_length': 6.213622291021672, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3954250', 'n_tokens_mistral': 736, 'n_tokens_neox': 720, 'n_words': 149}