<commit_before>#!/bin/bash
#############################################################################
# SERVER STARTUP SCRIPT
# Sets the appropriate environmental variables and launches the server
# process. Run without flags for daemon mode.
#
# FLAGS
# -i    Interactive mode
# -d    Daemon mode
# -h	Show help display
#############################################################################

init () {
	## Sets environmental variables and preps the logs.
	export DJANGO_SETTINGS_MODULE="settings"
	BASE_PATH=`python -c "import settings; print settings.BASE_PATH"`
	mv -f $BASE_PATH/logs/evennia.log $BASE_PATH/logs/evennia.logs.old
}

startup_interactive() {
	## Starts the server in interactive mode.
	init
	echo "Starting in interactive mode..."
	twistd -n --logfile=logs/evennia.log --python=src/server.py
}

startup_daemon() {
	## Starts the server in daemon mode.
	init
	twistd --logfile=logs/evennia.log --python=src/server.py
}

help_display() {
	echo "SERVER STARTUP SCRIPT"
	echo "Sets the appropriate environmental variables and launches the server"
	echo "process. Run without flags for daemon mode."
	echo ""
	echo "FLAGS"
	echo " -i    Interactive mode"
	echo " -d    Daemon mode"
	echo " -h    Show help display"

}

case "$1" in 
	'-i') 
		startup_interactive
	;;
	'-d')
		startup_daemon
	;;
	'--help')
		help_display
	;;
	'-h')
		help_display
	;;
	*)
		# If no argument is provided, start in daemon mode.
		startup_daemon
esac
<commit_msg>added stop fonctionaly into the script as it is useful for daemon mode.<commit_after>#!/bin/bash
#############################################################################
# SERVER STARTUP SCRIPT
# Sets the appropriate environmental variables and launches the server
# process. Run without flags for daemon mode.
# It can be used for stoping the server.
#
# FLAGS
# -i    Interactive mode
# -d    Daemon mode
# -s    Stop the running server
# -h	Show help display
#############################################################################

init () {
	## Sets environmental variables and preps the logs.
	export DJANGO_SETTINGS_MODULE="settings"
	BASE_PATH=`python -c "import settings; print settings.BASE_PATH"`
	mv -f $BASE_PATH/logs/evennia.log $BASE_PATH/logs/evennia.logs.old
}

startup_interactive() {
	## Starts the server in interactive mode.
	init
	echo "Starting in interactive mode..."
	twistd -n --logfile=logs/evennia.log --python=src/server.py
}

startup_daemon() {
	## Starts the server in daemon mode.
	init
	twistd --logfile=logs/evennia.log --python=src/server.py
}

stop_server() {
	## Stops the running server
	kill `cat twistd.pid`
}

help_display() {
	echo "SERVER STARTUP SCRIPT"
	echo "Sets the appropriate environmental variables and launches the server"
	echo "process. Run without flags for daemon mode."
	echo ""
	echo "FLAGS"
	echo " -i    Interactive mode"
	echo " -d    Daemon mode"
	echo " -s    Stop the running server"
	echo " -h    Show help display"

}

case "$1" in 
	'-i') 
		startup_interactive
	;;
	'-d')
		startup_daemon
	;;
	'-s')
		stop_server
	;;
	'--help')
		help_display
	;;
	'-h')
		help_display
	;;
	*)
		# If no argument is provided, start in daemon mode.
		startup_daemon
esac

{'fraction_non_alphanumeric': 0.19480925578486555, 'fraction_numerical': 0.0006253908692933083, 'mean_word_length': 3.9906396255850236, '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': '6830340', 'n_tokens_mistral': 1074, 'n_tokens_neox': 1013, 'n_words': 321}