<commit_before>#!/usr/bin/env bash

# This script should be run from inside the anonymous-messaging package directory

logDir="$(PWD)/logs"
pkiDir="$(PWD)/pki/database.db"

if [ -d $pkiDir ]
then
    echo "Removing the following directory" $pkiDir
    rm -f $pkiDir
    echo "Removed existing PKI files"
else
    echo "Nothing to remove. The PKI directory does not exists"
fi


if [ -d $logDir ]
then
    echo "Removing existing logs in the following directory" $logDir
    rm -rf $logDir
    echo "Creating a new log folder in directory" $logDir
    mkdir $logDir
else
    echo "Nothing to remove. The logs directory does not exist."
fi

function kill_port() {
    PID=$(lsof -t -i:$1)
#    echo "$PID"
    echo  kill -TERM ${PID} || kill -KILL ${PID}
}

for var in "$@"
do
#    echo ${var}
    kill_port ${var}
done<commit_msg>Updated the cleaning file for killing listening ports<commit_after>#!/usr/bin/env bash

# This script should be run from inside the anonymous-messaging package directory

logDir="$(PWD)/logs"
pkiDir="$(PWD)/pki/database.db"

if [ -d $pkiDir ]
then
    echo "Removing the following directory" $pkiDir
    rm -f $pkiDir
    echo "Removed existing PKI files"
else
    echo "Nothing to remove. The PKI directory does not exists"
fi


if [ -d $logDir ]
then
    echo "Removing existing logs in the following directory" $logDir
    rm -rf $logDir
    echo "Creating a new log folder in directory" $logDir
    mkdir $logDir
else
    echo "Nothing to remove. The logs directory does not exist."
fi

function kill_port() {
    PID=$(lsof -t -i:$1)
    echo "Killing process: $PID"
#    kill -TERM ${PID}
    kill -KILL ${PID}
#    kill -TSTP ${PID}
#    kill -CONT ${PID}
}

for var in "$@"
do
    kill_port ${var}
done
{'fraction_non_alphanumeric': 0.1109833237492812, 'fraction_numerical': 0.0011500862564692352, 'mean_word_length': 3.172661870503597, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6896911', 'n_tokens_mistral': 609, 'n_tokens_neox': 578, 'n_words': 225}