<commit_before>#
# General collection for a group of Blocks
#

Collection = require("chaplin").Collection
sd = require("sharify").data
Model = require("../models/base.coffee")

module.exports = class Blocks extends Collection

  model:Model<commit_msg>base collection<commit_after>#
# General collection for a group of Blocks
#

Collection = require("chaplin").Collection
sd = require("sharify").data
_ = require 'underscore'
Model = require("../models/base.coffee")
ModelLib = require '../lib/model_lib.coffee'

module.exports = class Blocks extends Collection

  model:Model

  _.extend @prototype, ModelLib

  initialize: (models, options={})->
    @setOptions(options)
    super

  next: (model) ->
    @at((@indexOf(model) + 1) % _.size(@models))

  prev: (model) ->
    index = @indexOf(model) - 1
    @at(if index > -1 then index else _.size(@models) - 1)

  last: ->
    @at @length - 1

  isEmpty: ->
    @models.length is 0
{'fraction_non_alphanumeric': 0.14790996784565916, 'fraction_numerical': 0.006430868167202572, 'mean_word_length': 3.7897435897435896, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '1168727', 'n_tokens_mistral': 307, 'n_tokens_neox': 290, 'n_words': 79}