<commit_before>var _ = require('./utils/mindash');
var warnings = require('./warnings');
var constants = require('./constants');
var StateMixin = require('./stateMixin');
var STORE_CHANGED_EVENT = 'store-changed';
var createStoreClass = require('./store/createStoreClass');
var createQueriesClass = require('./queries/createQueriesClass');
var createStateSourceClass = require('./stateSource/createStateSourceClass');
var createActionCreatorsClass = require('./actionCreators/createActionCreatorsClass');
var DEFAULT_CLASS_NAME = 'Class';

module.exports = {
  register: register,
  createStore: createStore,
  createQueries: createQueries,
  createContext: createContext,
  createConstants: createConstants,
  createStateMixin: createStateMixin,
  createStateSource: createStateSource,
  createActionCreators: createActionCreators
};

function register(id, clazz) {
  if (!_.isString(id)) {
    clazz = id;
    id = null;
  }

  var className = getClassName(clazz);

  if (!clazz.id) {
    clazz.id = id || className;
  }

  if (!clazz.displayName) {
    clazz.displayName = clazz.id;
  }

  return this.container.register(clazz);
}

function createContext(req) {
  return this.container.createContext(req);
}

function createStore(properties) {
  var StoreClass = createStoreClass(properties);
  var defaultInstance = this.register(StoreClass);


  return defaultInstance;
}

function getClassName(clazz) {
  var funcNameRegex = /function (.{1,})\(/;
  var results = (funcNameRegex).exec(clazz.toString());
  var className = (results && results.length > 1) ? results[1] : '';

  return className === DEFAULT_CLASS_NAME ? null : className;
}

function onStoreChanged() {
  var events = this.__events;
  var args = _.toArray(arguments);

  args.unshift(STORE_CHANGED_EVENT);
  events.emit.apply(events, args);
}

function createConstants(obj) {
  return constants(obj);
}

function createStateMixin(options) {
  return new StateMixin(options);
}

function createActionCreators(properties) {
  var ActionCreatorsClass = createActionCreatorsClass(properties);
  var defaultInstance = this.register(ActionCreatorsClass);

  return defaultInstance;
}<commit_msg>:green_heart:<commit_after>var _ = require('./utils/mindash');
var constants = require('./constants');
var StateMixin = require('./stateMixin');
var createStoreClass = require('./store/createStoreClass');
var createQueriesClass = require('./queries/createQueriesClass');
var createStateSourceClass = require('./stateSource/createStateSourceClass');
var createActionCreatorsClass = require('./actionCreators/createActionCreatorsClass');
var DEFAULT_CLASS_NAME = 'Class';

module.exports = {
  register: register,
  createStore: createStore,
  createQueries: createQueries,
  createContext: createContext,
  createConstants: createConstants,
  createStateMixin: createStateMixin,
  createStateSource: createStateSource,
  createActionCreators: createActionCreators
};

function register(id, clazz) {
  if (!_.isString(id)) {
    clazz = id;
    id = null;
  }

  var className = getClassName(clazz);

  if (!clazz.id) {
    clazz.id = id || className;
  }

  if (!clazz.displayName) {
    clazz.displayName = clazz.id;
  }

  return this.container.register(clazz);
}

function createContext(req) {
  return this.container.createContext(req);
}

function createStore(properties) {
  var StoreClass = createStoreClass(properties);
  var defaultInstance = this.register(StoreClass);


  return defaultInstance;
}

function getClassName(clazz) {
  var funcNameRegex = /function (.{1,})\(/;
  var results = (funcNameRegex).exec(clazz.toString());
  var className = (results && results.length > 1) ? results[1] : '';

  return className === DEFAULT_CLASS_NAME ? null : className;
}

function createConstants(obj) {
  return constants(obj);
}

function createStateMixin(options) {
  return new StateMixin(options);
}

function createActionCreators(properties) {
  var ActionCreatorsClass = createActionCreatorsClass(properties);
  var defaultInstance = this.register(ActionCreatorsClass);

  return defaultInstance;
}
{'fraction_non_alphanumeric': 0.12321692080668963, 'fraction_numerical': 0.0014756517461878996, 'mean_word_length': 5.394654088050315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5060269', 'n_tokens_mistral': 1209, 'n_tokens_neox': 1187, 'n_words': 249}