<commit_before>(function() {

	"use strict";

	var utils = modules.Utils,
		once = utils.once,
		pageFactory = modules.PoeticRivals.factories.page;

	pageFactory.Index = function(indexId, jqTemplateClassName, apiUrl, excludedIds, newModelCallback) {

		var page = this;

		pageFactory.Error.call(page);

		var jqTemplate = once(function() {
			return $($("." + page.jqTemplateClassName)[0]).clone();
		});

		var getModelsJSON = function(errorCallback) {
			$.ajax(
				{
					url: page.apiUrl + "?excluded_ids=" + page.excludedIds,
					method: "GET",
					dataType: "json",
					success: page.onGetModelsJSON,
					error: errorCallback
				}
			);
		};

		var onGetModelsJSON = function(modelsJSON) {
			modelsJSON.forEach(function(modelJSON) {
				var model = newModelCallback(modelJSON, page.indexId, page.jqTemplate().clone());
				model.updateJqTemplate();
				model.render();
				page.excludedIds += "," + model.id;
			});
		};

		var onRecordNotProcessed = function(error, errorJqXHR, recordNotFoundCallback, self) {
			console.log("Status %s: %s", error.status, error.title);
			console.log("This should not be possible on this page.");
		}

		page.indexId = indexId;
		page.jqTemplateClassName = jqTemplateClassName;
		page.apiUrl = apiUrl;
		page.excludedIds = excludedIds;
		page.jqTemplate = jqTemplate;
		page.newModelCallback = newModelCallback;
		page.getModelsJSON = getModelsJSON;
		page.onGetModelsJSON = onGetModelsJSON;
		page.onRecordNotProcessed = onRecordNotProcessed;

	}

})();<commit_msg>added an optional call to #afterModelRender to page.Index#onGetModelJson<commit_after>(function() {

	"use strict";

	var utils = modules.Utils,
		once = utils.once,
		pageFactory = modules.PoeticRivals.factories.page;

	pageFactory.Index = function(indexId, jqTemplateClassName, apiUrl, excludedIds, newModelCallback) {

		var page = this;

		pageFactory.Error.call(page);

		var jqTemplate = once(function() {
			return $($("." + page.jqTemplateClassName)[0]).clone();
		});

		var getModelsJSON = function(errorCallback) {
			$.ajax(
				{
					url: page.apiUrl + "?excluded_ids=" + page.excludedIds,
					method: "GET",
					dataType: "json",
					success: page.onGetModelsJSON,
					error: errorCallback
				}
			);
		};

		var onGetModelsJSON = function(modelsJSON) {
			modelsJSON.forEach(function(modelJSON) {
				var model = newModelCallback(modelJSON, page.indexId, page.jqTemplate().clone());
				model.updateJqTemplate();
				model.render();
				if (page.afterModelRender) {
					page.afterModelRender(model);
				}
				page.excludedIds += "," + model.id;
			});
		};

		var onRecordNotProcessed = function(error, errorJqXHR, recordNotFoundCallback, self) {
			console.log("Status %s: %s", error.status, error.title);
			console.log("This should not be possible on this page.");
		}

		page.indexId = indexId;
		page.jqTemplateClassName = jqTemplateClassName;
		page.apiUrl = apiUrl;
		page.excludedIds = excludedIds;
		page.jqTemplate = jqTemplate;
		page.newModelCallback = newModelCallback;
		page.getModelsJSON = getModelsJSON;
		page.onGetModelsJSON = onGetModelsJSON;
		page.onRecordNotProcessed = onRecordNotProcessed;

	}

})();
{'fraction_non_alphanumeric': 0.1315207081884287, 'fraction_numerical': 0.0006323110970597534, 'mean_word_length': 4.0624, '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': '6894517', 'n_tokens_mistral': 1192, 'n_tokens_neox': 1009, 'n_words': 192}