<commit_before>package controllers

import com.typesafe.config.Config
import io.sdkman.repos.{CandidatesRepo => ICandidatesRepo}
import javax.inject._
import play.api.mvc._
import support.MongoConnection
import net.ceedubs.ficus.Ficus._
import net.ceedubs.ficus.readers.ArbitraryTypeReader._

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future

@Singleton
class ContextualController @Inject()(cc: ControllerComponents,
                                     candidatesRepo: CandidatesRepo,
                                     conf: Config) extends AbstractController(cc) {

  val index = Action { implicit request: Request[AnyContent] =>
    Ok(views.html.index())
  }

  val install = Action { implicit request: Request[AnyContent] =>
    Ok(views.html.install())
  }

  val usage = Action { implicit request: Request[AnyContent] =>
    Ok(views.html.usage())
  }

  val vendors = Action { implicit request: Request[AnyContent] =>
    Ok(views.html.vendors())
  }

  def jdks = Action.async { _ =>
    Future.successful(Ok(views.html.jdks(conf.as[Seq[Jdk]]("jdks.vendors"))))
  }

  def sdks = Action.async { _ =>
    candidatesRepo.findAllCandidates().map { candidates =>
      val sanitisedCandidates = candidates.filter(c => !Seq("java", "test").contains(c.candidate))<commit_msg>Sort JDKs page by distribution.<commit_after>package controllers

import com.typesafe.config.Config
import io.sdkman.repos.{CandidatesRepo => ICandidatesRepo}
import javax.inject._
import play.api.mvc._
import support.MongoConnection
import net.ceedubs.ficus.Ficus._
import net.ceedubs.ficus.readers.ArbitraryTypeReader._

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future

@Singleton
class ContextualController @Inject()(cc: ControllerComponents,
                                     candidatesRepo: CandidatesRepo,
                                     conf: Config) extends AbstractController(cc) {

  val index = Action { implicit request: Request[AnyContent] =>
    Ok(views.html.index())
  }

  val install = Action { implicit request: Request[AnyContent] =>
    Ok(views.html.install())
  }

  val usage = Action { implicit request: Request[AnyContent] =>
    Ok(views.html.usage())
  }

  val vendors = Action { implicit request: Request[AnyContent] =>
    Ok(views.html.vendors())
  }

  def jdks = Action.async { _ =>
    Future.successful(Ok(views.html.jdks(conf.as[Seq[Jdk]]("jdks.vendors").sortBy(_.distribution))))
  }

  def sdks = Action.async { _ =>
    candidatesRepo.findAllCandidates().map { candidates =>
      val sanitisedCandidates = candidates.filter(c => !Seq("java", "test").contains(c.candidate))
{'fraction_non_alphanumeric': 0.12038762579202385, 'fraction_numerical': 0.0, 'mean_word_length': 3.627586206896552, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1875049', 'n_tokens_mistral': 814, 'n_tokens_neox': 794, 'n_words': 151}