<commit_before>#/usr/bin/env bash

echo "Installing yang-explorer .."
echo "Checking environment .."
command -v pyang >/dev/null 2>&1 || {
	echo "pyang not found.. please install pyang before continuing !!" >&2;
	exit 1;
}

command -v pip >/dev/null 2>&1 || {
	echo "pip not found.. please install python pip before continuing !!" >&2;
	exit 1;
}

command -v virtualenv >/dev/null 2>&1 || {
	echo "virtualenv not found.. please install virtualenv before continuing !!" >&2;
	exit 1;
}

echo "Creating / Activating virtualenv .."
if [ -f "v/bin/activate" ]; then
	source v/bin/activate
else
	virtualenv v
	source v/bin/activate
fi

echo "Installing dependencies .."
pip install -r requirements.txt
rc=$?
if [[ $rc != 0 ]]; then
	echo "Installation failed !! aborted !!"
	exit $rc
fi
<commit_msg>#5 Suggested changes to setup.sh to make virtualenv optional.<commit_after>#/usr/bin/env bash

echo "Installing yang-explorer .."
echo "Checking environment .."
command -v pyang >/dev/null 2>&1 || {
	echo "pyang not found.. please install pyang before continuing !!" >&2;
	exit 1;
}

command -v pip >/dev/null 2>&1 || {
	echo "pip not found.. please install python pip before continuing !!" >&2;
	exit 1;
}

command -v virtualenv >/dev/null 2>&1 || {
    NOVENV=1
	echo "virtualenv not found.. do you want to continue? (y/Y)" >&2;
    read response

    if printf "%s\n" "$response" | grep -Eq "$(locale yesexpr)"
    then
        break;
    else
        exit 1;
    fi
}

if [[ $NOVENV != 1 ]]; then
    echo "Creating / Activating virtualenv .."
    if [ -f "v/bin/activate" ]; then
        source v/bin/activate
    else
        virtualenv v
        source v/bin/activate
    fi
fi

echo "Installing dependencies .."
pip install -r requirements.txt
rc=$?
if [[ $rc != 0 ]]; then
	echo "Installation failed !! aborted !!"
	exit $rc
fi

{'fraction_non_alphanumeric': 0.1436373566357182, 'fraction_numerical': 0.015838339705079193, 'mean_word_length': 2.991285403050109, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '1803407', 'n_tokens_mistral': 649, 'n_tokens_neox': 620, 'n_words': 219}