<commit_before>﻿function Install-Dnvm
{
    param (
        [bool] [Parameter(Mandatory = $false)]
        $SpecificRuntime = $false,
        [bool] [Parameter(Mandatory = $false)]
        $UnstableRuntime = $false
    )

    Write-Verbose "Entering Method Install-Dnvm"

    $dnvm = Get-Command "dnvm" -ErrorAction SilentlyContinue
    $dnvmPath = ".\Tools\dnvm.ps1"

    if ($dnvm -ne $null)
    {
        Write-Output "DNVM found:"
        Write-Output "    $($dnvm.Path)"
        $dnvmPath = $dnvm.Path
    }
    else
    {
        Write-Output "DNVM not found, instlling..."

        $dnvmPs1Path = "$PSScriptRoot\Tools"
        if (-not (Test-Path -PathType Container $dnvmPs1Path))
        {
            New-Item -ItemType Directory -Path $dnvmPs1Path
        }

        $dnvmPs1Path = "$dnvmPs1Path\dnvm.ps1"

        $webClient = New-Object System.Net.WebClient
        $webClient.Proxy = [System.Net.WebRequest]::DefaultWebProxy
        $webClient.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
        Write-Output "Downloading DNVM.ps1 to $dnvmPs1Path"
        $webClient.DownloadFile("https://raw.githubusercontent.com/aspnet/Home/dev/dnvm.ps1", $dnvmPs1Path)

        $dnvmPath = $dnvmPs1Path
    }

    $globalJson = Get-Content -Path .\global.json -Raw -ErrorAction Ignore | ConvertFrom-Json -ErrorAction Ignore

    $dnxParams = ""

    if($globalJson)
    {
        Write-Output "Take DNX version from global.json."
        $dnxVersion = $globalJson.sdk.version
        if($SpecificRuntime)
        {
            $dnxRuntime = $globalJson.sdk.runtime
            $dnxArch = $globalJson.sdk.architecture

            Write-Output "    Specific Runtime:"
            Write-Output "        Runtime: $dnxRuntime"
            Write-Output "        Architecture: $dnxArch"

            $dnxParams =  (
                "{0} {1}" -f
                    $(If(-Not [string]::IsNullOrWhiteSpace($dnxRuntime)){"-r $dnxRuntime"}),
                    $(If(-Not [string]::IsNullOrWhiteSpace($dnxArch)){"-a $dnxArch"})
            ).Trim()
        }
    }
    else
    {
        Write-Output "Unable to locate global.json to determine using 'latest'"
        $dnxVersion = "latest"
    }

    $dnxUnstable = &{If($UnstableRuntime){"-u"}}

    Write-Output "Calling: $dnvmPath install $dnxParams $dnxVersion -Persistent"
    & $dnvmPath install $dnxParams "$dnxVersion" -Persistent $dnxUnstable

    Write-Verbose "Leaving script Install-Dnvm"
}<commit_msg>Fixed extra space in dnvm install<commit_after>﻿function Install-Dnvm
{
    param (
        [bool] [Parameter(Mandatory = $false)]
        $SpecificRuntime = $false,
        [bool] [Parameter(Mandatory = $false)]
        $UnstableRuntime = $false
    )

    Write-Verbose "Entering Method Install-Dnvm"

    $dnvm = Get-Command "dnvm" -ErrorAction SilentlyContinue
    $dnvmPath = ".\Tools\dnvm.ps1"

    if ($dnvm -ne $null)
    {
        Write-Output "DNVM found:"
        Write-Output "    $($dnvm.Path)"
        $dnvmPath = $dnvm.Path
    }
    else
    {
        Write-Output "DNVM not found, instlling..."

        $dnvmPs1Path = "$PSScriptRoot\Tools"
        if (-not (Test-Path -PathType Container $dnvmPs1Path))
        {
            New-Item -ItemType Directory -Path $dnvmPs1Path
        }

        $dnvmPs1Path = "$dnvmPs1Path\dnvm.ps1"

        $webClient = New-Object System.Net.WebClient
        $webClient.Proxy = [System.Net.WebRequest]::DefaultWebProxy
        $webClient.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
        Write-Output "Downloading DNVM.ps1 to $dnvmPs1Path"
        $webClient.DownloadFile("https://raw.githubusercontent.com/aspnet/Home/dev/dnvm.ps1", $dnvmPs1Path)

        $dnvmPath = $dnvmPs1Path
    }

    $globalJson = Get-Content -Path .\global.json -Raw -ErrorAction Ignore | ConvertFrom-Json -ErrorAction Ignore

    $dnxVersion = ""
    $dnxParams = ""

    if($globalJson)
    {
        Write-Output "Take DNX version from global.json."
        $dnxVersion = $globalJson.sdk.version
        if($SpecificRuntime)
        {
            $dnxRuntime = $globalJson.sdk.runtime
            $dnxArch = $globalJson.sdk.architecture

            Write-Output "    Specific Runtime:"
            Write-Output "        Runtime: $dnxRuntime"
            Write-Output "        Architecture: $dnxArch"

            $dnxParams =  (
                "{0} {1}" -f
                    $(If(-Not [string]::IsNullOrWhiteSpace($dnxRuntime)){"-r $dnxRuntime"}),
                    $(If(-Not [string]::IsNullOrWhiteSpace($dnxArch)){"-a $dnxArch"})
            ).Trim()
        }
    }
    else
    {
        Write-Output "Unable to locate global.json to determine using 'latest'"
        $dnxVersion = "latest"
    }

    $dnxUnstable = &{If($UnstableRuntime){"-u"}}

    $dnxParams = "$dnxParams ""$dnxVersion""".Trim()

    Write-Output "Calling: $dnvmPath install $dnxParams -Persistent"
    & $dnvmPath install $dnxParams -Persistent $dnxUnstable

    Write-Verbose "Leaving script Install-Dnvm"
}
{'fraction_non_alphanumeric': 0.1282457879088206, 'fraction_numerical': 0.005550049554013875, 'mean_word_length': 2.2575855390574566, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6597895', 'n_tokens_mistral': 1655, 'n_tokens_neox': 1595, 'n_words': 303}