<commit_before>#! /bin/bash

# This script is intended to be sourced, not run
if [[ $0 == $BASH_SOURCE ]]
then
    echo "This file should be run as"
    echo "  source $0"
    echo "and should not be run as"
    echo "  sh $0"
fi

export KD_DIR=$(dirname $(readlink -f $BASH_SOURCE))
PYTHON=${PYTHON:-python}

kd ()
{ 
	local kd_script=$KD_DIR/kd.py
	kd_result=1
	if ! destination=$(PYTHONPATH=$KD_DIR $PYTHON $kd_script "$@" 2>&1)
	then
		echo "$destination"
	else
		local real_destination=$(PYTHONPATH=$KD_DIR $PYTHON -c "import os; print os.path.realpath('$destination')")
		if [[ $destination != $real_destination ]]
		then
			echo "cd ($destination ->) $real_destination"
			destination=$real_destination
		elif [[ $destination != $1 && $1 != "-" ]]
		then
			echo "cd $destination"
		fi
		cd "$destination"
		kd_result=0
	fi
	unset destination
	return $kd_result
}

kg ()
{
    local __doc__="Debug the kd function and script"
    set -x
    kd -U "$@"
    set +x
}<commit_msg>Set PYTHON in one place for the script<commit_after>#! /bin/bash

# This script is intended to be sourced, not run
if [[ $0 == $BASH_SOURCE ]]
then
    echo "This file should be run as"
    echo "  source $0"
    echo "and should not be run as"
    echo "  sh $0"
fi

export KD_DIR=$(dirname $(readlink -f $BASH_SOURCE))
PYTHON=${PYTHON:mython}

kd ()
{ 
	local kd_script=$KD_DIR/kd.py
	kd_result=1
	if ! destination=$(PYTHONPATH=$KD_DIR $PYTHON $kd_script "$@" 2>&1)
	then
		echo "$destination"
	else
		local real_destination=$(PYTHONPATH=$KD_DIR $PYTHON -c "import os; print os.path.realpath('$destination')")
		if [[ $destination != $real_destination ]]
		then
			echo "cd ($destination ->) $real_destination"
			destination=$real_destination
		elif [[ $destination != $1 && $1 != "-" ]]
		then
			echo "cd $destination"
		fi
		cd "$destination"
		kd_result=0
	fi
	unset destination
	return $kd_result
}

kg ()
{
    local __doc__="Debug the kd function and script"
    set -x
    kd -U "$@"
    set +x
}

kd () {
	local KD_DIR=$(dirname $BASH_SOURCE)
	local kd_script=$KD_DIR/kd.py
	PYTHONPATH=$KD_DIR $PYTHON $kd_script -U "$@"
}
{'fraction_non_alphanumeric': 0.1450165328294757, 'fraction_numerical': 0.008502598016060462, 'mean_word_length': 3.6447368421052633, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2899763', 'n_tokens_mistral': 855, 'n_tokens_neox': 799, 'n_words': 223}