<commit_before>define(function(require){
	var _ = require('underscore');

	SequenceProvider.$inject = ['Collection', 'mixerSequential','mixerRecursive', 'templateObj'];
	function SequenceProvider(Collection, mixerSequential, mixerRecursive, templateObj){
		// classical inheritance from Collection
		// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#Classical_inheritance_with_Object.create
		function Sequence(coll, db){
			Collection.call(this, coll);

			if (!db){
				throw new Error('Sequences need to take a db as the second argument');
			}
			this.db = db;
		}

		Sequence.prototype = Object.create(Collection.prototype);
		Sequence.prototype.constructor = Sequence;

		_.extend(Sequence.prototype, {
			// @TODO: we should add a system to use inline templates (Grunt style) when inflating.
			// maybe add a context argument here?
			buildPage: function(pageObj){
				if (_.isUndefined(pageObj)){
					return undefined;
				}

				var page = this.db.inflate('pages', pageObj);
				templateObj(page, {pageData: page.data || {}});

				page.questions = mixerRecursive(page.questions || []);
<commit_msg>fix(task): polyfil Object.create for IE8<commit_after>define(function(require){
	var _ = require('underscore');

	if (typeof Object.create != 'function') {
		(function () {
			var F = function () {};
			Object.create = function (o) {
				if (arguments.length > 1) {
					throw new Error('Second argument not supported');
				}
				if (o === null) {
					throw new Error('Cannot set a null [[Prototype]]');
				}
				if (typeof o != 'object') {
					throw new TypeError('Argument must be an object');
				}
				F.prototype = o;
				return new F();
			};
		})();
	}

	SequenceProvider.$inject = ['Collection', 'mixerSequential','mixerRecursive', 'templateObj'];
	function SequenceProvider(Collection, mixerSequential, mixerRecursive, templateObj){
		// classical inheritance from Collection
		// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#Classical_inheritance_with_Object.create
		function Sequence(coll, db){
			Collection.call(this, coll);

			if (!db){
				throw new Error('Sequences need to take a db as the second argument');
			}
			this.db = db;
		}

		Sequence.prototype = Object.create(Collection.prototype);
		Sequence.prototype.constructor = Sequence;

		_.extend(Sequence.prototype, {
			// @TODO: we should add a system to use inline templates (Grunt style) when inflating.
			// maybe add a context argument here?
			buildPage: function(pageObj){
				if (_.isUndefined(pageObj)){
					return undefined;
				}

				var page = this.db.inflate('pages', pageObj);
				templateObj(page, {pageData: page.data || {}});

				page.questions = mixerRecursive(page.questions || []);

{'fraction_non_alphanumeric': 0.13488372093023257, 'fraction_numerical': 0.0007155635062611807, 'mean_word_length': 3.983957219251337, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 2, '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': '3212491', 'n_tokens_mistral': 974, 'n_tokens_neox': 808, 'n_words': 206}