<commit_before>function! Cmtest(A,L,P)
    " return system('conda info -e')
    return g:condaenvs
endfunction


set wildcharm=<Tab>

function! Showcm()
    unlet g:condaenvs
    let g:condaenvs = system('conda info -e')
    echo g:condaenvs
    let tags = input("Change env to: ", "	", "custom,Cmtest")
    echo tags
endfunction


function! SetCondaPlainPath()
python << EOF
import os
import subprocess
import json
path = os.getenv('PATH')
conda_default_env = os.getenv('CONDA_DEFAULT_ENV')
if not conda_default_env:
    pass
else:
    output = subprocess.check_output('conda info --json', shell=True)
    d = json.loads(output)
    # TODO Check whether the generator comprehension also works.
    path = os.pathsep.join([x for x in path.split(os.pathsep) if d['default_prefix'] not in x])
vim.command("let l:temppath = '" + path + "'")
EOF
return l:temppath
endfunction


" Setting global paths - We use these to switch between conda envs.
if exists("$CONDA_DEFAULT_ENV")
    let g:conda_startup_env = $CONDA_DEFAULT_ENV
else
    let g:conda_startup_env = ""
end


if !exists("g:conda_plain_path")
    " If vim is started from inside a conda path, this variable will
    " contain the path WITHOUT the extra conda env bits.
    let g:conda_plain_path = SetCondaPlainPath()
endif


if !exists("g:conda_startup_path")
    let g:conda_startup_path = $PATH
endif


function! CondaActivate(envname, envpath)
    let $CONDA_DEFAULT_ENV = a:envname
    let $PATH = a:envpath . ';' . a:envpath . '\Scripts' .';' . g:conda_plain_path
endfunction


function! CondaDeactivate()
    let $CONDA_DEFAULT_ENV = g:conda_startup_env<commit_msg>Platform handling for $PATH manipulation.<commit_after>function! Cmtest(A,L,P)
    " return system('conda info -e')
    return g:condaenvs
endfunction


set wildcharm=<Tab>

function! Showcm()
    unlet g:condaenvs
    let g:condaenvs = system('conda info -e')
    echo g:condaenvs
    let tags = input("Change env to: ", "	", "custom,Cmtest")
    echo tags
endfunction


function! SetCondaPlainPath()
python << EOF
import os
import subprocess
import json
path = os.getenv('PATH')
conda_default_env = os.getenv('CONDA_DEFAULT_ENV')
if not conda_default_env:
    pass
else:
    output = subprocess.check_output('conda info --json', shell=True)
    d = json.loads(output)
    # TODO Check whether the generator comprehension also works.
    path = os.pathsep.join([x for x in path.split(os.pathsep) if d['default_prefix'] not in x])
vim.command("let l:temppath = '" + path + "'")
EOF
return l:temppath
endfunction


" Setting global paths - We use these to switch between conda envs.
if exists("$CONDA_DEFAULT_ENV")
    let g:conda_startup_env = $CONDA_DEFAULT_ENV
else
    let g:conda_startup_env = ""
end


if !exists("g:conda_plain_path")
    " If vim is started from inside a conda path, this variable will
    " contain the path WITHOUT the extra conda env bits.
    let g:conda_plain_path = SetCondaPlainPath()
endif


if !exists("g:conda_startup_path")
    let g:conda_startup_path = $PATH
endif


function! CondaActivate(envname, envpath)
    let $CONDA_DEFAULT_ENV = a:envname
    if has("win32") || has("win64")
        let $PATH = a:envpath . ';' . a:envpath . '\Scripts' .';' . g:conda_plain_path
    elseif has("unix")
        let $PATH = a:envpath . '/bin' .  ':' . g:conda_plain_path
    endif
endfunction


function! CondaDeactivate()
    let $CONDA_DEFAULT_ENV = g:conda_startup_env
{'fraction_non_alphanumeric': 0.11179217746643316, 'fraction_numerical': 0.0011675423234092236, 'mean_word_length': 4.084569732937686, 'pattern_counts': {'":': 0, '<': 9, '<?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': '4174114', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1207, 'n_words': 322}