<commit_before>package controllers

import play.api.mvc._
import model._
import lib.{AmazonConnection, Config}
import java.text.DecimalFormat
import scala.concurrent.ExecutionContext

import ExecutionContext.Implicits.global

object Application extends Controller {

  implicit lazy val amazonConnection = new AmazonConnection(Config.credentials, Config.clientConfiguration)
  implicit val moneyFormat = new DecimalFormat("#,###.00")

  def index = Authenticated { implicit req =>
    Estate().stages.headOption map (stage =>
      Redirect(routes.Application.stage(stage))
    ) getOrElse (
      Ok(views.html.loading())
    )
  }

  def stage(stage: String) = Authenticated { implicit req =>
    if (Estate().populated)
      Ok(views.html.index(
        stage,
        Estate(),
        AWSCost.totalSunkCost
      ))
    else
      Ok(views.html.loading())
  }

  def instance(id: String) = Authenticated.async {
    Instance.get(id) map (i => Ok(views.html.instance(i)))
  }

  def es(name: String) = Authenticated {
    val asg = Estate().values.flatten.find(_.name == name)
    val esHost = asg.flatMap(_.members.headOption).map(_.instance.publicDns)
    asg map {
      case a: ElasticSearchASG => Ok(views.html.elasticsearch(a, esHost))
      case _ => NotFound
    } getOrElse Ok(views.html.loading())
  }

  def void = Action {
    NotFound
  }
  def robots = Action {
    Ok(
      """
        |User-agent: *
        |Disallow: *
      """.stripMargin)
  }
}
<commit_msg>Make the instance page based off already gathered info<commit_after>package controllers

import play.api.mvc._
import model._
import lib.{AmazonConnection, Config}
import java.text.DecimalFormat
import scala.concurrent.ExecutionContext

import ExecutionContext.Implicits.global

object Application extends Controller {

  implicit lazy val amazonConnection = new AmazonConnection(Config.credentials, Config.clientConfiguration)
  implicit val moneyFormat = new DecimalFormat("#,###.00")

  def index = Authenticated { implicit req =>
    Estate().stages.headOption map (stage =>
      Redirect(routes.Application.stage(stage))
    ) getOrElse (
      Ok(views.html.loading())
    )
  }

  def stage(stage: String) = Authenticated { implicit req =>
    if (Estate().populated)
      Ok(views.html.index(
        stage,
        Estate(),
        AWSCost.totalSunkCost
      ))
    else
      Ok(views.html.loading())
  }

  def instance(id: String) = Authenticated {
    val instance = for {
      asgs <- Estate().values
      asg <- asgs
      member <- asg.members if member.id == id
    } yield member
    instance.headOption map (i => Ok(views.html.instance(i.instance))) getOrElse NotFound
  }

  def es(name: String) = Authenticated {
    val asg = Estate().values.flatten.find(_.name == name)
    val esHost = asg.flatMap(_.members.headOption).map(_.instance.publicDns)
    asg map {
      case a: ElasticSearchASG => Ok(views.html.elasticsearch(a, esHost))
      case _ => NotFound
    } getOrElse Ok(views.html.loading())
  }

  def void = Action {
    NotFound
  }
  def robots = Action {
    Ok(
      """
        |User-agent: *
        |Disallow: *
      """.stripMargin)
  }
}

{'fraction_non_alphanumeric': 0.11976047904191617, 'fraction_numerical': 0.0012606366214938543, 'mean_word_length': 3.017721518987342, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 15, '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': '2742306', 'n_tokens_mistral': 995, 'n_tokens_neox': 976, 'n_words': 218}