<commit_before># Default callbacks for internal storage of received packets
class CableNotifications.Store.DefaultCallbacks
  constructor: (@collections) ->

  # Callbacks
  ##################################################

  collection_remove: (packet, collection) ->
    console.warn 'Method not implemented: collection_remove '

  create: (packet, collection) ->
    fields = packet.data
    collection.insert(fields)

  update: (packet, collection) ->
    collection.update({id: packet.id}, packet.data)

  update_many: (packet, collection) ->
    _.each packet.data, (fields) ->
      collection.update({id: fields.id}, fields)

  upsert_many: (packet, collection) ->
    _.each packet.data, (fields) ->
      collection.upsert({id: fields.id}, fields)

  destroy: (packet, collection) ->
    collection.remove({id: packet.id})

  error: (packet, collection) ->
    console.error "[#{packet.cmd}]: #{packet.error}"<commit_msg>Fix default_callback wrong method names<commit_after># Default callbacks for internal storage of received packets
class CableNotifications.Store.DefaultCallbacks
  constructor: (@collections) ->

  # Callbacks
  ##################################################

  collection_remove: (packet, collection) ->
    console.warn 'Method not implemented: collection_remove '

  create: (packet, collection) ->
    fields = packet.data
    collection.create(fields)

  update: (packet, collection) ->
    collection.update({id: packet.id}, packet.data)

  update_many: (packet, collection) ->
    _.each packet.data, (fields) ->
      collection.update({id: fields.id}, fields)

  upsert_many: (packet, collection) ->
    _.each packet.data, (fields) ->
      collection.upsert({id: fields.id}, fields)

  destroy: (packet, collection) ->
    collection.destroy({id: packet.id})

  error: (packet, collection) ->
    console.error "[#{packet.cmd}]: #{packet.error}"
{'fraction_non_alphanumeric': 0.1838351822503962, 'fraction_numerical': 0.0, 'mean_word_length': 4.21763085399449, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '681195', 'n_tokens_mistral': 535, 'n_tokens_neox': 514, 'n_words': 129}