<commit_before>USER=$1
USER_HOME=/home/${USER}/
WORKON_HOME=${USER_HOME}/.virtualenvs
if [[ ! -e /home/${USER}/ ]]; then
    USER_HOME=/var/lib/jenkins/
fi
# FIXME: should take project_name as an argument passed from settings.py somehow
project_name=tabular_predDB
wrapper_script=/usr/local/bin/virtualenvwrapper.sh

# ensure virtualenvwrapper is loaded
if [[ -z $(grep WORKON_HOME ${USER_HOME}/.bashrc) ]]; then
    cat -- >> ${USER_HOME}/.bashrc <<EOF
export PYTHONPATH=${PYTHONPATH}:${USER_HOME}
export WORKON_HOME=$WORKON_HOME
source $wrapper_script
EOF
fi

source ${USER_HOME}/.bashrc

# ensure requirements in virtualenv $project_name
has_project=$(workon | grep $project_name)
if [[ -z $has_project ]] ; then
    # BEWARE: readlink doesn't work on macs
    my_abs_path=$(readlink -f "$0")
    project_location=$(dirname $my_abs_path)<commit_msg>Fixed bug in virtualenv_setup change.<commit_after>USER=$1
USER_HOME=/home/${USER}/
if [[ ! -e /home/${USER}/ ]]; then
    echo "in here"
    USER_HOME=/var/lib/jenkins/
fi
WORKON_HOME=${USER_HOME}/.virtualenvs
# FIXME: should take project_name as an argument passed from settings.py somehow
project_name=tabular_predDB
wrapper_script=/usr/local/bin/virtualenvwrapper.sh

# ensure virtualenvwrapper is loaded
if [[ -z $(grep WORKON_HOME ${USER_HOME}/.bashrc) ]]; then
    cat -- >> ${USER_HOME}/.bashrc <<EOF
export PYTHONPATH=${PYTHONPATH}:${USER_HOME}
export WORKON_HOME=$WORKON_HOME
source $wrapper_script
EOF
fi

source ${USER_HOME}/.bashrc

# ensure requirements in virtualenv $project_name
has_project=$(workon | grep $project_name)
if [[ -z $has_project ]] ; then
    # BEWARE: readlink doesn't work on macs
    my_abs_path=$(readlink -f "$0")
    project_location=$(dirname $my_abs_path)
{'fraction_non_alphanumeric': 0.13795077275329135, 'fraction_numerical': 0.0022896393817973667, 'mean_word_length': 5.176678445229682, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6137179', 'n_tokens_mistral': 609, 'n_tokens_neox': 593, 'n_words': 142}