<commit_before>define(function () {
  'use strict';

  var TYPES = [ 'object', 'array', 'function', 'string', 'number', 'boolean', 'null', 'undefined' ];
  var SOLVERS;

  function getType(item) { return item === null ? 'null' : item instanceof Array ? 'array' : typeof item; }

  function mixin(target, source, onConflict, defaultOnConflict) {
    // Assign to the target's prototype if possible
    target = target.prototype || target;

    if (typeof onConflict === 'string') {
      defaultOnConflict = onConflict;
      onConflict = {};
    } else if (getType(onConflict) !== 'object') {
      throw 'onConflict must be either a string or an object';
    }

    defaultOnConflict = typeof defaultOnConflict === 'function' ?
        defaultOnConflict :
        SOLVERS[defaultOnConflict] || SOLVERS.crash;

    var solvers = {};
    TYPES.forEach(function (type) {
      var solver = onConflict[type];
      solvers[type] = typeof solver === 'function' ? solver : SOLVERS[solver] || defaultOnConflict;
    });

    for (var prop in source) {
      if (target.hasOwnProperty[prop]) {
        solvers[getType(target[prop])](target, source, prop, onConflict, defaultOnConflict);
      } else {
        target[prop] = source[prop];
      }
    }

    return target;
  }

  SOLVERS = {
    useTarget: function useTarget() {
      // Don't do nothin
    },
    useSource: function useSource(target, source, prop) {
      target[prop] = source[prop];
    },
    crash: function crash(target, source, prop) {<commit_msg>Mixin module fixes<commit_after>define(function () {
  'use strict';

  var TYPES = [ 'object', 'array', 'function', 'string', 'number', 'boolean', 'null', 'undefined' ];
  var SOLVERS;

  function getType(item) { return item === null ? 'null' : item instanceof Array ? 'array' : typeof item; }
  function getSolverFunction(val) { return getType(val) === 'function' ? val : SOLVERS[val]; }

  function mixin(target, source, onConflict, defaultOnConflict) {
    target = target.prototype || target;

    var isOnConflictObject = getType(onConflict) === 'object';
    defaultOnConflict = getSolverFunction(isOnConflictObject ? defaultOnConflict : onConflict) || SOLVERS.crash;
    isOnConflictObject || (onConflict = {});

    var solverFunctions = {};
    TYPES.forEach(function (type) {
      solverFunctions[type] = getSolverFunction(onConflict[type]) || defaultOnConflict;
    });

    for (var prop in source) {
      target.hasOwnProperty[prop] ?
          solverFunctions[getType(target[prop])](target, source, prop, onConflict, defaultOnConflict) :
          target[prop] = source[prop];
    }

    return target;
  }

  SOLVERS = {
    useTarget: function useTarget() {
      // Don't do nothin
    },
    useSource: function useSource(target, source, prop) {
      target[prop] = source[prop];
    },
    crash: function crash(target, source, prop) {
{'fraction_non_alphanumeric': 0.13778705636743216, 'fraction_numerical': 0.0, 'mean_word_length': 3.443585780525502, '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': '1956304', 'n_tokens_mistral': 902, 'n_tokens_neox': 839, 'n_words': 216}