<commit_before>import commander from "commander";
import readdir from "fs-readdir-recursive";
import * as babel from "babel-core";
import includes from "lodash/includes";
import path from "path";
import fs from "fs";

export function chmod(src, dest) {
  fs.chmodSync(dest, fs.statSync(src).mode);
}

export function readdirFilter(filename) {
  return readdir(filename).filter(function (filename) {
    return babel.util.isCompilableExtension(filename);
  });
}

export { readdir };

/**
 * Test if a filename ends with a compilable extension.
 */
export function isCompilableExtension(filename: string, altExts?: Array<string>): boolean {
  const exts = altExts || babel.DEFAULT_EXTENSIONS;
  const ext = path.extname(filename);
  return includes(exts, ext);
}

export function addSourceMappingUrl(code, loc) {
  return code + "\n//# sourceMappingURL=" + path.basename(loc);
}
<commit_msg>fix issue as a result of refactor (#5867)<commit_after>import commander from "commander";
import readdir from "fs-readdir-recursive";
import * as babel from "babel-core";
import includes from "lodash/includes";
import path from "path";
import fs from "fs";

export function chmod(src, dest) {
  fs.chmodSync(dest, fs.statSync(src).mode);
}

export function readdirFilter(filename) {
  return readdir(filename).filter(function (filename) {
    return isCompilableExtension(filename);
  });
}

export { readdir };

/**
 * Test if a filename ends with a compilable extension.
 */
export function isCompilableExtension(filename: string, altExts?: Array<string>): boolean {
  const exts = altExts || babel.DEFAULT_EXTENSIONS;
  const ext = path.extname(filename);
  return includes(exts, ext);
}

export function addSourceMappingUrl(code, loc) {
  return code + "\n//# sourceMappingURL=" + path.basename(loc);
}

{'fraction_non_alphanumeric': 0.12520868113522537, 'fraction_numerical': 0.0022259321090706734, 'mean_word_length': 5.243055555555555, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5919943', 'n_tokens_mistral': 578, 'n_tokens_neox': 557, 'n_words': 159}