<commit_before>#!/bin/bash

unknown_type=0
debian_type=1
redhat_type=2
system_type=$unknown_type
steps=1


# Determine type of system - yum based or apt-get based
if type apt-get > /dev/null; then
    echo "$steps. Debian type system detected"
    sudo apt-get update
    sudo apt-get upgrade
    system_type=$debian_type
elif type yum > /dev/null; then
    echo "$steps. Redhat type system detected"
    sudo yum update
    system_type=$redhat_type
else
    echo "$steps. Unknown system - no apt-get, yum found"
    exit -1
fi
let "steps++"

# Install specific software
echo "$steps. Installing g++"
if [ $system_type -eq $redhat_type ]; then
    sudo yum -y install http://epel.mirror.net.in/epel/6/x86_64/epel-release-6-8.noarch.rpm
    sudo yum -y install python-devel libevent-devel
elif [ $system_type -eq $debian_type ]; then
    sudo apt-get -y install python-dev libevent-dev libzmq-dev
fi
let "steps++"

pip="pip"
type python-pip > /dev/null 2>&1
if [ $? -eq 0 ]; then
    pip="python-pip"
fi
sudo $pip install locustio

sudo updatedb
locate libzmq.so
if [ $? -ne 0 ]; then
    cd /tmp/
    rm zeromq-3.2.3* -rf
    wget http://download.zeromq.org/zeromq-3.2.3.tar.gz
    tar xvzf zeromq-3.2.3.tar.gz
    cd zeromq-3.2.3
    ./configure && make
    if [ $? -eq 0 ]; then
        sudo make install
    else
        exit -1
    fi
fi
sudo $pip install gevent-zeromq

cd /tmp/
rm -rf pyzmq*
wget https://github.com/downloads/zeromq/pyzmq/pyzmq-2.2.0.tar.gz
tar xvzf pyzmq-2.2.0.tar.gz
cd pyzmq-2.2.0
sudo python setup.py install

sudo $pip install zmqrpc
<commit_msg>Workaround for locust bug https://github.com/locustio/locust/issues/52<commit_after>#!/bin/bash

unknown_type=0
debian_type=1
redhat_type=2
system_type=$unknown_type
steps=1


# Determine type of system - yum based or apt-get based
if type apt-get > /dev/null; then
    echo "$steps. Debian type system detected"
    sudo apt-get update
    sudo apt-get upgrade
    system_type=$debian_type
elif type yum > /dev/null; then
    echo "$steps. Redhat type system detected"
    sudo yum update
    system_type=$redhat_type
else
    echo "$steps. Unknown system - no apt-get, yum found"
    exit -1
fi
let "steps++"

# Install specific software
echo "$steps. Installing g++"
if [ $system_type -eq $redhat_type ]; then
    sudo yum -y install http://epel.mirror.net.in/epel/6/x86_64/epel-release-6-8.noarch.rpm
    sudo yum -y install python-devel libevent-devel
elif [ $system_type -eq $debian_type ]; then
    sudo apt-get -y install python-dev libevent-dev libzmq-dev
fi
let "steps++"


pip="pip"
type python-pip > /dev/null 2>&1
if [ $? -eq 0 ]; then
    pip="python-pip"
fi
# Bug https://github.com/locustio/locust/issues/52
# Need to install latest gevent 1.0rc2
sudo $pip install cython # dependency for gevent1.0 rc
cd /tmp/
rm 1.0* gevent* -rf
wget https://github.com/surfly/gevent/archive/1.0rc2.tar.gz
tar xvzf 1.0rc2.tar.gz
cd gevent-1.0rc2
sudo python setup.py install
cd


sudo $pip install locustio

sudo updatedb
locate libzmq.so
if [ $? -ne 0 ]; then
    cd /tmp/
    rm zeromq-3.2.3* -rf
    wget http://download.zeromq.org/zeromq-3.2.3.tar.gz
    tar xvzf zeromq-3.2.3.tar.gz
    cd zeromq-3.2.3
    ./configure && make
    if [ $? -eq 0 ]; then
        sudo make install
    else
        exit -1
    fi
fi
sudo $pip install gevent-zeromq

cd /tmp/
rm -rf pyzmq*
wget https://github.com/downloads/zeromq/pyzmq/pyzmq-2.2.0.tar.gz
tar xvzf pyzmq-2.2.0.tar.gz
cd pyzmq-2.2.0
sudo python setup.py install

sudo $pip install zmqrpc

{'fraction_non_alphanumeric': 0.12151394422310757, 'fraction_numerical': 0.027888446215139442, 'mean_word_length': 2.909899888765295, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '604663', 'n_tokens_mistral': 1447, 'n_tokens_neox': 1362, 'n_words': 384}