<commit_before>
var mongojs = require('mongojs');
var assert = require('assert');
var EventEmitter = require('events');
var semver = require('semver');


/**
 * check mongojs version. it should be >= 0.9.10
 */
var mongojs_version = require('mongojs/package.json').version;
assert(semver.satisfies(mongojs_version, '>=0.9.10'), 'mongojs-logger depends on mongojs version >= 0.9.10');


/**
 * export the api to receive log listeners
 */
var events = new EventEmitter();

module.exports = function(listener) {
	events.on('dbop', listener);
};



/**
 * hook into mongojs collection methods
 */
var proto = mongojs.Collection.prototype; <commit_msg>Fixed event emitter import<commit_after>
var mongojs = require('mongojs');
var assert = require('assert');
var EventEmitter = require('events').EventEmitter;
var semver = require('semver');


/**
 * check mongojs version. it should be >= 0.9.10
 */
var mongojs_version = require('mongojs/package.json').version;
assert(semver.satisfies(mongojs_version, '>=0.9.10'), 'mongojs-logger depends on mongojs version >= 0.9.10');


/**
 * export the api to receive log listeners
 */
var events = new EventEmitter();

module.exports = function(listener) {
	events.on('dbop', listener);
};



/**
 * hook into mongojs collection methods
 */
var proto = mongojs.Collection.prototype; 
{'fraction_non_alphanumeric': 0.1553030303030303, 'fraction_numerical': 0.01818181818181818, 'mean_word_length': 4.7685589519650655, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '269573', 'n_tokens_mistral': 435, 'n_tokens_neox': 420, 'n_words': 111}