<commit_before>const utils = require('../../utils')

const groupFileTypes = (fileList, options) => {
  const files = {
    json: [],
    nifti: [],
    stimuli: [],
    ephys: [],
    tsv: [],
    bval: [],
    bvec: [],
    invalid: [],
    modaility: [],
  }
  sortFiles(fileList, options, files)
  //   reportFileTypeCounts(files)
  return files
}

const sortFiles = (fileList, options, files) => {
  const keys = Object.keys(fileList)
  keys.forEach(key => {
    const file = fileList[key]
    const filename = file.name
    if (utils.type.file.isStimuliData(file.relativePath)) {
      // collect stimuli
      files.stimuli.push(file)
    } else if (
      !utils.type.isBIDS(file.relativePath, options.bep006, options.bep010)
    ) {
      // invalid file type<commit_msg>Remove an unused modality field from groupFileTypes.<commit_after>const utils = require('../../utils')

const groupFileTypes = (fileList, options) => {
  const files = {
    json: [],
    nifti: [],
    stimuli: [],
    ephys: [],
    tsv: [],
    bval: [],
    bvec: [],
    invalid: [],
  }
  sortFiles(fileList, options, files)
  //   reportFileTypeCounts(files)
  return files
}

const sortFiles = (fileList, options, files) => {
  const keys = Object.keys(fileList)
  keys.forEach(key => {
    const file = fileList[key]
    const filename = file.name
    if (utils.type.file.isStimuliData(file.relativePath)) {
      // collect stimuli
      files.stimuli.push(file)
    } else if (
      !utils.type.isBIDS(file.relativePath, options.bep006, options.bep010)
    ) {
      // invalid file type
{'fraction_non_alphanumeric': 0.15272496831432192, 'fraction_numerical': 0.0076045627376425855, 'mean_word_length': 2.777511961722488, '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': '1863614', 'n_tokens_mistral': 537, 'n_tokens_neox': 523, 'n_words': 108}