<commit_before>#!/bin/bash

for folder in /merchant/*; do
    if [ -d "${folder}" ];then
        for file in $folder/*; do
            if [ "${file}" != "${file%.py}" ];then
                echo "Setting merchant token $MERCHANT_TOKEN in $file ...";
                sed -i "s/\{\{API_TOKEN\}\}/$MERCHANT_TOKEN/" $file;
            fi
        done
    fi
done

BASE_FOLDER=`dirname $MERCHANT_FILE`
PYTHON_FILE=`basename $MERCHANT_FILE`

cd BASE_FOLDER && python PYTHON_FILE --port $MERCHANT_PORT
<commit_msg>Fix sed for GNU sed<commit_after>#!/bin/bash

for folder in /merchant/*; do
    if [ -d "${folder}" ];then
        for file in $folder/*; do
            if [ "${file}" != "${file%.py}" ];then
                echo "Setting merchant token $MERCHANT_TOKEN in $file ...";
                # GNU sed (installed in container) doesn't require escaping { nor }
                sed -i "s/{{API_TOKEN}}/$MERCHANT_TOKEN/" $file;
            fi
        done
    fi
done

BASE_FOLDER=`dirname $MERCHANT_FILE`
PYTHON_FILE=`basename $MERCHANT_FILE`

cd $BASE_FOLDER && python $PYTHON_FILE --port $MERCHANT_PORT

{'fraction_non_alphanumeric': 0.147005444646098, 'fraction_numerical': 0.0, 'mean_word_length': 2.3123123123123124, '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': '3052253', 'n_tokens_mistral': 373, 'n_tokens_neox': 359, 'n_words': 101}