<commit_before>(function(window, undefined) {

	"use strict";

	// extend
	// Borrowed from Underscore.js
	function extend(object) {
		var argsIndex, argsLength, iteratee, key;
		if (!object) {
			return object;
		}
		argsLength = arguments.length;
		for (argsIndex = 1; argsIndex < argsLength; argsIndex++) {
			iteratee = arguments[argsIndex];
			if (iteratee) {
				for (key in iteratee) {
					object[key] = iteratee[key];
				}
			}
		}
		return object;
	}

	var secret = {};

	var Chart = function(opts) {

		var mixin, mixinNs;

		if (opts === secret) {
			return this;
		}

		if (opts == null) {
			opts = {};
		}

		if (!this.base) {
			if (!opts.base) {
				opts.base = d3.select("body").append("svg").append("g");
			}
			this.base = opts.base;
		}

		this.layers = {};
		for (mixinNs in this.mixins) {
			// I don't think this approach is technically possible, since you would
			// actually need to call the mixin's constructor (not just its
			// `initialize` method) in order to ensure that the mixin's mixins are
			// created. I guess the Chart constructor could only *conditionally* set
			// `this.layers = {};` if `this.layers` has not already been set, but
			// that has definite code smell.
			//this.mixins[mixinName].prototype.initialize.call(this);
			this[mixinNs] = new this.mixins[mixinNs](secret);
			opts.base = this.base.append("g");
			this.constructor.apply(this[mixinNs], [opts].concat(Array.prototype.slice.call(arguments, 1)));
		}

		this.initialize.apply(this, arguments);
	};

	Chart.prototype.initialize = function() {};

	Chart.prototype.transform = function(data) {
		return data;
	};

	Chart.prototype.draw = function(data) {

		var layerName, mixinNs;

		data = this.transform(data);

		for (layerName in this.layers) {
			this.layers[layerName].draw(data);
		}
		for (mixinNs in this.mixins) {
			this[mixinNs].draw(data);<commit_msg>Remove mixin magic<commit_after>(function(window, undefined) {

	"use strict";

	// extend
	// Borrowed from Underscore.js
	function extend(object) {
		var argsIndex, argsLength, iteratee, key;
		if (!object) {
			return object;
		}
		argsLength = arguments.length;
		for (argsIndex = 1; argsIndex < argsLength; argsIndex++) {
			iteratee = arguments[argsIndex];
			if (iteratee) {
				for (key in iteratee) {
					object[key] = iteratee[key];
				}
			}
		}
		return object;
	}

	var Chart = function(opts) {

		var mixin, mixinNs;

		if (opts == null) {
			opts = {};
		}

		if (!this.base) {
			if (!opts.base) {
				opts.base = d3.select("body").append("svg").append("g");
			}
			this.base = opts.base;
		}

		this.layers = {};
		this._mixins = {};

		this.initialize.apply(this, arguments);
	};

	Chart.prototype.initialize = function() {};

	Chart.prototype.transform = function(data) {
		return data;
	};

	Chart.prototype.mixin = function() {
		var mixins, mixinName;

		// Support signature #mixin( <string> name, <Chart> chart )
		if (typeof arguments[0] === "string") {
			mixins = {};
			mixins[arguments[0]] = arguments[1];
		// Support signature #mixin( <object> mixins )
		} else {
			mixins = arguments[0];
		}

		for (mixinName in mixins) {
			if (Object.hasOwnProperty.call(mixins, mixinName)) {
				this._mixins[mixinName] = mixins[mixinName];
				// Extend root-level of instance for easier access (i.e.
				// `this[mixinName]` instead of `this._mixins[mixinName]`)
				this[mixinName] = mixins[mixinName];
			}
		}
	};

	Chart.prototype.draw = function(data) {

		var layerName, mixinName;

		data = this.transform(data);

		for (layerName in this.layers) {
			this.layers[layerName].draw(data);
		}

		for (mixinName in this._mixins) {
			this._mixins[mixinName].draw(data);
{'fraction_non_alphanumeric': 0.15225666122892875, 'fraction_numerical': 0.0024469820554649264, 'mean_word_length': 3.277906976744186, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 6, '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': '4391209', 'n_tokens_mistral': 1464, 'n_tokens_neox': 1250, 'n_words': 294}