<commit_before>/**
 * A generator for getter-setter-with-change-event functions.
 * Takes as input an options object, returns an object whose
 * properties are getter-setter functions corresponding to
 * properties of the options object.
 *
 * See http://bost.ocks.org/mike/chart/ for a description 
 * of the setter-getter function pattern.
 *
 * In addition to this pattern, the functions emit change events.
 * To listen, use `theFunction.on('change', function(newValue){ ... });`
 */
define(['underscore', 'backbone'], function(_, Backbone){
  return function(options){
    var my = {};
    _.each(_.keys(options), function(property){
      var fn = function(value){
        if (!arguments.length){
          return options[property];
        }
        else{
          options[property] = value;
          fn.trigger('change', value);
        }
        return my;
      };
      _.extend(fn, Backbone.Events);
      my[property] = fn;
    });
    return my;
  };
});
<commit_msg>Made getterSetters comply with JSLint<commit_after>/*global define */
/*jslint nomen: true */ // this causes JSLint to tolerate "_"

/**
 * A generator for getter-setter-with-change-event functions.
 * Takes as input an options object, returns an object whose
 * properties are getter-setter functions corresponding to
 * properties of the options object.
 *
 * See http://bost.ocks.org/mike/chart/ for a description 
 * of the setter-getter function pattern.
 *
 * In addition to this pattern, the functions emit change events.
 * To listen, use `theFunction.on('change', function (newValue) { ... });`
 */
define(['underscore', 'backbone'], function (_, Backbone) {
    "use strict";
    return function (options) {
        var my = {};
        _.each(_.keys(options), function (property) {
            var fn = function (value) {
                if (!arguments.length) {
                    return options[property];
                }
                options[property] = value;
                fn.trigger('change', value);
                return my;
            };
            _.extend(fn, Backbone.Events);
            my[property] = fn;
        });
        return my;
    };
});

{'fraction_non_alphanumeric': 0.1282879556991232, 'fraction_numerical': 0.0, 'mean_word_length': 2.403453689167975, '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': '3055764', 'n_tokens_mistral': 601, 'n_tokens_neox': 588, 'n_words': 182}