<commit_before>PublishSubscribe = require './modules/pubSub.coffee'

class Base
  @include = (args...) ->
    _prototype = @prototype
    args.forEach (module) ->
      if module.constructor != Object
        throw new Error('Arguments not an object or an array of objects')
      for prop of module
        _prototype[prop] = module[prop] unless prop == 'moduleName'
      afterInclude = _prototype.afterInclude
      afterInclude(module) if afterInclude

  afterInclude: (module) ->
    if !module.moduleName
      throw new Error('Module defined without a name')
    @includedModules = [] if !@includedModules
    @includedModules.push(module.moduleName)

  @include PublishSubscribe

module.exports = Base
<commit_msg>Added extend to add class methods<commit_after>PublishSubscribe = require './modules/pubSub.coffee'

class Base
  @extend = (args...) ->
    _class = this
    args.forEach (module) ->
      if module.constructor != Object
        throw new Error('Arguments not an object or an array of objects')
      for prop of module
        _class[prop] = module[prop] unless prop == 'moduleName'
      afterExtend = _klass.afterExtend
      afterExtend(module) if afterExtend

  afterExtend: (module) ->
    if !module.moduleName
      throw new Error('Module defined without a name')
    @extendedModules = [] if !@extendedModules
    @extendedModules.push(module.moduleName)

  @include = (args...) ->
    _class = this
    args.forEach (module) ->
      if module.constructor != Object
        throw new Error('Arguments not an object or an array of objects')
      for prop of module
        _class.prototype[prop] = module[prop] unless prop == 'moduleName'
      afterInclude = _class.afterInclude
      afterInclude(module) if afterInclude

  afterInclude: (module) ->
    if !module.moduleName
      throw new Error('Module defined without a name')
    @includedModules = [] if !@includedModules
    @includedModules.push(module.moduleName)

  @extend PublishSubscribe

module.exports = Base

{'fraction_non_alphanumeric': 0.09900497512437811, 'fraction_numerical': 0.0, 'mean_word_length': 3.198329853862213, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '1752191', 'n_tokens_mistral': 556, 'n_tokens_neox': 546, 'n_words': 170}