<commit_before>window.TodoView = Backbone.View.extend({
	template: _.template('<span class="input-group-addon"><input <%= completed ? "checked=checked" : "" %> type="checkbox"></span><input value="<%= val %>" class="form-control<%= completed ? " finished" : "" %>" type="text"><span class="input-group-btn"><button class="btn btn-danger" type="button"><i class="glyphicon glyphicon-remove"></i></button></span>'),

	render: function() {
		this.$el.html(this.template(this.model.toJSON()));//'el'JS wrapped DOM node to operate on
		return this;
	},
	//Dive encapsulates below. Using this to effect those class names
	className: 'input-group input-group-lg'
});

//Display ONE Item - All below mimics the ng-repeat directive
window.TodosView = Backbone.View.extend({
	initialize: function() { //below are event listeners for the collection/model Level
		this.collection.on('add', this.addOne, this); //do this on add
		this.collection.on('reset', this.addAll, this);//do this on reset
		this.collection.on('destroy', this.render, this);//do this on destroy
	},

	addOne: function(todoItem){
		var todoView = new TodoView({model: todoItem}); //the info is from model
		this.$el.append(todoView.render().el); //appends to list and renders
	},

//Add all 
	addAll: function() {
		this.$el.empty(); //Clears input
		//collection refers to underlying collection
		this.collection.forEach(this.addOne, this);//this adds collection in 'this' input
	},

//Render all
	render: function() { //adds all and renders for return
		this.addAll();
		return this;
	},

	filterCompleted: function() {
		this.collection.filterCompleted();
		//this.render();
		}
});<commit_msg>created filter func in the views too<commit_after>window.TodoView = Backbone.View.extend({
	template: _.template('<span class="input-group-addon"><input <%= completed ? "checked=checked" : "" %> type="checkbox"></span><input value="<%= val %>" class="form-control<%= completed ? " finished" : "" %>" type="text"><span class="input-group-btn"><button class="btn btn-danger" type="button"><i class="glyphicon glyphicon-remove"></i></button></span>'),

	render: function() {
		this.$el.html(this.template(this.model.toJSON()));//'el'JS wrapped DOM node to operate on
		return this;
	},
	//Dive encapsulates below. Using this to effect those class names
	className: 'input-group input-group-lg'
});

//Display ONE Item - All below mimics the ng-repeat directive
window.TodosView = Backbone.View.extend({
	initialize: function() { //below are event listeners for the collection/model Level
		this.collection.on('add', this.addOne, this); //do this on add
		this.collection.on('reset', this.addAll, this);//do this on reset
		this.collection.on('destroy', this.render, this);//do this on destroy
	},

	addOne: function(todoItem){
		var todoView = new TodoView({model: todoItem}); //the info is from model
		this.$el.append(todoView.render().el); //appends to list and renders
	},

//Add all 
	addAll: function() {
		this.$el.empty(); //Clears input
		//collection refers to underlying collection
		this.collection.forEach(this.addOne, this);//this adds collection in 'this' input
	},

//Render all
	render: function() { //adds all and renders for return
		this.addAll();
		return this;
	},

	filterCompleted: function() {
		this.collection.filterCompleted();
		this.render();
		}
});
{'fraction_non_alphanumeric': 0.1692169216921692, 'fraction_numerical': 0.0, 'mean_word_length': 4.510743801652892, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '1485843', 'n_tokens_mistral': 1070, 'n_tokens_neox': 1001, 'n_words': 282}