<commit_before>package org.javacs.kt.classpath

import java.nio.file.Path

/** A classpath resolver that ensures another resolver contains the stdlib */
internal class WithStdlibResolver(private val wrapped: ClassPathResolver) : ClassPathResolver {
    override val resolverType: String get() = "Stdlib + ${wrapped.resolverType}"
    override val classpath: Set<Path> get() = wrapWithStdlib(wrapped.classpath)
    override val classpathOrEmpty: Set<Path> get() = wrapWithStdlib(wrapped.classpathOrEmpty)
}

private fun wrapWithStdlib(paths: Set<Path>): Set<Path> {
    // Ensure that there is exactly one kotlin-stdlib present, and/or exactly one of kotlin-stdlib-common, -jdk8, etc.
    val isStdlib: ((Path) -> Boolean) = { it.toString().contains("kotlin-stdlib") }
<commit_msg>Delegate build script class path in WithStdlibResolver<commit_after>package org.javacs.kt.classpath

import java.nio.file.Path

/** A classpath resolver that ensures another resolver contains the stdlib */
internal class WithStdlibResolver(private val wrapped: ClassPathResolver) : ClassPathResolver {
    override val resolverType: String get() = "Stdlib + ${wrapped.resolverType}"
    override val classpath: Set<Path> get() = wrapWithStdlib(wrapped.classpath)
    override val classpathOrEmpty: Set<Path> get() = wrapWithStdlib(wrapped.classpathOrEmpty)
    override val buildScriptClasspath: Set<Path> get() = wrapWithStdlib(wrapped.buildScriptClasspath)
    override val buildScriptClasspathOrEmpty: Set<Path> get() = wrapWithStdlib(wrapped.buildScriptClasspathOrEmpty)
}

private fun wrapWithStdlib(paths: Set<Path>): Set<Path> {
    // Ensure that there is exactly one kotlin-stdlib present, and/or exactly one of kotlin-stdlib-common, -jdk8, etc.
    val isStdlib: ((Path) -> Boolean) = { it.toString().contains("kotlin-stdlib") }

{'fraction_non_alphanumeric': 0.10665200659703133, 'fraction_numerical': 0.0010995052226498076, 'mean_word_length': 5.431095406360424, 'pattern_counts': {'":': 0, '<': 13, '<?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': '6440730', 'n_tokens_mistral': 546, 'n_tokens_neox': 539, 'n_words': 148}