<commit_before>Events = new Mongo.Collection("events");

function Event(name, location, line, votes, createdAt, lastConfirmedAt) {
	this.name = name;
	this.location = location;
  this.line = line;
	this.votes = votes;
  this.createdAt = createdAt;
	this.lastConfirmedAt = lastConfirmedAt;
}

Event.prototype = {
  save: function() {
		var docId = Events.findOne({
			name: this.name,
			location: this.location,
			expired: false
		});

		if (docId) { // Upvote
			if (Session.get(docId._id) == null) { // Can upvote
				// Avoid future upvotes
				Session.setPersistent(docId._id, "upvoted");
				return Events.update(docId._id, {$inc: {votes: 1}});
			}
		} else { // Create
			newEvent =  Events.insert({
	      name: this.name,
	      location: this.location,
        line: this.line,<commit_msg>Fixed dedup of events, now filtering by line<commit_after>Events = new Mongo.Collection("events");

function Event(name, location, line, votes, createdAt, lastConfirmedAt) {
	this.name = name;
	this.location = location;
  this.line = line;
	this.votes = votes;
  this.createdAt = createdAt;
	this.lastConfirmedAt = lastConfirmedAt;
}

Event.prototype = {
  save: function() {
		var docId = Events.findOne({
			name: this.name,
			location: this.location,
			line: this.line,
			expired: false
		});

		if (docId) { // Upvote
			if (Session.get(docId._id) == null) { // Can upvote
				// Avoid future upvotes
				Session.setPersistent(docId._id, "upvoted");
				return Events.update(docId._id, {$inc: {votes: 1}});
			}
		} else { // Create
			newEvent =  Events.insert({
	      name: this.name,
	      location: this.location,
        line: this.line,
{'fraction_non_alphanumeric': 0.14173228346456693, 'fraction_numerical': 0.0012113870381586917, 'mean_word_length': 3.2142857142857144, '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': '860660', 'n_tokens_mistral': 625, 'n_tokens_neox': 561, 'n_words': 132}