<commit_before>addEvent = (el, type, handler) ->
  el.addEventListener(type, handler)

removeEvent = (el, type, handler) ->
  el.removeEventListener(type, handler)

class Context
  constructor: (@_listener) ->
    @_default = null
    @_map = {}

  activate: ->
    @_listener.activate(this)

  default: (callback) ->
    @_default = callback

  help: ->
    help = {}
    for own key, [_, desc] of @_map
      help[key] = desc
    help

  resolve: (combo) ->
    @_map[combo]?[0] or @_default

  map: (combo, helpText, callback) ->
    if not callback
      callback = helpText
      helpText = null
    fn = => callback.apply(@_listener, arguments)
    @_map[combo] = [fn, helpText]
    this

  unmap: (combo) ->
    delete @_map[combo]
    this

class @Listnr<commit_msg>Formatting / whitespace<commit_after>addEvent = (el, type, handler) ->
  el.addEventListener(type, handler)


removeEvent = (el, type, handler) ->
  el.removeEventListener(type, handler)


class Context
  constructor: (@_listener) ->
    @_default = null
    @_map = {}

  activate: ->
    @_listener.activate(this)

  default: (callback) ->
    @_default = callback

  help: ->
    help = {}
    for own key, [_, desc] of @_map
      help[key] = desc
    help

  resolve: (combo) ->
    @_map[combo]?[0] or @_default

  map: (combo, helpText, callback) ->
    if not callback
      callback = helpText
      helpText = null
    fn = => callback.apply(@_listener, arguments)
    @_map[combo] = [fn, helpText]
    this

  unmap: (combo) ->
    delete @_map[combo]
    this


class @Listnr
{'fraction_non_alphanumeric': 0.14157591287636132, 'fraction_numerical': 0.0012812299807815502, 'mean_word_length': 2.7820823244552058, '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': '6391744', 'n_tokens_mistral': 548, 'n_tokens_neox': 532, 'n_words': 132}