<commit_before><!DOCTYPE html>

<html>

	<head>
		<title>Intuit Bootcamp</title>
		<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
	</head>

	<body>

		<script>

			window.Intuit = (function() {

				function inherits(parent, child) {
					child.prototype = Object.create(parent.prototype);
					child.prototype.constructor = child;
					child.prototype._super = parent;
				}

				var intuit = {};

				function internalExtend(superEntity, options) {

					var defaults = {}, initialize = null;

					if (options) {

						if (options.defaults) {
							defaults = options.defaults;
							delete options.defaults;
						}

						if (options.initialize) {
							console.log("set initialize");
							initialize = options.initialize;
							delete options.initialize;
						}
					}

					function Entity(options) {

						if (!options) {
							options = {};
						}

						for (var prop in defaults) {
							if (!options.hasOwnProperty(prop)) {
								options[prop] = defaults[prop];
							}
						}

						Entity.prototype._super.call(this, options);

						if (initialize) {
							console.log("run initialize");
							initialize.call(this);
						}

					}

					inherits(superEntity, Entity);

					for (var prop in options) {
						Entity.prototype[prop] = options[prop];
					}

					Entity.extend = function(options) {
						return internalExtend(Entity, options)
					};

					return Entity;

				};

				function Model(options) {
						this.attributes = options || {};
				}

				Model.prototype.get = function(propName) {
					return this.attributes[propName];
				};

				Model.prototype.set = function(propName, propValue) {
					this.attributes[propName] = propValue;
				};

				Model.extend = function(options) {
					return internalExtend(Model, options);
				};

				intuit.Model = Model;

				function Collection(options) {
					this.models = options || [];
				}

				Collection.prototype.add = function(model) {
					this.models.push(model);
				};

				Collection.prototype.forEach = function(fn) {
					this.models.forEach(fn);
				};

				Collection.extend = function(options) {
					return internalExtend(Collection, options);
				};

				intuit.Collection = Collection;

				return intuit;

			})();

			var Person = Intuit.Model.extend({
				initialize: function() {
					this.set("addresses", []);
				},
				addAddress: function(street, city, state, zipCode) {
					this.get("addresses").push({
						street: street,
						city: city,
						state: state,
						zipCode: zipCode
					});
				},
				getFullName: function() {
					return this.get("firstName") + " " + this.get("lastName");
				}
			});

			var IntuitEmployee = Person.extend({
				defaults: {
					firstName: "John",
					lastName: "Doe",
					age: 32,
					empId: 234,
				},
				getEmpInfo: function() {
					return this.get("empId") + " " + this.get("lastName") + ", " + this.get("firstName");
				}
			})

			var e = new IntuitEmployee({
				firstName:"Barack",
				lastName: "Obama",
				age: 54,
				empId: 1
			});

			e.addAddress("1600 Pennsylvania Ave.", "Washington", "DC", "10000");

			var e2 = new IntuitEmployee({
				firstName: "Sarah",
				lastName: "Greene",
				age: 12,
				empId: 2
			});
			e2.addAddress("123 Oak Lane", "Martha's Vineyard", "MA", "20000");

			console.dir(e2);

			var IntuitEmployees = Intuit.Collection.extend({
				showMailingList: function() {
					this.models.forEach(function(emp) {<commit_msg>added events<commit_after><!DOCTYPE html>

<html>

	<head>
		<title>Intuit Bootcamp</title>
		<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
	</head>

	<body>

		<script>

			window.Intuit = (function() {

				function inherits(parent, child) {
					child.prototype = Object.create(parent.prototype);
					child.prototype.constructor = child;
					child.prototype._super = parent;
				}

				var intuit = {};

				function internalExtend(superEntity, options) {

					var defaults = {}, initialize = null;

					if (options) {

						if (options.defaults) {
							defaults = options.defaults;
							delete options.defaults;
						}

						if (options.initialize) {
							console.log("set initialize");
							initialize = options.initialize;
							delete options.initialize;
						}
					}

					function Entity(options) {

						if (!options) {
							options = {};
						}

						for (var prop in defaults) {
							if (!options.hasOwnProperty(prop)) {
								options[prop] = defaults[prop];
							}
						}

						Entity.prototype._super.call(this, options);

						if (initialize) {
							console.log("run initialize");
							initialize.call(this);
						}

					}

					inherits(superEntity, Entity);

					for (var prop in options) {
						Entity.prototype[prop] = options[prop];
					}

					Entity.extend = function(options) {
						return internalExtend(Entity, options)
					};

					return Entity;

				};

				function Model(options) {
						this.attributes = options || {};
				}

				inherits(Events, Model);

				Model.prototype.get = function(propName) {
					return this.attributes[propName];
				};

				Model.prototype.set = function(propName, propValue) {
					var eventData = {};
					eventData[propName] = {
						oldValue: this.attributes[propName],
						newValue: propValue
					};
					this.attributes[propName] = propValue;
					this.trigger("change", eventData);
				};

				Model.extend = function(options) {
					return internalExtend(Model, options);
				};

				intuit.Model = Model;

				function Collection(options) {
					this.models = options || [];
				}

				inherits(Events, Collection);

				Collection.prototype.add = function(model) {
					this.models.push(model);
				};

				Collection.prototype.forEach = function(fn) {
					this.models.forEach(fn);
				};

				Collection.extend = function(options) {
					return internalExtend(Collection, options);
				};

				intuit.Collection = Collection;

				function Events() {

				}

				Events.prototype.trigger = function(eventName, eventData) {

					if (this.events && this.events[eventName]) {

						this.events[eventName].forEach(function (eventHandler) {
							eventHandler(eventData);
						});
					}

				};

				Events.prototype.on = function(eventName, eventHandler) {

					if (!this.events) {
						this.events = {};
					}

					if (!this.events[eventName]) {
						this.events[eventName] = [];
					}

					this.events[eventName].push(eventHandler);

				};

				return intuit;

			})();

			var Person = Intuit.Model.extend({
				initialize: function() {
					this.set("addresses", []);
				},
				addAddress: function(street, city, state, zipCode) {
					this.get("addresses").push({
						street: street,
						city: city,
						state: state,
						zipCode: zipCode
					});
					this.trigger("change-address", {});
				},
				getFullName: function() {
					return this.get("firstName") + " " + this.get("lastName");
				}
			});

			var IntuitEmployee = Person.extend({
				defaults: {
					firstName: "John",
					lastName: "Doe",
					age: 32,
					empId: 234,
				},
				getEmpInfo: function() {
					return this.get("empId") + " " + this.get("lastName") + ", " + this.get("firstName");
				}
			})

			var e = new IntuitEmployee({
				firstName:"Barack",
				lastName: "Obama",
				age: 53,
				empId: 1
			});

			e.on("change", function() {
				console.log("Barack Obama Changed");
				console.dir(arguments);
			});

			console.log("set age to 54");
			e.set("age", 54);

			e.addAddress("1600 Pennsylvania Ave.", "Washington", "DC", "10000");

			var e2 = new IntuitEmployee({
				firstName: "Sarah",
				lastName: "Greene",
				age: 12,
				empId: 2
			});
			e2.addAddress("123 Oak Lane", "Martha's Vineyard", "MA", "20000");

			console.dir(e2);

			var IntuitEmployees = Intuit.Collection.extend({
				showMailingList: function() {
					this.models.forEach(function(emp) {
{'fraction_non_alphanumeric': 0.1474164133738602, 'fraction_numerical': 0.008358662613981762, 'mean_word_length': 2.4988923349579086, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '3053071', 'n_tokens_mistral': 3565, 'n_tokens_neox': 2400, 'n_words': 472}