code: def parse_filepaths(
      data_collection,
      data_group_dict,
      case_list=None,
      recursive=True,
      verbose=True,
      file_identifying_chars=None,
  ):
      """Recursive functionality not yet available"""
  
      # Case lists not yet implemented.
  
      # Pulling from multiple directories not yet implemented.
      lead_group = data_group_dict[list(data_group_dict.keys())[0]]
  
      if type(lead_group[0]) is list:
          lead_directory = os.path.abspath(lead_group[0][0])
      else:
          lead_directory = os.path.abspath(lead_group[0])
  
      lead_files = []
  
      for directory in lead_group:
          if os.path.isdir(os.path.normpath(directory)):
              directory = os.path.join(directory, "*")
  
          regex = os.path.basename(directory)
  
          lead_files += grab_files_recursive(
              os.path.abspath(os.path.dirname(directory)),
              regex=regex,
              recursive=recursive,
          )
  
      for lead_filepath in lead_files:
          base_filedir = os.path.dirname(lead_filepath).split(
              lead_directory, 1
          )[1]
          base_filepath = nifti_splitext(lead_filepath)[0]
  
          if file_identifying_chars is not None:
              base_filepath = os.path.basename(
                  os.path.join(
                      os.path.dirname(base_filepath),
                      os.path.basename(base_filepath)[
                          :file_identifying_chars
                      ],
                  )
              )
  
          # Search for sequence files, and skip those missing with files modalities.
          for data_group, sequence_labels in list(
              data_collection.data_group_dict.items()
          ):
              data_group_files = []
  
              for sequence in sequence_labels:
                  target_file = glob.glob(
                      os.path.join(
                          sequence, base_filedir, base_filepath + "*"
                      )
                  )
  
                  if len(target_file) == 1:
                      data_group_files.append(target_file[0])
                  else:
                      print(
                          (
                              "Error loading",
                              sequence,
                              "from case",
                              lead_filepath,
                          )
                      )
                      if len(target_file) == 0:
                          print("No file found.\n")
                      else:
                          print("Multiple files found.\n")
  
              if len(data_group_files) == len(sequence_labels):
                  data_collection.data_groups[data_group].add_case(
                      lead_filepath, data_group_files
                  )
              else:
                  lead_filepath = None
                  break
  
          # This is ugh.
          if lead_filepath is not None:
              case_name = lead_filepath
              data_collection.cases.append(case_name)
  
file_path: DeepNeuro/deepneuro/data/data_load.py
imports: import os
  import glob
  import csv
  import tables
  from deepneuro.utilities.util import grab_files_recursive, nifti_splitext
label_desc: Use image node_id 3 for calling a global function with example usage: parse_filepaths(data_collection, data_group_dict, case_list, recursive, verbose, file_identifying_chars) without return types