<commit_before>
module.exports = Resource

function Resource (options) {
}

Resource.create = function (options, callback) {
}

Resource.get = function (id, callback) {
}

Resource.list = function (pageToken, callback) {
}

Resource.remove = function (id, callback) {
}

Resource.prototype.save = function (callback) {
}

Resource.prototype.remove = function (callback) {
  Resource.remove(this.id, callback)
  return this
}<commit_msg>Update resource.js<commit_after>module.exports = Resource

function Resource (options) {
  if (!(this instanceof Resource)) {
    return new Resource(options)
  }
  
  if ('object' == typeof options) {
    Object.keys(options).forEach(function (key) {
      this[key] = options[key]
    }, this)
  }
}

Resource.create = function (options, callback) {
  if ('undefined' == typeof callback && 'function' == typeof options) {
    callback = options
    options = {}
  }
  else if ('undefined' == typeof options) {
    options = {}
  }
  
  var resource = new Resource(options)
  
  if ('function' == typeof callback) {
    resource.save(callback)
  }
  
  return resource
}

Resource.get = function (id, callback) {
}

Resource.list = function (pageToken, callback) {
}

Resource.remove = function (id, callback) {
}

Resource.prototype.save = function (callback) {
}

Resource.prototype.remove = function (callback) {
  Resource.remove(this.id, callback)
  return this
}
{'fraction_non_alphanumeric': 0.13451957295373665, 'fraction_numerical': 0.0, 'mean_word_length': 3.8316151202749142, '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': '1724950', 'n_tokens_mistral': 425, 'n_tokens_neox': 423, 'n_words': 107}