<commit_before>#!/bin/sh

yum -y install sqlite sqlite-devel # needed by jupyterhub, used when compiling Python3

# Python 2.7 and 3 from source
# https://github.com/h2oai/h2o-2/wiki/Installing-python-2.7-on-centos-6.3.-Follow-this-sequence-exactly-for-centos-machine-only

cd ~/tmp
wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tar.xz
wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tar.xz

tar xvf Python-2.7.11.tar.xz
tar xvf Python-3.5.1.tar.xz

cd Python-2.7.11
./configure --prefix=/usr/local
p="$(nproc --all)"
make -j $p && make altinstall # It is important to use altinstall instead of install, otherwise you will end up with two different versions of Python in the filesystem both named python.
ln -s /usr/local/bin/python2.7 /usr/local/bin/python # this will override system's python if /usr/local/bin appears before /usr/bin on env variable PATH
cd ..
rm -f Python-2.7.11.tar.xz && rm -rf Python-2.7.11

# Install pip for 2.7
cd ~/tmp
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
/usr/local/bin/python2.7 ez_setup.py
/usr/local/bin/easy_install-2.7 pip

cd Python-3.5.1
./configure --prefix=/usr/local
p="$(nproc --all)"
make -j $p && make altinstall
ln -s /usr/local/bin/python3.5 /usr/local/bin/python3
ln -s /usr/local/bin/pip3.5 /usr/local/bin/pip3
cd ..
rm -f Python-3.5.1.tar.xz && rm -rf Python-3.5.1<commit_msg>pip upgrade<commit_after>#!/bin/sh

yum -y install sqlite sqlite-devel # needed by jupyterhub, used when compiling Python3

# Python 2.7 and 3 from source
# https://github.com/h2oai/h2o-2/wiki/Installing-python-2.7-on-centos-6.3.-Follow-this-sequence-exactly-for-centos-machine-only

cd ~/tmp
wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tar.xz
wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tar.xz

tar xvf Python-2.7.11.tar.xz
tar xvf Python-3.5.1.tar.xz

cd Python-2.7.11
./configure --prefix=/usr/local
p="$(nproc --all)"
make -j $p && make altinstall # It is important to use altinstall instead of install, otherwise you will end up with two different versions of Python in the filesystem both named python.
ln -s /usr/local/bin/python2.7 /usr/local/bin/python # this will override system's python if /usr/local/bin appears before /usr/bin on env variable PATH
cd ..
rm -f Python-2.7.11.tar.xz && rm -rf Python-2.7.11

# Install pip for 2.7
cd ~/tmp
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
/usr/local/bin/python2.7 ez_setup.py
/usr/local/bin/easy_install-2.7 pip

cd Python-3.5.1
./configure --prefix=/usr/local
p="$(nproc --all)"
make -j $p && make altinstall
ln -s /usr/local/bin/python3.5 /usr/local/bin/python3
ln -s /usr/local/bin/pip3.5 /usr/local/bin/pip3
cd ..
rm -f Python-3.5.1.tar.xz && rm -rf Python-3.5.1

# https://pip.pypa.io/en/stable/installing/#upgrading-pip
pip install -U pip
pip3 install -U pip
{'fraction_non_alphanumeric': 0.15977575332866154, 'fraction_numerical': 0.04730203223545901, 'mean_word_length': 3.2109144542772863, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 9, 'lorem ipsum': 0, 'www.': 4, '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': '7119369', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1115, 'n_words': 273}