<commit_before>package mixit

import com.mongodb.ConnectionString
import com.samskivert.mustache.Mustache
import mixit.repository.PostRepository
import mixit.repository.EventRepository
import mixit.repository.TalkRepository
import mixit.repository.UserRepository
import mixit.support.*
import org.springframework.boot.ApplicationRunner
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration
import org.springframework.boot.autoconfigure.data.mongo.ReactiveMongoDataAutoConfiguration
import org.springframework.boot.autoconfigure.data.mongo.ReactiveMongoRepositoriesAutoConfiguration
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration
import org.springframework.context.MessageSource
import org.springframework.context.annotation.Bean
import org.springframework.core.env.Environment
import org.springframework.data.mongodb.ReactiveMongoDatabaseFactory
import org.springframework.data.mongodb.core.ReactiveMongoTemplate
import org.springframework.data.mongodb.core.SimpleReactiveMongoDatabaseFactory
import org.springframework.web.reactive.function.server.RouterFunction
import org.springframework.web.reactive.function.server.ServerResponse
import org.springframework.web.reactive.result.view.mustache.MustacheResourceTemplateLoader
import org.springframework.web.reactive.result.view.mustache.MustacheViewResolver



@SpringBootApplication(exclude = arrayOf(MongoAutoConfiguration::class, MongoDataAutoConfiguration::class, ReactiveMongoRepositoriesAutoConfiguration::class, ReactiveMongoDataAutoConfiguration::class))
class Application {

    @Bean
    fun viewResolver(messageSource: MessageSource) = MustacheViewResolver().apply {
        val prefix = "classpath:/templates/"
        val suffix = ".mustache"
        val loader = MustacheResourceTemplateLoader(prefix, suffix)
        setPrefix(prefix)
        setSuffix(suffix)
        setCompiler(Mustache.compiler().escapeHTML(false).withLoader(loader))
        setModelCustomizer({ model, exchange ->  customizeModel(model, exchange, messageSource) })
    }

    @Bean
    fun routerFunction(routesProvider: List<RouterFunctionProvider>) =
        routesProvider.map { it.invoke() }.reduce(RouterFunction<ServerResponse>::and)

    @Bean
    fun databaseFactory(env: Environment) = SimpleReactiveMongoDatabaseFactory(ConnectionString(env.getProperty("mongo.uri")))

    @Bean
    fun template(databaseFactory: ReactiveMongoDatabaseFactory) = ReactiveMongoTemplate(databaseFactory)

    @Bean
    fun filter(env: Environment) = MixitWebFilter(env.getProperty("baseUri"))

    @Bean
    fun markdownConverter() = MarkdownConverter()

    @Bean
    fun dataInitializer(userRepository: UserRepository, eventRepository: EventRepository, talkRepository: TalkRepository,
                        postRepository: PostRepository) = ApplicationRunner {
        userRepository.initData()
        eventRepository.initData()
        talkRepository.initData()
        postRepository.initData()
    }

}

fun main(args: Array<String>) {
    run(Application::class, *args)
}
<commit_msg>Remove uneeded excludes<commit_after>package mixit

import com.mongodb.ConnectionString
import com.samskivert.mustache.Mustache
import mixit.repository.PostRepository
import mixit.repository.EventRepository
import mixit.repository.TalkRepository
import mixit.repository.UserRepository
import mixit.support.*
import org.springframework.boot.ApplicationRunner
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.context.MessageSource
import org.springframework.context.annotation.Bean
import org.springframework.core.env.Environment
import org.springframework.data.mongodb.ReactiveMongoDatabaseFactory
import org.springframework.data.mongodb.core.ReactiveMongoTemplate
import org.springframework.data.mongodb.core.SimpleReactiveMongoDatabaseFactory
import org.springframework.web.reactive.function.server.RouterFunction
import org.springframework.web.reactive.function.server.ServerResponse
import org.springframework.web.reactive.result.view.mustache.MustacheResourceTemplateLoader
import org.springframework.web.reactive.result.view.mustache.MustacheViewResolver


@SpringBootApplication
class Application {

    @Bean
    fun viewResolver(messageSource: MessageSource) = MustacheViewResolver().apply {
        val prefix = "classpath:/templates/"
        val suffix = ".mustache"
        val loader = MustacheResourceTemplateLoader(prefix, suffix)
        setPrefix(prefix)
        setSuffix(suffix)
        setCompiler(Mustache.compiler().escapeHTML(false).withLoader(loader))
        setModelCustomizer({ model, exchange ->  customizeModel(model, exchange, messageSource) })
    }

    @Bean
    fun routerFunction(routesProvider: List<RouterFunctionProvider>) =
        routesProvider.map { it.invoke() }.reduce(RouterFunction<ServerResponse>::and)

    @Bean
    fun databaseFactory(env: Environment) = SimpleReactiveMongoDatabaseFactory(ConnectionString(env.getProperty("mongo.uri")))

    @Bean
    fun template(databaseFactory: ReactiveMongoDatabaseFactory) = ReactiveMongoTemplate(databaseFactory)

    @Bean
    fun filter(env: Environment) = MixitWebFilter(env.getProperty("baseUri"))

    @Bean
    fun markdownConverter() = MarkdownConverter()

    @Bean
    fun dataInitializer(userRepository: UserRepository, eventRepository: EventRepository, talkRepository: TalkRepository,
                        postRepository: PostRepository) = ApplicationRunner {
        userRepository.initData()
        eventRepository.initData()
        talkRepository.initData()
        postRepository.initData()
    }

}

fun main(args: Array<String>) {
    run(Application::class, *args)
}

{'fraction_non_alphanumeric': 0.08571428571428572, 'fraction_numerical': 0.0, 'mean_word_length': 5.475336322869955, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '2632001', 'n_tokens_mistral': 1484, 'n_tokens_neox': 1446, 'n_words': 240}