<commit_before>###
Bongo.js
Unfancy models for MongoDB

(c) 2011 Koding, Inc.

@class: bongo
@description: the main klass of the library.
@author: <NAME> <<EMAIL>>
###

{EventEmitter} = require 'events'

module.exports = class Bongo extends EventEmitter
  [READY, NOTREADY] = [0,1]
  # core
  url = require 'url'
  fs = require 'fs'
  nodePath = require 'path'
  # bongo = new EventEmitter
  # client-side boilerplate
  #@client = bongoClient = require 'bongo-client'
  # dnode           = require 'koding-dnode'
  # contrib
  @mongo          = require 'mongoskin'
  {extend}        = require 'underscore'
  @JsPath = JsPath = require 'jspath'
  @Inflector      = require 'inflector'
  # lib
  # the base klass of the library:
  @Base = Base    = require './base'
  # the model klass of the library:
  @Model = Model  = require './model'
  ModelRegistry   = require './modelregistry'
  @ModelCursor    = require './modelcursor'
  # the rest of the basics:
  @Subcollection  = require './subcollection'
  @ObjectId       = require './objectid'
  @ObjectRef      = require './objectref'
  @Validator      = require './validator'
  @Plugin         = require './plugin'
  @Register       = require './register'
  @util           = require './util'

  {daisy, @daisy, @dash, @sequence, @race, @future} = require 'sinkrow'

  {Scrubber, Store} = require 'koding-dnode-protocol'

  Traverse = require 'traverse'

  EXCHANGE_OPTIONS =
    autoDelete  : yes
    durable     : no
    type        :'topic'

  @secure =(fn)->
    fn.isSecurityEnabled = yes
    fn

  {@asynchronizeOwnMethods} = require './util'

  {BongoError}    = require './errortypes'

  Client = require './client'

  @throwIt = (it) ->
    console.error it  if it?
    process.kill process.pid, 'SIGTERM'

  constructor:(options)->
    {@mq, @mongo, @resourceName, @root, @fetchClient, models} = options
    @setClient @mongo
    @localStore = new Store
    @remoteStore = new Store
    @clients = {}
    @models = {}
    @stack = []
    @services = {}
    #@initBlacklist options.blacklist
    @loadModels models
    @on 'error', Bongo.throwIt
    @mq.on 'error', Bongo.throwIt
    @setMaxListeners 0
    @emit 'newInstance', this<commit_msg>bongo: fix broken bongo<commit_after>###
Bongo.js
Unfancy models for MongoDB

(c) 2011 Koding, Inc.

@class: bongo
@description: the main klass of the library.
@author: <NAME> <<EMAIL>>
###

{EventEmitter} = require 'events'

module.exports = class Bongo extends EventEmitter
  [READY, NOTREADY] = [0,1]
  # core
  url = require 'url'
  fs = require 'fs'
  nodePath = require 'path'
  # bongo = new EventEmitter
  # client-side boilerplate
  #@client = bongoClient = require 'bongo-client'
  # dnode           = require 'koding-dnode'
  # contrib
  @mongo          = require 'mongoskin'
  {extend}        = require 'underscore'
  @JsPath = JsPath = require 'jspath'
  @Inflector      = require 'inflector'
  # lib
  # the base klass of the library:
  @Base = Base    = require './base'
  # the model klass of the library:
  @Model = Model  = require './model'
  ModelRegistry   = require './modelregistry'
  @ModelCursor    = require './modelcursor'
  # the rest of the basics:
  @Subcollection  = require './subcollection'
  @ObjectId       = require './objectid'
  @ObjectRef      = require './objectref'
  @Validator      = require './validator'
  @Plugin         = require './plugin'
  @Register       = require './register'
  @util           = require './util'

  {daisy, @daisy, @dash, @sequence, @race, @future} = require 'sinkrow'

  {Scrubber, Store} = require 'koding-dnode-protocol'

  Traverse = require 'traverse'

  EXCHANGE_OPTIONS =
    autoDelete  : yes
    durable     : no
    type        :'topic'

  @secure =(fn)->
    fn.isSecurityEnabled = yes
    fn

  {@asynchronizeOwnMethods} = require './util'

  {BongoError}    = require './errortypes'

  Client = require './client'

  @throwIt = (it) ->
    console.error it  if it?
    process.kill process.pid, 'SIGTERM'

  constructor:(options)->
    {@mq, @mongo, @resourceName, @root, @fetchClient, models} = options
    @setClient @mongo
    @localStore = new Store
    @remoteStore = new Store
    @clients = {}
    @models = {}
    @stack = []
    @services = {}
    #@initBlacklist options.blacklist
    @loadModels models
    @on 'error', Bongo.throwIt
    @mq?.ready => @mq.connection?.on 'error', Bongo.throwIt
    @setMaxListeners 0
    @emit 'newInstance', this
{'fraction_non_alphanumeric': 0.13366336633663367, 'fraction_numerical': 0.0031503150315031502, 'mean_word_length': 2.7862010221465074, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 16, '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': '7475721', 'n_tokens_mistral': 1484, 'n_tokens_neox': 1461, 'n_words': 407}