<commit_before>#!/bin/bash

set -e

virtualenv -p python3 .
. bin/activate
pip install -r requirements.txt
sed -i 's/\.iteritems/.items/g' lib/*/site-packages/flaskext/genshi.py
rm -f $0
<commit_msg>Added a few checks before initializing the env<commit_after>#!/bin/bash
#
# Copyright (c) 2015, <NAME> <<EMAIL>>
#
# Initializes the project virtualenv by installing requirements.

set -e

[[ -e requirements.txt ]] || {
    echo 'not in the project directory? missing requirements.txt'
    exit 1
}

[[ -z "$VIRTUAL_ENV" ]] || {
    echo 'already in a virtualenv'
    exit 1
}

[[ -d bin ]] && [[ -d lib ]] && [[ -d include ]] && {
    echo 'virtualenv already initialized'
    exit 1
}

virtualenv -p python3 .
. bin/activate
pip install -r requirements.txt
# Fix for Python 3
sed -i 's/\.iteritems/.items/g' lib/*/site-packages/flaskext/genshi.py

{'fraction_non_alphanumeric': 0.15330188679245282, 'fraction_numerical': 0.012971698113207548, 'mean_word_length': 3.161764705882353, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '1702221', 'n_tokens_mistral': 317, 'n_tokens_neox': 299, 'n_words': 89}