<commit_before>module.exports = function (Model) {

  Model.on('initialize', function (model) {

    Object.keys(Model.attrs).forEach(function (key) {
      var options = Model.attrs[key]

      if (Object.hasOwnProperty.call(options, 'value')) {
        return Object.defineProperty(model.attrs, key, {
          value: options.value,
          enumerable: true
        })
      }

      if (typeof options.get === 'function') {
        var descriptor = {}
        descriptor.get = options.get.bind(model)

        if (typeof options.set === 'function') {
          descriptor.set = options.set.bind(model)
        }
        return Object.defineProperty(model.attrs, key, descriptor)
      }
    })

  })

}<commit_msg>Allow enumerable to be specified<commit_after>module.exports = function (Model) {

  Model.on('initialize', function (model) {

    Object.keys(Model.attrs).forEach(function (key) {
      var options = Model.attrs[key]

      // enumerable defaults to false
      var enumerable = !!options.enumerable || false

      if (Object.hasOwnProperty.call(options, 'value')) {
        return Object.defineProperty(model.attrs, key, {
          value: options.value,
          enumerable: enumerable
        })
      }

      if (typeof options.get === 'function') {
        var descriptor = {}
        descriptor.enumerable = enumerable
        descriptor.get = options.get.bind(model)

        if (typeof options.set === 'function') {
          descriptor.set = options.set.bind(model)
        }
        return Object.defineProperty(model.attrs, key, descriptor)
      }
    })

  })

}
{'fraction_non_alphanumeric': 0.12875, 'fraction_numerical': 0.0, 'mean_word_length': 2.3634453781512605, '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': '6354055', 'n_tokens_mistral': 454, 'n_tokens_neox': 439, 'n_words': 92}