<commit_before><?php
/**
 * @author <NAME>, 2011, <EMAIL>
 */

$basedir = dirname(__FILE__) . "/../";
$libdir = dirname(__FILE__) . "/";
$configdir = dirname(__FILE__) . "/../config/";

//always chdir to our own directory
chdir($basedir);

// array to hold all error messages which should be presented
// to the user
$errors = array();

// array to hold all messages which should be presented
// to the user
$messages = array();

// Active assert and make it quiet
assert_options(ASSERT_ACTIVE, 1);
assert_options(ASSERT_WARNING, 0);
assert_options(ASSERT_QUIET_EVAL, 1);

// Create a handler function
function my_assert_handler($file, $line, $code) {
	echo "Assertion Failed:\n" .
		"\tFile:'$file'\n" .
		"\tLine: '$line'\n" .
		"\tCode: '$code'\n";
	global $errors;
	if (count($errors) > 0) {
		foreach ($errors as $key => $value) {
			print("\tERROR: '$value'\n");
		}
		debug_backtrace();
		exit(-1);
	}
}

// Set up the callback
assert_options(ASSERT_CALLBACK, 'my_assert_handler');
?><commit_msg>Always exit when a assertion fails<commit_after><?php
/**
 * @author <NAME>, 2011, <EMAIL>
 */

$basedir = dirname(__FILE__) . "/../";
$libdir = dirname(__FILE__) . "/";
$configdir = dirname(__FILE__) . "/../config/";

//always chdir to our own directory
chdir($basedir);

// array to hold all error messages which should be presented
// to the user
$errors = array();

// array to hold all messages which should be presented
// to the user
$messages = array();

// Active assert and make it quiet
assert_options(ASSERT_ACTIVE, 1);
assert_options(ASSERT_WARNING, 0);
assert_options(ASSERT_QUIET_EVAL, 1);

// Create a handler function
function my_assert_handler($file, $line, $code) {
	echo "Assertion Failed:\n" .
		"\tFile:'$file'\n" .
		"\tLine: '$line'\n" .
		"\tCode: '$code'\n";
	global $errors;
	if (count($errors) > 0) {
		foreach ($errors as $key => $value) {
			print("\tERROR: '$value'\n");
		}
		debug_backtrace();
		exit(-1);
	}
	exit(-2);
}

// Set up the callback
assert_options(ASSERT_CALLBACK, 'my_assert_handler');
?>
{'fraction_non_alphanumeric': 0.1786064769381747, 'fraction_numerical': 0.009322865554465163, 'mean_word_length': 3.9610705596107056, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '5375634', 'n_tokens_mistral': 732, 'n_tokens_neox': 697, 'n_words': 198}