<commit_before>/* @flow */

// eslint-disable-next-line import/prefer-default-export
export const dump = (obj: any) => {
  log('#####################################################################################');
  log(`## Dumping object ${obj}`);
  log(`## obj class is: ${obj.className()}`);
  log('#####################################################################################');
  log('obj.properties:');
  log(obj.class().mocha().properties());
  log('obj.propertiesWithAncestors:');
  log(obj.class().mocha().propertiesWithAncestors());
  log('obj.classMethods:');
  log(obj.class().mocha().classMethods());
  log('obj.classMethodsWithAncestors:');
  log(obj.class().mocha().classMethodsWithAncestors());
  log('obj.instanceMethods:');
  log(obj.class().mocha().instanceMethods());
  log('obj.instanceMethodsWithAncestors:');
  log(obj.class().mocha().instanceMethodsWithAncestors());
  log('obj.protocols:');
  log(obj.class().mocha().protocols());
  log('obj.protocolsWithAncestors:');
  log(obj.class().mocha().protocolsWithAncestors());
  log('obj.treeAsDictionary():');
  log(obj.treeAsDictionary());
  return obj;
};

export const timeFunction = (fn: () => any, label: string) => {
  const methodStart = NSDate.date();
  if (showStart) {
    log(`${label} start`);
  }
  const res = fn();

  const methodFinish = NSDate.date();
  const executionTime = methodFinish.timeIntervalSinceDate(methodStart);

  log(`${label}: ${executionTime.toFixed(3)}`);

  return res;
};<commit_msg>remove unused code in timeFunction<commit_after>/* @flow */

// eslint-disable-next-line import/prefer-default-export
export const dump = (obj: any) => {
  log('#####################################################################################');
  log(`## Dumping object ${obj}`);
  log(`## obj class is: ${obj.className()}`);
  log('#####################################################################################');
  log('obj.properties:');
  log(obj.class().mocha().properties());
  log('obj.propertiesWithAncestors:');
  log(obj.class().mocha().propertiesWithAncestors());
  log('obj.classMethods:');
  log(obj.class().mocha().classMethods());
  log('obj.classMethodsWithAncestors:');
  log(obj.class().mocha().classMethodsWithAncestors());
  log('obj.instanceMethods:');
  log(obj.class().mocha().instanceMethods());
  log('obj.instanceMethodsWithAncestors:');
  log(obj.class().mocha().instanceMethodsWithAncestors());
  log('obj.protocols:');
  log(obj.class().mocha().protocols());
  log('obj.protocolsWithAncestors:');
  log(obj.class().mocha().protocolsWithAncestors());
  log('obj.treeAsDictionary():');
  log(obj.treeAsDictionary());
  return obj;
};

export const timeFunction = (fn: () => any, label: string) => {
  const methodStart = NSDate.date();

  const res = fn();

  const methodFinish = NSDate.date();
  const executionTime = methodFinish.timeIntervalSinceDate(methodStart);

  log(`${label}: ${executionTime.toFixed(3)}`);

  return res;
};
{'fraction_non_alphanumeric': 0.30443548387096775, 'fraction_numerical': 0.0006720430107526882, 'mean_word_length': 6.4425, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5234093', 'n_tokens_mistral': 935, 'n_tokens_neox': 906, 'n_words': 134}