<commit_before>#!/bin/bash

# author: <NAME>
# date: Feb.2011
# modified by <NAME>, Aug 2013

function usage {
echo -e "usage: $(basename $0) [OPTIONS] -m MOD.SCRIPT -l QOUT -t TASK -k CONFIG"
exit
}

if [ ! $# -gt 2 ]; then usage ; fi

HTMLOUTPUT=""
RESULTSUFFIX=""

while [ "$1" != "" ]; do
    case $1 in
        -m | --modscript )      shift; SCRIPT=$1 ;; # location of mod script (comma-sep if postcommand)
        -l | --log )            shift; QOUT=$1 ;;   # location of log output
        -t | --task )           shift; TASK=$1 ;;   # task at hand
        -r | --results-dir )    shift; OUTDIR=$1 ;; # location of the output 
        -s | --results-task )   shift; OUTTASK=$1 ;; # task the results are put in 
        -f | --filesuffix )     shift; RESULTSUFFIX=$1 ;; # suffix of the result file
        -o | --html-file )      shift; HTMLOUTPUT=$1;; # where the output will be place in the end
        -k | --toolkit )        shift; CONFIG=$1 ;; # location of the NGSANE repository
        -h | --help )           usage ;;
        * )                     echo "don't understand "$1
    esac
    shift
done

#PROGRAMS
. $CONFIG
. ${NGSANE_BASE}/conf/header.sh
. $CONFIG

# default output location corresponds to the task at hand
if [ -z "$OUTTASK" ]; then
    OUTTASK=$TASK
fi

################################################################################

if [ -n "$DMGET" ]; then
    dmget $QOUT/$TASK/*.out
fi

LOGFOLDER=$(dirname $QOUT)

if [ -n "$HTMLOUTPUT" ]; then
    echo "<div class='tabContent_hide' id='DC_${TASK}_checklist'><div><pre>"
fi


# pack normal and post command in a long string for the subsequent loops
# file1*file2*file3:task.sh postcommand:posttask.sh
for dir in ${DIR[@]}; do
    for LOGFILE in $(find $QOUT/$TASK/ -maxdepth 1 -type f -name "${dir%%/*}*.out" 2>/dev/null ); do
        LOGFILES="${LOGFILES} ${LOGFILE}"
    done
done
# remove potential duplicates
LOGFILES=$(echo "${LOGFILES}" | tr ' ' '\n' | sort -u | tr '\n' ' ')
echo $LOGFILES<commit_msg>Bugfix reporting<commit_after>#!/bin/bash

# author: <NAME>
# date: Feb.2011
# modified by <NAME>, Aug 2013

function usage {
echo -e "usage: $(basename $0) [OPTIONS] -m MOD.SCRIPT -l QOUT -t TASK -k CONFIG"
exit
}

if [ ! $# -gt 2 ]; then usage ; fi

HTMLOUTPUT=""
RESULTSUFFIX=""

while [ "$1" != "" ]; do
    case $1 in
        -m | --modscript )      shift; SCRIPT=$1 ;; # location of mod script (comma-sep if postcommand)
        -l | --log )            shift; QOUT=$1 ;;   # location of log output
        -t | --task )           shift; TASK=$1 ;;   # task at hand
        -r | --results-dir )    shift; OUTDIR=$1 ;; # location of the output 
        -s | --results-task )   shift; OUTTASK=$1 ;; # task the results are put in 
        -f | --filesuffix )     shift; RESULTSUFFIX=$1 ;; # suffix of the result file
        -o | --html-file )      shift; HTMLOUTPUT=$1;; # where the output will be place in the end
        -k | --toolkit )        shift; CONFIG=$1 ;; # location of the NGSANE repository
        -h | --help )           usage ;;
        * )                     echo "don't understand "$1
    esac
    shift
done

#PROGRAMS
. $CONFIG
. ${NGSANE_BASE}/conf/header.sh
. $CONFIG

# default output location corresponds to the task at hand
if [ -z "$OUTTASK" ]; then
    OUTTASK=$TASK
fi

################################################################################

if [ -n "$DMGET" ]; then
    dmget $QOUT/$TASK/*.out
fi

LOGFOLDER=$(dirname $QOUT)

if [ -n "$HTMLOUTPUT" ]; then
    echo "<div class='tabContent_hide' id='DC_${TASK}_checklist'><div><pre>"
fi


# pack normal and post command in a long string for the subsequent loops
# file1*file2*file3:task.sh postcommand:posttask.sh
for dir in ${DIR[@]}; do
    for LOGFILE in $(find $QOUT/$TASK/ -maxdepth 1 -type f -name "${dir%%/*}*.out" 2>/dev/null ); do
        LOGFILES="${LOGFILES} ${LOGFILE}"
    done
done
# remove potential duplicates
LOGFILES=$(echo "${LOGFILES}" | tr ' ' '\n' | sort -u | tr '\n' ' ')
#echo $LOGFILES
{'fraction_non_alphanumeric': 0.1928464232116058, 'fraction_numerical': 0.013006503251625813, 'mean_word_length': 2.5202464788732395, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, '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': '6285978', 'n_tokens_mistral': 1395, 'n_tokens_neox': 1317, 'n_words': 426}