<commit_before>var methods = {};

methods.typeName = function() {
  return 'Astronomy';
};

methods.toJSONValue = function(args) {
  var json = {
    class: this.constructor.getName(),
    original: this._original,
    values: this._values
  };

  var event = new Astro.Event('tojsonvalue', json);
  event.target = this;
  Astro.eventManager.emit(event);

  return json;
};

ejsonOnInitModule = function() {
  EJSON.addType('Astronomy', function(json) {
    var Class = Astro.classes[json.class];
    var doc = new Class();
    doc._original = json.original;
    doc._values = json.values;

    var event = new Astro.Event('fromjsonvalue', json);
    event.target = doc;
    Astro.eventManager.emit(event);

    return doc;
  });

  _.extend(Astro.BaseClass.prototype, methods);
};<commit_msg>EJSON refactoring<commit_after>var methods = {
  typeName: function() {
    return 'Astronomy';
  },

  toJSONValue: function(args) {
    var json = {
      class: this.constructor.getName(),
      original: this._original,
      values: this._values
    };

    var event = new Astro.Event('tojsonvalue', json);
    event.target = this;
    Astro.eventManager.emit(event);

    return json;
  }
};

ejsonOnInitModule = function() {
  EJSON.addType('Astronomy', function(json) {
    var Class = Astro.classes[json.class];
    var doc = new Class();
    doc._original = json.original;
    doc._values = json.values;

    var event = new Astro.Event('fromjsonvalue', json);
    event.target = doc;
    Astro.eventManager.emit(event);

    return doc;
  });

  _.extend(Astro.BaseClass.prototype, methods);
};
{'fraction_non_alphanumeric': 0.14196372732958099, 'fraction_numerical': 0.0, 'mean_word_length': 3.324324324324324, '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': '6322724', 'n_tokens_mistral': 528, 'n_tokens_neox': 514, 'n_words': 107}