<commit_before>package models

import com.mongodb.casbah.commons.Imports._
import com.novus.salat._
import com.mongodb.casbah.MongoConnection

package object context {
  object DB {
    lazy val connection = {
      import com.mongodb.casbah.commons.Imports._
      import com.mongodb.casbah.MongoConnection
      import play.api.Play
      import play.api.Play.current

      val conn = MongoConnection(
          Play.configuration.getString("mongo.url").getOrElse("localhost"), 
          Play.configuration.getInt("mongo.port").getOrElse(27017))(
              Play.configuration.getString("mongo.dbname").getOrElse("salat-dao"))
      for {
          dbuser <- Play.configuration.getString("mongo.user")
          dbpasswd <- Play.configuration.getString("mongo.password")
        } conn.authenticate(dbuser, dbpasswd)
      conn
    }
  }

  implicit val ctx = {
    import com.novus.salat._
    import play.api.Play
    import play.api.Play.current
    val c = new Context {
      val name = "play-salat-context"
    }
    c.registerClassLoader(Play.classloader)
    c
  }
}<commit_msg>fixed mongo db connection<commit_after>package models

import com.mongodb.casbah.commons.Imports._
import com.novus.salat._
import com.mongodb.casbah.MongoConnection

package object context {
  object DB {
    lazy val connection = {
      import com.mongodb.casbah.commons.Imports._
      import com.mongodb.casbah.MongoConnection
      import play.api.Play
      import play.api.Play.current

      val conn = MongoConnection(
          Play.configuration.getString("mongo.url").getOrElse("127.0.0.1"), 
          Play.configuration.getInt("mongo.port").getOrElse(27017))(
              Play.configuration.getString("mongo.dbname").getOrElse("salat-dao"))
      for {
          dbuser <- Play.configuration.getString("mongo.user")
          dbpasswd <- Play.configuration.getString("mongo.password")
        } conn.authenticate(dbuser, dbpasswd)
      conn
    }
  }

  implicit val ctx = {
    import com.novus.salat._
    import play.api.Play
    import play.api.Play.current
    val c = new Context {
      val name = "play-salat-context"
    }
    c.registerClassLoader(Play.classloader)
    c
  }
}
{'fraction_non_alphanumeric': 0.11237488626023658, 'fraction_numerical': 0.007279344858962694, 'mean_word_length': 2.733446519524618, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '1968983', 'n_tokens_mistral': 711, 'n_tokens_neox': 681, 'n_words': 115}