<commit_before>#!/bin/bash
#
# virtualenv-burrito
#
#   One command to have a working virtualenv + virtualenvwrapper environment.
#
set -e

VENVBURRITO="$HOME/.venvburrito"
VENVBURRITO_esc="\$HOME/.venvburrito"
MASTER_URL="https://raw.github.com/brainsik/virtualenv-burrito/master"

if [ -e "$VENVBURRITO" ]; then
    echo "Found existing $VENVBURRITO"
    echo
    echo "Looks like virtualenv-burrito is already installed. Bye."
    exit 1
fi

kernel=$(uname -s)
case "$kernel" in
    Darwin|Linux) ;;
    *) echo "Sadly, $kernel hasn't been tested. :'("; exit 1
esac

# provide a friendly way to set this environment variable
test "$1" = "--exclude-profile" && exclude_profile="yep"


backup_profile() {
    profile="$1"
    cp -p $HOME/$profile $HOME/${profile}.pre-virtualenv-burrito
}

modify_profile() {
    # startup virtualenv-burrito in the (bash_)profile
    echo
    start_code="\n# startup virtualenv-burrito\n. $VENVBURRITO_esc/startup.sh"
    check_code="$VENVBURRITO_esc/startup.sh"
    if [ -s ~/.bash_profile ]; then
        if ! grep -q "$check_code" ~/.bash_profile; then
            profile=".bash_profile"
            backup_profile $profile
            cat >> ~/$profile <<EOF

# startup virtualenv-burrito
if [ -f $VENVBURRITO_esc/startup.sh ]; then
    . $VENVBURRITO_esc/startup.sh
fi
EOF
        fi
    else
        if [ -s ~/.profile ]; then
            if ! grep -q "$check_code" ~/.profile; then
                profile=".profile"
                backup_profile $profile
                # match the .profile style and wrap paths in double quotes
                cat >> ~/$profile <<EOF

# if running bash
if [ -n "\$BASH_VERSION" ]; then
    # startup virtualenv-burrito
    if [ -f "$VENVBURRITO_esc/startup.sh" ]; then
        . "$VENVBURRITO_esc/startup.sh"
    fi
fi
EOF
            fi
        else
            profile=".bash_profile"
            cat > ~/$profile <<EOF
# include .bashrc if it exists
if [ -f \$HOME/.bashrc ]; then
    . \$HOME/.bashrc
fi

# startup virtualenv-burrito
if [ -f $VENVBURRITO_esc/startup.sh ]; then
    . $VENVBURRITO_esc/startup.sh
fi
EOF
        fi
    fi

    if [ -n "$profile" ] && [ -s $HOME/${profile}.pre-virtualenv-burrito ]; then
        backup=" The original\nwas saved to ~/$profile.pre-virtualenv-burrito."
    fi
    echo
    echo "Code was added to $HOME/$profile so the virtualenvwrapper"
    echo -e "environment will be available when you login.$backup"
}


mkdir -p $VENVBURRITO/{bin,lib/python}
test -d $HOME/.virtualenvs || mkdir $HOME/.virtualenvs

echo "Downloading virtualenv-burrito command"
curl $MASTER_URL/virtualenv-burrito.py > $VENVBURRITO/bin/virtualenv-burrito
chmod 755 $VENVBURRITO/bin/virtualenv-burrito
cmd="virtualenv-burrito upgrade firstrun"
echo -e "\nRunning: $cmd"
$VENVBURRITO/bin/$(echo cmd)

test -z "$exclude_profile" && modify_profile

echo
echo "Done with setup!"
echo
echo "To start now, run this:"
echo "source $VENVBURRITO/startup.sh"<commit_msg>fix typo<commit_after>#!/bin/bash
#
# virtualenv-burrito
#
#   One command to have a working virtualenv + virtualenvwrapper environment.
#
set -e

VENVBURRITO="$HOME/.venvburrito"
VENVBURRITO_esc="\$HOME/.venvburrito"
MASTER_URL="https://raw.github.com/brainsik/virtualenv-burrito/master"

if [ -e "$VENVBURRITO" ]; then
    echo "Found existing $VENVBURRITO"
    echo
    echo "Looks like virtualenv-burrito is already installed. Bye."
    exit 1
fi

kernel=$(uname -s)
case "$kernel" in
    Darwin|Linux) ;;
    *) echo "Sadly, $kernel hasn't been tested. :'("; exit 1
esac

# provide a friendly way to set this environment variable
test "$1" = "--exclude-profile" && exclude_profile="yep"


backup_profile() {
    profile="$1"
    cp -p $HOME/$profile $HOME/${profile}.pre-virtualenv-burrito
}

modify_profile() {
    # startup virtualenv-burrito in the (bash_)profile
    echo
    start_code="\n# startup virtualenv-burrito\n. $VENVBURRITO_esc/startup.sh"
    check_code="$VENVBURRITO_esc/startup.sh"
    if [ -s ~/.bash_profile ]; then
        if ! grep -q "$check_code" ~/.bash_profile; then
            profile=".bash_profile"
            backup_profile $profile
            cat >> ~/$profile <<EOF

# startup virtualenv-burrito
if [ -f $VENVBURRITO_esc/startup.sh ]; then
    . $VENVBURRITO_esc/startup.sh
fi
EOF
        fi
    else
        if [ -s ~/.profile ]; then
            if ! grep -q "$check_code" ~/.profile; then
                profile=".profile"
                backup_profile $profile
                # match the .profile style and wrap paths in double quotes
                cat >> ~/$profile <<EOF

# if running bash
if [ -n "\$BASH_VERSION" ]; then
    # startup virtualenv-burrito
    if [ -f "$VENVBURRITO_esc/startup.sh" ]; then
        . "$VENVBURRITO_esc/startup.sh"
    fi
fi
EOF
            fi
        else
            profile=".bash_profile"
            cat > ~/$profile <<EOF
# include .bashrc if it exists
if [ -f \$HOME/.bashrc ]; then
    . \$HOME/.bashrc
fi

# startup virtualenv-burrito
if [ -f $VENVBURRITO_esc/startup.sh ]; then
    . $VENVBURRITO_esc/startup.sh
fi
EOF
        fi
    fi

    if [ -n "$profile" ] && [ -s $HOME/${profile}.pre-virtualenv-burrito ]; then
        backup=" The original\nwas saved to ~/$profile.pre-virtualenv-burrito."
    fi
    echo
    echo "Code was added to $HOME/$profile so the virtualenvwrapper"
    echo -e "environment will be available when you login.$backup"
}


mkdir -p $VENVBURRITO/{bin,lib/python}
test -d $HOME/.virtualenvs || mkdir $HOME/.virtualenvs

echo "Downloading virtualenv-burrito command"
curl $MASTER_URL/virtualenv-burrito.py > $VENVBURRITO/bin/virtualenv-burrito
chmod 755 $VENVBURRITO/bin/virtualenv-burrito
cmd="virtualenv-burrito upgrade firstrun"
echo -e "\nRunning: $cmd"
$VENVBURRITO/bin/$(echo $cmd)

test -z "$exclude_profile" && modify_profile

echo
echo "Done with setup!"
echo
echo "To start now, run this:"
echo "source $VENVBURRITO/startup.sh"
{'fraction_non_alphanumeric': 0.12922297297297297, 'fraction_numerical': 0.002364864864864865, 'mean_word_length': 2.8249354005167957, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1420906', 'n_tokens_mistral': 2130, 'n_tokens_neox': 2019, 'n_words': 516}