<commit_before>
global.process.removeAllListeners();

global.process.on( "uncaughtException", function( err ) {
	console.log( "Uncaught exception:", err );

	// do nothing if window was fully initialized
	if ( window.initialized ) { return; }

	// kill the process while not being in debug mode
	if ( !DEBUG ) {
		global.process.exit( 1 );
	}

	// open the window and dev tools
	try {
		var nwWindow = window.nwDispatcher.requireNwGui().Window.get();
		nwWindow.show();
		nwWindow.showDevTools();
	} catch ( e ) {
		console.log( "Could not initialize application window" );
		global.process.exit( 1 );
	}
});

require( "styles/app" );
require( "./app" );
<commit_msg>Fix global uncaughtException event listener<commit_after>
global.process.removeAllListeners();

global.process.on( "uncaughtException", function( err ) {
	// do nothing if window was fully initialized
	if ( window.initialized ) { return; }

	// show the app window and dev tools while being in debug mode
	if ( DEBUG ) {
		try {
			var nwWindow = require( "nw.gui" ).Window.get();
			nwWindow.show();
			nwWindow.showDevTools();
			return;
		} catch( e ) {}
	}

	// write to stderr and kill the process with error code 1
	global.process.stderr.write([
		"Could not initialize application window",
		require( "util" ).inspect( err ),
		""
	].join( "\n" ) );
	global.process.exit( 1 );
});


require( "styles/app" );
require( "./app" );

{'fraction_non_alphanumeric': 0.14621968616262482, 'fraction_numerical': 0.0028530670470756064, 'mean_word_length': 3.6303630363036303, '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': '4463106', 'n_tokens_mistral': 475, 'n_tokens_neox': 442, 'n_words': 133}