<commit_before>root = exports ? this

# Enumerable
# ==========
# 
class Enumerable

  constructor : ->
    @values = _.toArray(arguments)
    @events = {}

    # Underscore.js is required
    if (_? && typeof _ == "function") == false
      throw new Error "Underscore.js is required"

  set : (value) ->
    @values.push value
    @trigger 'set', value
 
  get : (index) ->
    val = @values[index] if @values[index]?
    if val? then @trigger 'get', val
 
  pop : ->
    @values.pop()
    @trigger 'pop'

  each : (fn, context) ->
    _.each(@values, (v) =>
      @trigger 'each', v
      fn(v)
    , context)

  map : (fn, context) ->
    @trigger 'map', _.map @values, fn, context
 
  forEach : (fn, context) ->
    @each fn, context<commit_msg>Can now remove a specific value<commit_after>root = exports ? this

# Enumerable
# ==========
# 
class Enumerable

  constructor : ->
    @values = _.toArray(arguments)
    @events = {}

    # Underscore.js is required
    if (_? && typeof _ == "function") == false
      throw new Error "Underscore.js is required"

  set : (value) ->
    @values.push value
    @trigger 'set', value
 
  get : (index) ->
    val = @values[index] if @values[index]?
    if val? then @trigger 'get', val

  remove : (value) ->
    index = _.indexOf @values, value
    @trigger('remove', false) if index == -1
    val = @values[index]
    values = @values.slice(0, index).concat(_.rest(@values, index + 1))
    @values = values
    @trigger 'remove', val

  pop : ->
    @values.pop()
    @trigger 'pop'

  each : (fn, context) ->
    _.each(@values, (v) =>
      @trigger 'each', v
      fn(v)
    , context)

  map : (fn, context) ->
    @trigger 'map', _.map @values, fn, context
 
  forEach : (fn, context) ->
    @each fn, context
{'fraction_non_alphanumeric': 0.17034521788341822, 'fraction_numerical': 0.001697792869269949, 'mean_word_length': 2.514910536779324, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 20, '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': '2467320', 'n_tokens_mistral': 614, 'n_tokens_neox': 582, 'n_words': 169}