<commit_before>ds.models.dashboard = function(data) {
  "use strict";

  var id
    , title
    , category
    , summary
    , description
    , creation_date
    , last_modified_date
    , imported_from
    , tags = []
    , definition
    , href
    , view_href
    , definition_href
    , item = {};

  if (data) {
    id = data.id;
    title = data.title;
    category = data.category;
    summary = data.summary;
    description = data.description;
    creation_date = data.creation_date;
    last_modified_date = data.last_modified_date;
    imported_from = data.imported_from;
    href = data.href;
    view_href = data.view_href;
    definition_href = data.definition_href;

    if (data.definition) {
      definition = ds.models.dashboard_definition(data.definition);
    }
    if (data.tags && data.tags.length) {
      tags = data.tags.map(function(t) {
               return ds.models.tag(t);
             });
    }
  }

  /**
   * Public read-only data properties.
   */

  Object.defineProperty(item, 'id', { value: id });
  Object.defineProperty(item, 'href', { value: href });
  Object.defineProperty(item, 'view_href', { value: view_href });
  Object.defineProperty(item, 'definition_href', { value: definition_href });
  Object.defineProperty(item, 'creation_date', { value: creation_date });
  Object.defineProperty(item, 'last_modified_date', { value: last_modified_date });

  /**
   * Operations
   */

  item.render_templates = function(context) {
    description = ds.render_template(description, context);
    title       = ds.render_template(title, context);
    summary     = ds.render_template(summary, context);
    if (definition) {
      definition.render_templates(context);
    }
    return item;
  }

  item.visit = function(visitor) {
    visitor(item);
    if (definition) {
      definition.visit(visitor);
    }
    return item;
  }

  /**
   * Data accessors.
   */

  item.title = function(_) {
    if (!arguments.length) return title;
    title = _;
    return item;
  }

  item.category = function(_) {
    if (!arguments.length) return category;
    category = _;
    return item;
  }

  item.summary = function(_) {
    if (!arguments.length) return summary;
    summary = _;
    return item;
  }

  item.description = function(_) {
    if (!arguments.length) return description;
    description = _;
    return item;
  }

  item.imported_from = function(_) {
    if (!arguments.length) return imported_from;
    imported_from = _;
    return item;
  }

  item.tags = function(_) {
    if (!arguments.length) return tags;
    tags = _;
    return item;
  }

  item.definition = function(_) {
    if (!arguments.length) return definition;
    definition = _;
    return item;
  }

  item.toJSON = function() {
    return {<commit_msg>Test out property usage on dashboard model<commit_after>ds.models.dashboard = function(data) {
  "use strict";

  var id
    , title
    , category
    , summary
    , description
    , creation_date
    , last_modified_date
    , imported_from
    , tags = []
    , definition
    , href
    , view_href
    , definition_href
    , item = {};

  if (data) {
    id = data.id;
    title = data.title;
    category = data.category;
    summary = data.summary;
    description = data.description;
    creation_date = data.creation_date;
    last_modified_date = data.last_modified_date;
    imported_from = data.imported_from;
    href = data.href;
    view_href = data.view_href;
    definition_href = data.definition_href;

    if (data.definition) {
      definition = ds.models.dashboard_definition(data.definition);
    }
    if (data.tags && data.tags.length) {
      tags = data.tags.map(function(t) {
               return ds.models.tag(t);
             });
    }
  }

  /**
   * Public read-only data properties.
   */

  Object.defineProperty(item, 'id', { value: id });
  Object.defineProperty(item, 'href', { value: href });
  Object.defineProperty(item, 'view_href', { value: view_href });
  Object.defineProperty(item, 'definition_href', { value: definition_href });
  Object.defineProperty(item, 'creation_date', { value: creation_date });
  Object.defineProperty(item, 'last_modified_date', { value: last_modified_date });

  Object.defineProperty(item, 'title', {get: function() { return title; }});
  Object.defineProperty(item, 'category', {get: function() { return category; }});
  Object.defineProperty(item, 'summary', {get: function() { return summary; }});
  Object.defineProperty(item, 'description', {get: function() { return description; }});
  Object.defineProperty(item, 'imported_from', {get: function() { return imported_from; }});
  Object.defineProperty(item, 'tags', {get: function() { return tags; }});
  Object.defineProperty(item, 'definition', {get: function() { return definition; }});

  /**
   * Operations
   */

  item.render_templates = function(context) {
    description = ds.render_template(description, context);
    title       = ds.render_template(title, context);
    summary     = ds.render_template(summary, context);
    if (definition) {
      definition.render_templates(context);
    }
    return item;
  }

  item.visit = function(visitor) {
    visitor(item);
    if (definition) {
      definition.visit(visitor);
    }
    return item;
  }

  /**
   * Data accessors.
   */

  item.set_title = function(_) {
    title = _;
    return item;
  }

  item.set_category = function(_) {
    category = _;
    return item;
  }

  item.set_summary = function(_) {
    summary = _;
    return item;
  }

  item.set_description = function(_) {
    description = _;
    return item;
  }

  item.set_imported_from = function(_) {
    imported_from = _;
    return item;
  }

  item.set_tags = function(_) {
    tags = _;
    return item;
  }

  item.add_tag = function(_) {
    tags.push(_);
    return item;
  }

  item.set_definition = function(_) {
    definition = _;
    return item;
  }

  item.toJSON = function() {
    return {
{'fraction_non_alphanumeric': 0.13120805369127517, 'fraction_numerical': 0.0, 'mean_word_length': 2.863253402462735, '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': '5539746', 'n_tokens_mistral': 1880, 'n_tokens_neox': 1848, 'n_words': 375}