code: def get_img_files(data_path, subdir="*", ext=None):
      if subdir is None:
          subdir = ""
      if ext:
          if isinstance(ext, (list, tuple)):
              files = []
              for e in ext:
                  files += glob.glob(data_path + f"/{subdir}/*.{e}")
          else:
              files = glob.glob(data_path + f"/{subdir}/*.{ext}")
          return files
      else:
          files = glob.glob(data_path + f"/{subdir}/*.*")
          txt_files = glob.glob(data_path + f"/{subdir}/*.txt")
          return list(set(files) - set(txt_files))
  
imports: import glob
  import math
  import numpy
  import nvidia.dali.backend
  import nvidia.dali.fn
  import nvidia.dali.types
  import os
  import random
  from nvidia.dali import pipeline_def
  from nose2.tools import params
  from nose_utils import assert_raises
  from test_utils import check_output_pattern
  from test_utils import compare_pipelines
  from test_utils import get_dali_extra_path
  from test_utils import to_array
label_desc: Use image node_id 1 for calling a global function with example usage: get_img_files(data_path, subdir, ext) and returns: files, list