<commit_before>#!/bin/bash

function check_if_empty
{
	if [ "$2" = "" ]; then
		echo "\$$1 was empty"
		exit 1
	fi
}

function run
{
	echo "$0 $*"
	eval $*
	ec=$?
	if [ $ec != 0 ]; then
	  	printf "Error : [%d] when executing command: '$*'" $ec
  		exit $ec
	fi
}

function clean
{
	# 1 = Temp directory
	if [ -e "$1" ]; then
		run rm -rf $1
	fi
	run mkdir $1
}

function download
{
	# 1 = Tmp directory
	# 2 = Git repo url
	# 3 = target dir
	run cd $1
	run git clone $2 $3
}

function init
{
	# 1 = Repo clone directory
	if [ ! -e "$1" ]; then
		echo "$1 does not exists"
		exit 1<commit_msg>added -qv to git clone<commit_after>#!/bin/bash

function check_if_empty
{
	if [ "$2" = "" ]; then
		echo "\$$1 was empty"
		exit 1
	fi
}

function run
{
	echo "$0 $*"
	eval $*
	ec=$?
	if [ $ec != 0 ]; then
	  	printf "Error : [%d] when executing command: '$*'" $ec
  		exit $ec
	fi
}

function clean
{
	# 1 = Temp directory
	if [ -e "$1" ]; then
		run rm -rf $1
	fi
	run mkdir $1
}

function download
{
	# 1 = Tmp directory
	# 2 = Git repo url
	# 3 = target dir
	run cd $1
	run git clone $2 $3 -qv
}

function init
{
	# 1 = Repo clone directory
	if [ ! -e "$1" ]; then
		echo "$1 does not exists"
		exit 1
{'fraction_non_alphanumeric': 0.15679733110925773, 'fraction_numerical': 0.0316930775646372, 'mean_word_length': 2.488372093023256, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3542996', 'n_tokens_mistral': 538, 'n_tokens_neox': 503, 'n_words': 178}