<commit_before>require('./lib/js.io/packages/jsio')
jsio.path.shared = './js'
jsio.path.server = './js'

var redis = require('./lib/redis-node-client/lib/redis-client')
var sys = require('sys')

jsio('from shared.javascript import bind')
jsio('import shared.query')

shared.query.init(redis)

process.addListener('exit', shared.query.release)
process.addListener('uncaughtException', function(e) {
	sys.puts("ERROR: uncaught exception", JSON.stringify(e))
	process.exit()
})
process.addListener('SIGINT', process.exit)<commit_msg>Add a second layer of try/catch around the error reporting, in case the JSON stringification of the error object fails due to circular references<commit_after>require('./lib/js.io/packages/jsio')
jsio.path.shared = './js'
jsio.path.server = './js'

var redis = require('./lib/redis-node-client/lib/redis-client')
var sys = require('sys')

jsio('from shared.javascript import bind')
jsio('import shared.query')

shared.query.init(redis)

process.addListener('exit', shared.query.release)
process.addListener('uncaughtException', function(e) {
	try {
		sys.puts("ERROR: uncaught exception", JSON.stringify(e))
	} catch(e2) {
		sys.puts("ERROR: could not JSON stringify error message", e.message, e2.message)
	}
	process.exit()
})
process.addListener('SIGINT', process.exit)
{'fraction_non_alphanumeric': 0.16295157571099156, 'fraction_numerical': 0.0015372790161414297, 'mean_word_length': 5.542713567839196, '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': '7019584', 'n_tokens_mistral': 426, 'n_tokens_neox': 422, 'n_words': 91}