<commit_before>/*
==================================================================================================
  Core - JavaScript Foundation
  Copyright 2012-2013 <NAME>
==================================================================================================
*/

(function() 
{
  var globalId = 0;

  /**
   * Models are the heart of any JavaScript application, 
   * containing the interactive data as well as a large 
   * part of the logic surrounding it: conversions, validations, 
   * computed properties, and access control. You extend `core.mvc.Model`
   * with your domain-specific methods, and `Model` provides a basic 
   * set of functionality for managing changes.
   */
  core.Class("core.mvc.Model", 
  {
    include: [core.property.MGeneric, core.event.MEvent],
    implement : [core.mvc.IModel],

    /**
     * Initial data structure is imported from @values {Map}.
     */
    construct: function(values) 
    {
      if (jasy.Env.isSet("debug")) 
      {
        if (values != null) {
          core.Assert.isType(values, "Map", "Invalid values to import!");
        }
      }

      if (values != null) {
        this.set(values);
      }

      this.id = "model:" + (globalId++);
    },

    events :
    {
      /** Fired whenever the model is changed in a way that is interesting for listeners */
      "change" : core.event.Notification
    },

    members: 
    {
      // Interface implementation
      getId : function() {
        return this.id;
      },

      // Interface implementation
      toJSON : function() {
        return this.get(Object.keys(core.Class.getProperties(this.constructor)));
      }
    }
  });
})();<commit_msg>Preliminary error() impl.<commit_after>/*
==================================================================================================
  Core - JavaScript Foundation
  Copyright 2012-2013 <NAME>
==================================================================================================
*/

(function() 
{
  var globalId = 0;

  /**
   * Models are the heart of any JavaScript application, 
   * containing the interactive data as well as a large 
   * part of the logic surrounding it: conversions, validations, 
   * computed properties, and access control. You extend `core.mvc.Model`
   * with your domain-specific methods, and `Model` provides a basic 
   * set of functionality for managing changes.
   */
  core.Class("core.mvc.Model", 
  {
    include: [core.property.MGeneric, core.event.MEvent],
    implement : [core.mvc.IModel],

    /**
     * Initial data structure is imported from @values {Map}.
     */
    construct: function(values) 
    {
      if (jasy.Env.isSet("debug")) 
      {
        if (values != null) {
          core.Assert.isType(values, "Map", "Invalid values to import!");
        }
      }

      if (values != null) {
        this.set(values);
      }

      this.id = "model:" + (globalId++);
    },

    events :
    {
      /** Fired whenever the model is changed in a way that is interesting for listeners */
      "change" : core.event.Notification
    },

    members: 
    {
      error : function(message) {
        console.error("Model Error: " + message);
      },

      // Interface implementation
      getId : function() {
        return this.id;
      },

      // Interface implementation
      toJSON : function() {
        return this.get(Object.keys(core.Class.getProperties(this.constructor)));
      }
    }
  });
})();
{'fraction_non_alphanumeric': 0.22436635944700462, 'fraction_numerical': 0.005184331797235023, 'mean_word_length': 2.648109243697479, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4097921', 'n_tokens_mistral': 957, 'n_tokens_neox': 883, 'n_words': 253}