<commit_before>var Widget = new Class({

	Implements: Unit,

	initialize: function(id, data){
		this.setupUnit();
		this.id = id;
		this.name = data.name;

		this.build(data.label + ' (' + this.id + ')');
		this.buildControllers(data.controllers);
	},

	build: function(label){
		this.element = new Element('section.widget').adopt([
			new Element('h1', {text: label}),
			new Element('span.close[html=&#10006;]') // &#10005;
		]);
		return this;
	},

	buildControllers: function(controllers){
		var container = new Element('div.controllers').inject(this.element);
		for (var name in controllers){
			if (controllers.hasOwnProperty(name)){
				this.addController([this.id, this.name, name], controllers[name]).attach(container);
			}
		};
		return this;
	},

	addController: function(id, controller){
		var self = this,
			control = new Controller(controller.type, controller);

		control.addEvent('quickchange', function(value){
			self.publish('widget update', {
				'path': id,
				'value': value
			});
		});
		this.subscribe('planet update ' + id.join(' '), this.onStateUpdate.bind(control));
		return control;
	},

	attach: function(element, position){
		this.element.inject(element || document.body, position || 'bottom');
		return this;
	},

	detach: function(){
		this.element.dispose();
		return this;
	},

	onStateUpdate: function(value){
		this.set(value);
	}

});
<commit_msg>use more meaningful argument names<commit_after>var Widget = new Class({

	Implements: Unit,

	initialize: function(id, data){
		this.setupUnit();
		this.id = id;
		this.name = data.name;

		this.build(data.label + ' (' + this.id + ')');
		this.buildControllers(data.controllers);
	},

	build: function(label){
		this.element = new Element('section.widget').adopt([
			new Element('h1', {text: label}),
			new Element('span.close[html=&#10006;]') // &#10005;
		]);
		return this;
	},

	buildControllers: function(controllers){
		var container = new Element('div.controllers').inject(this.element);
		for (var name in controllers){
			if (controllers.hasOwnProperty(name)){
				this.addController([this.id, this.name, name], controllers[name]).attach(container);
			}
		};
		return this;
	},

	addController: function(path, controller){
		var self = this,
			control = new Controller(controller.type, controller);

		control.addEvent('quickchange', function(value){
			self.publish('widget update', {
				'path': path,
				'value': value
			});
		});
		this.subscribe('planet update ' + path.join(' '), this.onStateUpdate.bind(control));
		return control;
	},

	attach: function(element, position){
		this.element.inject(element || document.body, position || 'bottom');
		return this;
	},

	detach: function(){
		this.element.dispose();
		return this;
	},

	onStateUpdate: function(value){
		this.set(value);
	}

});

{'fraction_non_alphanumeric': 0.17254901960784313, 'fraction_numerical': 0.00784313725490196, 'mean_word_length': 4.284369114877589, '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': '4356293', 'n_tokens_mistral': 1023, 'n_tokens_neox': 904, 'n_words': 186}