<commit_before>#!/bin/bash

export __dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export __dir="$( dirname ${__dir} )"

if [ -d ${__dir}/__envi ]
then
    . ${__dir}/__envi/bin/activate
    export PYTHONPATH=${__dir}/src

    if [ -z "${_APP_PROFILE}" ];
    then
        ${__dir}/__envi/bin/python -u ${PYTHONPATH}/amberdriver/collision_avoidance/collision_avoidance.py
    else
        export _APP_TEMP=$(mktemp -d)

        ${__dir}/__envi/bin/python -u -m cProfile -o ${_APP_TEMP}/output.pstats ${PYTHONPATH}/amberdriver/collision_avoidance/collision_avoidance_controller.py

        ${__dir}/__envi/bin/gprof2dot -f pstats --output ${_APP_TEMP}/output.dot ${_APP_TEMP}/output.pstats
        # TODO(paoolo) check if `dot` exists?
        /usr/bin/dot -Tpng ${_APP_TEMP}/output.dot -o ${__dir}/profile-collision_avoidance-$(date +"%Y%m%d-%H%M%S").png

        rm -rf ${_APP_TEMP}
    fi
fi<commit_msg>Fix executable script for collision avoidance<commit_after>#!/bin/bash

export __dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export __dir="$( dirname ${__dir} )"

if [ -d ${__dir}/__envi ]
then
    . ${__dir}/__envi/bin/activate
    export PYTHONPATH=${__dir}/src

    if [ -z "${_APP_PROFILE}" ];
    then
        ${__dir}/__envi/bin/python -u ${PYTHONPATH}/amberdriver/collision_avoidance/collision_avoidance_controller.py
    else
        export _APP_TEMP=$(mktemp -d)

        ${__dir}/__envi/bin/python -u -m cProfile -o ${_APP_TEMP}/output.pstats ${PYTHONPATH}/amberdriver/collision_avoidance/collision_avoidance_controller.py

        ${__dir}/__envi/bin/gprof2dot -f pstats --output ${_APP_TEMP}/output.dot ${_APP_TEMP}/output.pstats
        # TODO(paoolo) check if `dot` exists?
        /usr/bin/dot -Tpng ${_APP_TEMP}/output.dot -o ${__dir}/profile-collision_avoidance-$(date +"%Y%m%d-%H%M%S").png

        rm -rf ${_APP_TEMP}
    fi
fi
{'fraction_non_alphanumeric': 0.17405232247730912, 'fraction_numerical': 0.002135611318739989, 'mean_word_length': 3.440758293838863, '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': '4792315', 'n_tokens_mistral': 728, 'n_tokens_neox': 703, 'n_words': 120}