<commit_before>function __vf_update_python --description "Change the Python interpreter for the current environment"
    set -l python
    if [ (count $argv) -lt 1 ]
        if set -q VIRTUALFISH_DEFAULT_PYTHON
            set python $VIRTUALFISH_DEFAULT_PYTHON
        else if set -q VIRTUALFISH_PYTHON_EXEC
            set python $VIRTUALFISH_PYTHON_EXEC
        else
            set python (command -s python)
        end
    else
        set python (__vfsupport_find_python $argv[1])
    end
    if not test -x "$python"
        echo "You must specify a valid Python interpreter."
        return 1
    end
    if not set -q VIRTUAL_ENV
        echo "You must run this command with a virtual environment activated"
        return 1
    end

    set name (basename $VIRTUAL_ENV)
    set packages (pip freeze)

    echo "Changing the interpreter of the virtualenv $name to $python"

    vf deactivate
    and vf rm $name
    and vf new -p $python $name
    and pip install -U $packages
end

function __vf_fix_python --description "Fix the Python interpreter for the current environment"
    python --version
    or vf update_python $argv[1]
end<commit_msg>update_python: Set local variables explicitly as local<commit_after>function __vf_update_python --description "Change the Python interpreter for the current environment"
    set -l python
    if [ (count $argv) -lt 1 ]
        if set -q VIRTUALFISH_DEFAULT_PYTHON
            set python $VIRTUALFISH_DEFAULT_PYTHON
        else if set -q VIRTUALFISH_PYTHON_EXEC
            set python $VIRTUALFISH_PYTHON_EXEC
        else
            set python (command -s python)
        end
    else
        set python (__vfsupport_find_python $argv[1])
    end
    if not test -x "$python"
        echo "You must specify a valid Python interpreter."
        return 1
    end
    if not set -q VIRTUAL_ENV
        echo "You must run this command with a virtual environment activated."
        return 1
    end

    set -l envname (basename $VIRTUAL_ENV)
    set -l packages (pip freeze)

    echo "Changing the interpreter of the '$envname' environment to $python"

    vf deactivate
    and vf rm $envname
    and vf new -p $python $envname
    and pip install -U $packages
end

function __vf_fix_python --description "Fix the Python interpreter for the current environment"
    python --version
    or vf update_python $argv[1]
end
{'fraction_non_alphanumeric': 0.05300799326882625, 'fraction_numerical': 0.004206983592763988, 'mean_word_length': 2.5073746312684366, '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': '2244915', 'n_tokens_mistral': 718, 'n_tokens_neox': 683, 'n_words': 279}