<commit_before>#!/bin/bash
if [ $# -ne 4 ]; then
	echo "Usage: $0 [host] [port] [user] [pass]"
	exit 1
fi

UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head -n 1)

## USER CONFIG
# Time limit, in seconds
TIMELIMIT=5

# File to upload
TESTFILE_LOCAL="/tmp/scoreengine-check-file"
TESTFILE_REMOTE="scoreengine-$UUID.check"
## END USER CONFIG

if [ ! -f $TESTFILE_LOCAL ]; then
	touch $TESTFILE_LOCAL
fi

HOST=$1
PORT=$2
USER=$3
PASS=$4

COMMAND="lftp -u $USER,$PASS -e 'set net:timeout $TIMELIMIT; set net:max-retries 1; put $TESTFILE_LOCAL -o $TESTFILE_REMOTE; ls; rm $TESTFILE_REMOTE; quit' $HOST:$PORT"

EXPECTED_OUTPUT="File $TESTFILE_REMOTE sucessfully uploaded AND removed" 
OUTPUT=$(eval $COMMAND 2> /dev/null)
ACTUAL=$(echo $OUTPUT | grep -c "$TESTFILE_REMOTE")

echo "ScoreEngine Module: ftp_check"
echo
echo "RUNNING: $COMMAND"
echo
echo "EXPECTED: $EXPECTED_OUTPUT"
echo
echo "OUTPUT:"
echo "$OUTPUT"

if [ "$ACTUAL" == 1 ]; then
	exit 0;
else
	exit 1;
fi
<commit_msg>Replaced ftp_check's uuid generation with openssl<commit_after>#!/bin/bash
if [ $# -ne 4 ]; then
	echo "Usage: $0 [host] [port] [user] [pass]"
	exit 1
fi

UUID=$(openssl rand -hex 10)

## USER CONFIG
# Time limit, in seconds
TIMELIMIT=5

# File to upload
TESTFILE_LOCAL="/tmp/scoreengine-check-file"
TESTFILE_REMOTE="scoreengine-$UUID.check"
## END USER CONFIG

if [ ! -f $TESTFILE_LOCAL ]; then
	touch $TESTFILE_LOCAL
fi

HOST=$1
PORT=$2
USER=$3
PASS=$4

COMMAND="lftp -u $USER,$PASS -e 'set net:timeout $TIMELIMIT; set net:max-retries 1; put $TESTFILE_LOCAL -o $TESTFILE_REMOTE; ls; rm $TESTFILE_REMOTE; quit' $HOST:$PORT"

EXPECTED_OUTPUT="File $TESTFILE_REMOTE sucessfully uploaded AND removed" 
OUTPUT=$(eval $COMMAND 2> /dev/null)
ACTUAL=$(echo $OUTPUT | grep -c "$TESTFILE_REMOTE")

echo "ScoreEngine Module: ftp_check"
echo
echo "RUNNING: $COMMAND"
echo
echo "EXPECTED: $EXPECTED_OUTPUT"
echo
echo "OUTPUT:"
echo "$OUTPUT"

if [ "$ACTUAL" == 1 ]; then
	exit 0;
else
	exit 1;
fi

{'fraction_non_alphanumeric': 0.14914054600606674, 'fraction_numerical': 0.016683518705763397, 'mean_word_length': 5.015197568389058, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7279670', 'n_tokens_mistral': 802, 'n_tokens_neox': 769, 'n_words': 224}