<commit_before>var mongoose = require('mongoose')
	, fs = require('fs');


var connect = function(mongoLocation, callback){
	mongoose.connect(mongoLocation, function(){
		var models_path = __dirname + '/models'; // __dirname = ./config
		fs.readdirSync(models_path).forEach(function (file) {
			require(models_path + '/' + file);
		});

		node_operations = require('./node_operations/node_operations');
		exports.insertNode = node_operations.insertNode;
		exports.deleteNode = node_operations.deleteNode;
		exports.findNode = node_operations.findNode;
		exports.fullNodeData = node_operations.fullNodeData;
		exports.updateNode = node_operations.updateNode;
		exports.findFullNode = node_operations.findFullNode;

		callback();
	});
}

exports.connect = connect;
<commit_msg>added optional callback to connect<commit_after>var mongoose = require('mongoose')
	, fs = require('fs');


var connect = function(mongoLocation, callback){
	mongoose.connect(mongoLocation, function(){
		var models_path = __dirname + '/models'; // __dirname = ./config
		fs.readdirSync(models_path).forEach(function (file) {
			require(models_path + '/' + file);
		});

		node_operations = require('./node_operations/node_operations');
		exports.insertNode = node_operations.insertNode;
		exports.deleteNode = node_operations.deleteNode;
		exports.findNode = node_operations.findNode;
		exports.fullNodeData = node_operations.fullNodeData;
		exports.updateNode = node_operations.updateNode;
		exports.findFullNode = node_operations.findFullNode;

		if (callback) { callback(); }
	});
}

exports.connect = connect;

{'fraction_non_alphanumeric': 0.12712397734424166, 'fraction_numerical': 0.0, 'mean_word_length': 5.437246963562753, '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': '294745', 'n_tokens_mistral': 499, 'n_tokens_neox': 472, 'n_words': 82}