<commit_before># Note: The default directory changed from ~/AppData/Local/scoop to ~/scoop
#       on 1 Nov, 2016 to work around long paths used by NodeJS.
#       Old installations should continue to work using the old path.
#       There is currently no automatic migration path to deal
#       with updating old installations to the new path.
$scoopdir = $env:SCOOP, "$env:USERPROFILE\scoop" | select -first 1

$oldscoopdir = "$env:LOCALAPPDATA\scoop"
if((test-path $oldscoopdir) -and !$env:SCOOP) {
    $scoopdir = $oldscoopdir
}

$globaldir = $env:SCOOP_GLOBAL, "$env:ProgramData\scoop" | select -first 1

# Note: Setting the SCOOP_CACHE environment variable to use a shared directory
#       is experimental and untested. There may be concurrency issues when
#       multiple users write and access cached files at the same time.
#       Use at your own risk.
$cachedir = $env:SCOOP_CACHE, "$scoopdir\cache" | select -first 1

# helper functions
function coalesce($a, $b) { if($a) { return $a } $b }

function format($str, $hash) {
    $hash.keys | % { set-variable $_ $hash[$_] }
    $executionContext.invokeCommand.expandString($str)
}
function is_admin {
    $admin = [security.principal.windowsbuiltinrole]::administrator
    $id = [security.principal.windowsidentity]::getcurrent()
    ([security.principal.windowsprincipal]($id)).isinrole($admin)
}

# messages<commit_msg>Enable TLS 1.2 in core.ps1 (#2074)<commit_after># Note: The default directory changed from ~/AppData/Local/scoop to ~/scoop
#       on 1 Nov, 2016 to work around long paths used by NodeJS.
#       Old installations should continue to work using the old path.
#       There is currently no automatic migration path to deal
#       with updating old installations to the new path.
$scoopdir = $env:SCOOP, "$env:USERPROFILE\scoop" | select -first 1

$oldscoopdir = "$env:LOCALAPPDATA\scoop"
if((test-path $oldscoopdir) -and !$env:SCOOP) {
    $scoopdir = $oldscoopdir
}

$globaldir = $env:SCOOP_GLOBAL, "$env:ProgramData\scoop" | select -first 1

# Note: Setting the SCOOP_CACHE environment variable to use a shared directory
#       is experimental and untested. There may be concurrency issues when
#       multiple users write and access cached files at the same time.
#       Use at your own risk.
$cachedir = $env:SCOOP_CACHE, "$scoopdir\cache" | select -first 1

# Note: Github disabled TLS 1.0 support on 2018-02-23. Need to enable TLS 1.2
# for all communication with api.github.com
function enable-encryptionscheme($scheme) {
  [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor $scheme
}
enable-encryptionscheme "Tls12"

# helper functions
function coalesce($a, $b) { if($a) { return $a } $b }

function format($str, $hash) {
    $hash.keys | % { set-variable $_ $hash[$_] }
    $executionContext.invokeCommand.expandString($str)
}
function is_admin {
    $admin = [security.principal.windowsbuiltinrole]::administrator
    $id = [security.principal.windowsidentity]::getcurrent()
    ([security.principal.windowsprincipal]($id)).isinrole($admin)
}

# messages
{'fraction_non_alphanumeric': 0.11405492730210016, 'fraction_numerical': 0.011954765751211632, 'mean_word_length': 4.177257525083612, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6760248', 'n_tokens_mistral': 1007, 'n_tokens_neox': 963, 'n_words': 302}