<commit_before>/**
 * @fileOverview The util method based on the lodash.
 * @author <EMAIL>
 * @see https://github.com/lodash/lodash
 */

function _mix(dist, obj) {
  for (const k in obj) {
    if (obj.hasOwnProperty(k) && k !== 'constructor' && obj[k] !== undefined) {
      dist[k] = obj[k];
    }
  }
}

const PRECISION = 0.00001; // 常量，据的精度，小于这个精度认为是0

const Util = {
  each: require('lodash/each'),
  isNull: require('lodash/isNull'),
  isObject: require('lodash/isObject'),
  isNumber: require('lodash/isNumber'),
  isString: require('lodash/isString'),
  isFunction: require('lodash/isFunction'),
  isBoolean: require('lodash/isBoolean'),
  isEmpty: require('lodash/isEmpty'),
  lowerFirst: require('lodash/lowerFirst'),
  upperFirst: require('lodash/upperFirst'),
  isNil: require('lodash/isNil'),
  isArray: require('lodash/isArray'),
  isDate: require('lodash/isDate'),
  toArray: require('lodash/toArray'),
  template: require('lodash/template'),
  indexOf: require('lodash/indexOf'),
  assign: require('lodash/assign'),
  groupBy: require('lodash/groupBy'),
  cloneDeep: require('lodash/cloneDeep'),
  maxBy: require('lodash/maxBy'),
  has: require('lodash/has'),
  round: require('lodash/round'),
  merge: require('lodash/merge'),
  filter: require('lodash/filter'),
  fixedBase(v, base) {
    const str = base.toString();
    const index = str.indexOf('.');
    if (index === -1) {
      return Math.round(v);
    }
    let length = str.substr(index + 1).length;
    if (length > 20) {
      length = 20;
    }
    return parseFloat(v.toFixed(length));
  },
  mix(dist, obj1, obj2, obj3) {
    if (obj1) {
      _mix(dist, obj1);
    }

    if (obj2) {
      _mix(dist, obj2);
    }

    if (obj3) {
      _mix(dist, obj3);
    }
    return dist;
  },<commit_msg>添加 util 方法<commit_after>/**
 * @fileOverview The util method based on the lodash.
 * @author <EMAIL>
 * @see https://github.com/lodash/lodash
 */

function _mix(dist, obj) {
  for (const k in obj) {
    if (obj.hasOwnProperty(k) && k !== 'constructor' && obj[k] !== undefined) {
      dist[k] = obj[k];
    }
  }
}

const PRECISION = 0.00001; // 常量，据的精度，小于这个精度认为是0

const Util = {
  each: require('lodash/each'),
  isNull: require('lodash/isNull'),
  isObject: require('lodash/isObject'),
  isNumber: require('lodash/isNumber'),
  isString: require('lodash/isString'),
  isFunction: require('lodash/isFunction'),
  isBoolean: require('lodash/isBoolean'),
  isEmpty: require('lodash/isEmpty'),
  lowerFirst: require('lodash/lowerFirst'),
  upperFirst: require('lodash/upperFirst'),
  isNil: require('lodash/isNil'),
  isArray: require('lodash/isArray'),
  isDate: require('lodash/isDate'),
  toArray: require('lodash/toArray'),
  template: require('lodash/template'),
  indexOf: require('lodash/indexOf'),
  assign: require('lodash/assign'),
  groupBy: require('lodash/groupBy'),
  cloneDeep: require('lodash/cloneDeep'),
  maxBy: require('lodash/maxBy'),
  has: require('lodash/has'),
  round: require('lodash/round'),
  merge: require('lodash/merge'),
  filter: require('lodash/filter'),
  defaultsDeep: require('lodash/defaultsDeep'),
  fixedBase(v, base) {
    const str = base.toString();
    const index = str.indexOf('.');
    if (index === -1) {
      return Math.round(v);
    }
    let length = str.substr(index + 1).length;
    if (length > 20) {
      length = 20;
    }
    return parseFloat(v.toFixed(length));
  },
  mix(dist, obj1, obj2, obj3) {
    if (obj1) {
      _mix(dist, obj1);
    }

    if (obj2) {
      _mix(dist, obj2);
    }

    if (obj3) {
      _mix(dist, obj3);
    }
    return dist;
  },
{'fraction_non_alphanumeric': 0.17977215893303697, 'fraction_numerical': 0.012225618227285358, 'mean_word_length': 3.675324675324675, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '1486448', 'n_tokens_mistral': 1366, 'n_tokens_neox': 1292, 'n_words': 254}