<commit_before>package jetbrains.buildServer.dotnet

import com.intellij.openapi.util.SystemInfo
import jetbrains.buildServer.agent.CommandLineEnvironmentVariable
import jetbrains.buildServer.agent.Environment
import jetbrains.buildServer.agent.TargetType
import jetbrains.buildServer.agent.runner.TargetRegistry
import jetbrains.buildServer.util.OSType

class EnvironmentVariablesImpl(
        private val _environment: Environment,
        private val _sharedCompilation: SharedCompilation)
    : EnvironmentVariables {
    override fun getVariables(sdkVersion: Version): Sequence<CommandLineEnvironmentVariable> = sequence {
        yieldAll(defaultVariables)

        if (_sharedCompilation.requireSuppressing(sdkVersion)) {
            yield(useSharedCompilationEnvironmentVariable)
        }

        val home = if (_environment.os == OSType.WINDOWS) "USERPROFILE" else "HOME"
        if (_environment.tryGetVariable(home).isNullOrEmpty()) {
            yield(CommandLineEnvironmentVariable(home, System.getProperty("user.home")))
        }
    }

    companion object {
        internal val defaultVariables = sequenceOf(<commit_msg>TW-60571 dotnet raises the error Failed to initialize CoreCLR, HRESULT: 0x80004005<commit_after>package jetbrains.buildServer.dotnet

import com.intellij.openapi.util.SystemInfo
import jetbrains.buildServer.agent.CommandLineEnvironmentVariable
import jetbrains.buildServer.agent.Environment
import jetbrains.buildServer.agent.TargetType
import jetbrains.buildServer.agent.runner.TargetRegistry
import jetbrains.buildServer.util.OSType

class EnvironmentVariablesImpl(
        private val _environment: Environment,
        private val _sharedCompilation: SharedCompilation)
    : EnvironmentVariables {
    override fun getVariables(sdkVersion: Version): Sequence<CommandLineEnvironmentVariable> = sequence {
        yieldAll(defaultVariables)

        if (_sharedCompilation.requireSuppressing(sdkVersion)) {
            yield(useSharedCompilationEnvironmentVariable)
        }

        val home = if (_environment.os == OSType.WINDOWS) "USERPROFILE" else "HOME"
        if (_environment.tryGetVariable(home).isNullOrEmpty()) {
            yield(CommandLineEnvironmentVariable(home, System.getProperty("user.home")))
        }
    }

    companion object {
        internal val defaultVariables = sequenceOf(
                CommandLineEnvironmentVariable("COMPlus_EnableDiagnostics", "0"),
{'fraction_non_alphanumeric': 0.07610037021801727, 'fraction_numerical': 0.006170300287947347, 'mean_word_length': 4.380530973451328, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '538818', 'n_tokens_mistral': 629, 'n_tokens_neox': 597, 'n_words': 117}