code: def get_all_files(
      dirName,
      match_and=None,
      match_or=None,
      exclude_and=None,
      exclude_or=None,
  ):
      """Returns a list of files found within a folder.
  
      Different options can be used to restrict the search to some specific
      patterns.
  
      Arguments
      ---------
      dirName : str
          The directory to search.
      match_and : list
          A list that contains patterns to match. The file is
          returned if it matches all the entries in `match_and`.
      match_or : list
          A list that contains patterns to match. The file is
          returned if it matches one or more of the entries in `match_or`.
      exclude_and : list
          A list that contains patterns to match. The file is
          returned if it matches none of the entries in `exclude_and`.
      exclude_or : list
          A list that contains pattern to match. The file is
          returned if it fails to match one of the entries in `exclude_or`.
  
      Example
      -------
      >>> get_all_files('tests/samples/RIRs', match_and=['3.wav'])
      ['tests/samples/RIRs/rir3.wav']
      """
  
      # Match/exclude variable initialization
      match_and_entry = True
      match_or_entry = True
      exclude_or_entry = False
      exclude_and_entry = False
  
      # Create a list of file and sub directories
      listOfFile = os.listdir(dirName)
      allFiles = list()
  
      # Iterate over all the entries
      for entry in listOfFile:
          # Create full path
          fullPath = os.path.join(dirName, entry)
  
          # If entry is a directory then get the list of files in this directory
          if os.path.isdir(fullPath):
              allFiles = allFiles + get_all_files(
                  fullPath,
                  match_and=match_and,
                  match_or=match_or,
                  exclude_and=exclude_and,
                  exclude_or=exclude_or,
              )
          else:
              # Check match_and case
              if match_and is not None:
                  match_and_entry = False
                  match_found = 0
  
                  for ele in match_and:
                      if ele in fullPath:
                          match_found = match_found + 1
                  if match_found == len(match_and):
                      match_and_entry = True
  
              # Check match_or case
              if match_or is not None:
                  match_or_entry = False
                  for ele in match_or:
                      if ele in fullPath:
                          match_or_entry = True
                          break
  
              # Check exclude_and case
              if exclude_and is not None:
                  match_found = 0
  
                  for ele in exclude_and:
                      if ele in fullPath:
                          match_found = match_found + 1
                  if match_found == len(exclude_and):
                      exclude_and_entry = True
  
              # Check exclude_or case
              if exclude_or is not None:
                  exclude_or_entry = False
                  for ele in exclude_or:
                      if ele in fullPath:
                          exclude_or_entry = True
                          break
  
              # If needed, append the current file to the output list
              if (
                  match_and_entry
                  and match_or_entry
                  and not (exclude_and_entry)
                  and not (exclude_or_entry)
              ):
                  allFiles.append(fullPath)
  
      return allFiles
  
imports: import math
  import os
  import re
  import csv
  import shutil
  import urllib.request
  import collections.abc
  import torch
  import tqdm
  import pathlib
  import speechbrain
  from numbers import Number
label_desc: Use image node_id 2 for calling a global function with example usage: get_all_files(dirName, match_and, match_or, exclude_and, exclude_or) and returns: allFiles