<commit_before>import co from 'co';
import { extend, merge } from 'extend-merge';
import { Model, Collector } from 'chaos-orm';

/**
 * The Query wrapper.
 */
class Query {

  /**
   * Gets/sets classes dependencies.
   *
   * @param  Object classes The classes dependencies to set or none to get it.
   * @return mixed          The classes dependencies.
   */
  static classes(classes) {
    if (arguments.length) {
      this._classes = extend({}, this._classes, classes);
    }
    return this._classes;
  }

  /**
   * Creates a new record object with default values.
   *
   * @param array config Possible options are:
   *                      - `'model'`  _Function_ : A model class.
   *                      - `'schema'` _Object_   : Alternatively a schema instance can be provided instead of the model.
   *                      - `'query'`  _Object_   : The query.
   */
  constructor(config) {
    var defaults = {
      model: undefined,
      schema: undefined,
      query: {}
    };
    config = extend({}, defaults, config);

    if (config.model) {
      this._model = config.model;
      this._schema = this._model.definition();
    } else {
      this._schema = config.schema;
    }

    /**
     * The connection to the datasource.
     *
     * @var Function
     */
    this._connection = config.connection;

    /**
     * Count the number of identical aliases in a query for building unique aliases.
     *
     * @var Object
     */
    this._aliasCounter = {};

    /**
     * Map beetween relation pathsand corresponding aliases.
     *
     * @var Object
     */
    this._aliases = {};

    /**
     * Map beetween generated aliases and corresponding schema.
     *
     * @var Object
     */
    this._schemas = {};<commit_msg>Fix typo.<commit_after>import co from 'co';
import { extend, merge } from 'extend-merge';
import { Model, Collector } from 'chaos-orm';

/**
 * The Query wrapper.
 */
class Query {

  /**
   * Gets/sets classes dependencies.
   *
   * @param  Object classes The classes dependencies to set or none to get it.
   * @return mixed          The classes dependencies.
   */
  static classes(classes) {
    if (arguments.length) {
      this._classes = extend({}, this._classes, classes);
    }
    return this._classes;
  }

  /**
   * Creates a new record object with default values.
   *
   * @param array config Possible options are:
   *                      - `'model'`  _Function_ : A model class.
   *                      - `'schema'` _Object_   : Alternatively a schema instance can be provided instead of the model.
   *                      - `'query'`  _Object_   : The query.
   */
  constructor(config) {
    var defaults = {
      model: undefined,
      schema: undefined,
      query: {}
    };
    config = extend({}, defaults, config);

    if (config.model) {
      this._model = config.model;
      this._schema = this._model.definition();
    } else {
      this._schema = config.schema;
    }

    /**
     * Count the number of identical aliases in a query for building unique aliases.
     *
     * @var Object
     */
    this._aliasCounter = {};

    /**
     * Map beetween relation pathsand corresponding aliases.
     *
     * @var Object
     */
    this._aliases = {};

    /**
     * Map beetween generated aliases and corresponding schema.
     *
     * @var Object
     */
    this._schemas = {};
{'fraction_non_alphanumeric': 0.11554373522458629, 'fraction_numerical': 0.0, 'mean_word_length': 1.9486062717770034, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6290478', 'n_tokens_mistral': 974, 'n_tokens_neox': 943, 'n_words': 294}