<commit_before>import { EventEmitter } from 'events';
import _ from 'lodash';
import couchbase from 'couchbase';
import Driver from 'couchbase-driver';

import * as utils from './utils';
import Schema from './schema';
import Document from './document';
import CouchbaseDocument from './cbdocument';
import { compile, Model } from './model';

const debug = require('debug')('lounge');

const schemaConfigOptions = utils.schemaConfigOptionKeys;

export default class Lounge extends EventEmitter {
  /**
   * @classdesc The Lounge module
   * The exports object of the <code>lounge</code> module is an instance of this class.
   * Most apps will only use this one instance. We copy all Couchbase <code>Bucket</code> methods and properties
   * so you can call them generically from this instance as well.
   *
   * @description The Lounge constructor
   * @class
   * @augments Bucket
   * @param {Object} options
   * @param {String} options.keyPrefix - key prefix for all keys. No default. Generally useful if you wish to namespace documents. Example: <code>app::env::</code>.
   * @param {String} options.keySuffix - Similar as prefix but used as a suffix
   * @param {Boolean} options.storeFullReferenceId - whether to store embedded document keys as fully expanded keys (with prefix and suffix applied)
   * or just the minimized version. default: <code>false</code>
   * @param {Boolean} options.storeFullKey - Similarly to store the fully expanded document key inside the key property. default: <code>false</code>
   * @param {Boolean} options.alwaysReturnArrays - set to true to force <code>findyById</code> to always return an array of documents even if only a single key is passed in
   * @param {String} options.refIndexKeyPrefix - reference lookup index document key prefix. The name of the index is appended. default: <code>$_ref_by_</code>
   * @param {String} options.delimiter - delimiter string used for concatenation in reference document key expansion / generation. default: <code>'_'</code>. This is prepended to the reference document key.
   * @param {Boolean} options.waitForIndex - When documents are saved, indexes are updated. We can wait for this operation to finish before
   * returning from <code>save()</code>. Default: <code>false</code>
   * @param {Boolean} options.minimize - "minimize" schemas by removing empty objects. Default: <code>true</code>
   * @param {Boolean} options.missing By default the <code>findById</code> and index query functions return 3 parameters to the callback:
   *                                  <code>(err, docs, missing)</code>. If this option is set to <code>false</code> we won't return
   *                                  missing keys as the final param in the callback. Default: <code>true</code>.
   * @param {Number} options.atomicRetryTimes - The number of attempts to make within <code>Driver.atomic()</code>.
   *                                             	 See <code>async.retry</code>. Default: <code>5</code>.
   * @param {Number} options.atomicRetryInterval - The time to wait between retries, in milliseconds, within <code>Driver.atomic()</code>.
   *                                             	 See <code>async.retry</code>. Default: <code>0</code>.
   * @param {Boolean} options.atomicLock - Whether to use <code>getAndLock</code> or standard <code>get</code> during atomic
   *                                       operations within indexing. Default: <code>true</code>.
   *
   * @returns {Lounge}
   */
  constructor(options = {}) {
    super();
    this.models = {};
    this.bucket = null;
    this.db = null;
    this.config = _.defaults(options || {}, utils.defaultOptions);
  }<commit_msg>update documentation<commit_after>import { EventEmitter } from 'events';
import _ from 'lodash';
import couchbase from 'couchbase';
import Driver from 'couchbase-driver';

import * as utils from './utils';
import Schema from './schema';
import Document from './document';
import CouchbaseDocument from './cbdocument';
import { compile, Model } from './model';

const debug = require('debug')('lounge');

const schemaConfigOptions = utils.schemaConfigOptionKeys;

export default class Lounge extends EventEmitter {
  /**
   * @classdesc The Lounge module
   * The exports object of the <code>lounge</code> module is an instance of this class.
   * Most apps will only use this one instance. We copy all Couchbase <code>Bucket</code> methods and properties
   * so you can call them generically from this instance as well.
   *
   * @description The Lounge constructor
   * @class
   * @augments Bucket
   * @param {Object} options
   * @param {String} options.keyPrefix - key prefix for all keys. No default. Generally useful if you wish to namespace documents. Example: <code>app::env::</code>.
   * @param {String} options.keySuffix - Similar as prefix but used as a suffix
   * @param {Boolean} options.storeFullReferenceId - whether to store embedded document keys as fully expanded keys (with prefix and suffix applied)
   * or just the minimized version. default: <code>false</code>
   * @param {Boolean} options.storeFullKey - Similarly to store the fully expanded document key inside the key property. default: <code>false</code>
   * @param {Boolean} options.alwaysReturnArrays - set to true to force <code>findyById</code> to always return an array of documents even if only a single key is passed in
   * @param {String} options.refIndexKeyPrefix - reference lookup index document key prefix. The name of the index is appended. default: <code>$_ref_by_</code>
   * @param {String} options.delimiter - delimiter string used for concatenation in reference document key expansion / generation. default: <code>'_'</code>. This is prepended to the reference document key.
   * @param {Boolean} options.waitForIndex - When documents are saved, indexes are updated. We can wait for this operation to finish before
   * returning from <code>save()</code>. Default: <code>false</code>
   * @param {Boolean} options.minimize - "minimize" schemas by removing empty objects. Default: <code>true</code>
   * @param {Boolean} options.missing By default the <code>findById</code> and index query functions return 3 parameters to the callback:
   *                                  <code>(err, docs, missing)</code>. If this option is set to <code>false</code> we won't return
   *                                  missing keys as the final param in the callback. Default: <code>true</code>.
   * @param {Number} options.atomicRetryTimes - The number of attempts to make within <code>Driver.atomic()</code>. Default: <code>5</code>.
   *                                            See {@link https://github.com/bojand/couchbase-driver}
   * @param {Number} options.atomicRetryInterval - The time to wait between retries, in milliseconds, within <code>Driver.atomic()</code>.
   *                                               Default: <code>0</code>. See {@link https://github.com/bojand/couchbase-driver}
   * @param {Boolean} options.atomicLock - Whether to use <code>getAndLock</code> or standard <code>get</code> during atomic
   *                                       operations within indexing. Default: <code>true</code>.
   *                                       See {@link https://github.com/bojand/couchbase-driver}
   *
   * @returns {Lounge}
   */
  constructor(options = {}) {
    super();
    this.models = {};
    this.bucket = null;
    this.db = null;
    this.config = _.defaults(options || {}, utils.defaultOptions);
  }
{'fraction_non_alphanumeric': 0.10707635009310987, 'fraction_numerical': 0.0007980845969672786, 'mean_word_length': 3.18652561247216, 'pattern_counts': {'":': 0, '<': 95, '<?xml version=': 0, '>': 95, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '709495', 'n_tokens_mistral': 1969, 'n_tokens_neox': 1944, 'n_words': 766}