<commit_before>import _ from 'lodash';
import { inherits } from 'util';
import { stub } from 'sinon';

class BaseModel {

  constructor(attributes, options) {

    this.set = stub();
    this.get = stub();
    this.fetch = stub();
    this.query = stub();
    this.load = stub();

    this.parse = stub();
    this.toJSON = stub();

  }

  static forge() {
    return new this();
  }

  static extend(protoProps, classProperties) {

    let ExtendedClass = class extends this {
      constructor() {

        super();

        _.each(protoProps, (protoProp, key) => {
          this[key] = protoProp;
        });
      }
    };

    _.each(classProperties, (classProp, key) => {<commit_msg>Added shim injection to allow attaching reponses to shims<commit_after>import _ from 'lodash';
import { inherits } from 'util';
import { stub } from 'sinon';

class BaseModel {

  constructor(attributes, options) {

    this.set = stub();
    this.get = stub();
    this.fetch = stub();
    this.query = stub();
    this.load = stub();

    this.parse = stub();
    this.toJSON = stub();

  }

  static forge() {
    return new this();
  }

  static extend(protoProps, classProperties) {

    let ExtendedClass = class extends this {
      constructor() {

        super();

        _.each(protoProps, (protoProp, key) => {
          this[key] = protoProp;
        });

        _.each(ExtendedClass.shims, (shim) => {

          shim.apply(this);

        });

        ExtendedClass.shims = [];

      }

      static registerShim(shim) {
        if (! this.shims) {
          this.shims = [ shim ];
        }
        else {
          this.shims.push(shim);
        }
      }
    };

    _.each(classProperties, (classProp, key) => {
{'fraction_non_alphanumeric': 0.1456761462565293, 'fraction_numerical': 0.0, 'mean_word_length': 2.145985401459854, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '5577425', 'n_tokens_mistral': 557, 'n_tokens_neox': 523, 'n_words': 124}