<commit_before>
# Fancy colors
BLACK=$(tput setaf 0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
NORMAL=$(tput sgr0)


exit


# Create venv
echo "${GREEN}Creating virtual environment:${NORMAL} venv"
virtualenv venv

echo "${YELLOW}Activating virtual environment:${NORMAL} venv"
# Activate venv
. venv/bin/activate

# Add path file
PTH=venv/lib/python2.7/site-packages/authomatic.pth
echo "${GREEN}Adding pth file:${NORMAL} $PTH"
pwd -LP > $PTH

echo "${GREEN}Installing requirements.${NORMAL}"
# Install requirements
pip install --requirement requirements.txt


##########################
# Selenium Chrome Driver #
##########################

echo "${YELLOW}Downloading Chrome Driver.${NORMAL}"

# Download and extract Chromedriver according to OS architecture
if [ `getconf LONG_BIT` = "64" ]
then
	wget https://chromedriver.googlecode.com/files/chromedriver_linux64_2.2.zip
	unzip chromedriver_linux64_2.2.zip
	rm chromedriver_linux64_2.2.zip
else
    wget https://chromedriver.googlecode.com/files/chromedriver_linux32_2.2.zip
	unzip chromedriver_linux32_2.2.zip
	rm chromedriver_linux32_2.2.zip
fi

echo "${GREEN}Moving Chrome Driver executable to:${NORMAL} venv/bin/chromedriver"
mv chromedriver venv/bin
echo "${YELLOW}Changing permissions of Chrome Driver executable to:${NORMAL} 777"
chmod 777 venv/bin/chromedriver


#########################
# Google App Engine SDK #
#########################

echo "${YELLOW}Downloading Google App Engine SDK.${NORMAL}"

wget http://googleappengine.googlecode.com/files/google_appengine_1.8.3.zip
unzip google_appengine_1.8.3.zip
rm google_appengine_1.8.3.zip

echo "${GREEN}Installing Google App Engine SDK to:${NORMAL} venv/bin/google_appengine"
mv google_appengine venv/bin

PTH=venv/lib/python2.7/site-packages/gae.pth
echo "${GREEN}Adding pth file:${NORMAL} $PTH"
echo "$(pwd -LP)/venv/bin/google_appengine/" >> $PTH
echo "import dev_appserver; dev_appserver.fix_sys_path()" >> $PTH

# GAE SDK requires simlinks to all dependencies next to the app.yaml file.<commit_msg>Added shebang line.<commit_after>#!/bin/sh

# Fancy colors
BLACK=$(tput setaf 0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
NORMAL=$(tput sgr0)

QUIET='-q'

# If venv folder already exists ask whether to overwrite it.
if [ -d 'venv' ]; then
    echo "${CYAN}Virtual environment ${NORMAL}venv${CYAN} already exists!${NORMAL}"
    while true; do
        read -p "${CYAN}Do you want to replace it? [y/n]${NORMAL}" yn
        case $yn in
            [Yy]* ) break;;
            [Nn]* ) exit;;
            * ) echo "${YELLOW}Please enter y/Y or n/N.${NORMAL}";;
        esac
    done
    echo "${RED}Removing virtual environment:${NORMAL} venv"
    rm -R venv
fi

# Create venv
echo "${GREEN}Creating virtual environment:${NORMAL} venv"
virtualenv $QUIET venv

echo "${YELLOW}Activating virtual environment:${NORMAL} venv"
# Activate venv
. venv/bin/activate

# Add path file
PTH=venv/lib/python2.7/site-packages/authomatic.pth
echo "${GREEN}Adding pth file:${NORMAL} $PTH"
pwd -LP > $PTH

echo "${GREEN}Installing requirements.${NORMAL}"
# Install requirements
pip install $QUIET --requirement requirements.txt


##########################
# Selenium Chrome Driver #
##########################

echo "${YELLOW}Downloading Chrome Driver.${NORMAL}"

# Download and extract Chromedriver according to OS architecture
if [ `getconf LONG_BIT` = "64" ]
then
	wget $QUIET https://chromedriver.googlecode.com/files/chromedriver_linux64_2.2.zip
	unzip $QUIET chromedriver_linux64_2.2.zip
	rm chromedriver_linux64_2.2.zip
else
    wget $QUIET https://chromedriver.googlecode.com/files/chromedriver_linux32_2.2.zip
	unzip $QUIET chromedriver_linux32_2.2.zip
	rm chromedriver_linux32_2.2.zip
fi

echo "${GREEN}Moving Chrome Driver executable to:${NORMAL} venv/bin/chromedriver"
mv chromedriver venv/bin
echo "${YELLOW}Changing permissions of Chrome Driver executable to:${NORMAL} 777"
chmod 777 venv/bin/chromedriver


#########################
# Google App Engine SDK #
#########################

echo "${YELLOW}Downloading Google App Engine SDK.${NORMAL}"

wget $QUIET http://googleappengine.googlecode.com/files/google_appengine_1.8.3.zip
unzip $QUIET google_appengine_1.8.3.zip
rm google_appengine_1.8.3.zip

echo "${GREEN}Installing Google App Engine SDK to:${NORMAL} venv/bin/google_appengine"
mv google_appengine venv/bin

PTH=venv/lib/python2.7/site-packages/gae.pth
echo "${GREEN}Adding pth file:${NORMAL} $PTH"
echo "$(pwd -LP)/venv/bin/google_appengine/" >> $PTH
echo "import dev_appserver; dev_appserver.fix_sys_path()" >> $PTH

# GAE SDK requires simlinks to all dependencies next to the app.yaml file.
{'fraction_non_alphanumeric': 0.16353775552774302, 'fraction_numerical': 0.022110972048393827, 'mean_word_length': 5.203104786545925, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6459081', 'n_tokens_mistral': 1766, 'n_tokens_neox': 1685, 'n_words': 416}