code: def get_files(image_or_label, dataset_split, args):
      dataset_root = args.dataset_root
      postfix = args.postfix
      format = args.format
      folder = args.folder
  
      pattern = "*%s.%s" % (
          postfix[image_or_label],
          format[image_or_label],
      )
  
      search_files = os.path.join(
          dataset_root, folder[image_or_label], dataset_split, pattern
      )
      search_files2 = os.path.join(
          dataset_root,
          folder[image_or_label],
          dataset_split,
          "*",
          pattern,
      )  # 包含子目录
      search_files3 = os.path.join(
          dataset_root,
          folder[image_or_label],
          dataset_split,
          "*",
          "*",
          pattern,
      )  # 包含三级目录
      search_files4 = os.path.join(
          dataset_root,
          folder[image_or_label],
          dataset_split,
          "*",
          "*",
          "*",
          pattern,
      )  # 包含四级目录
      search_files5 = os.path.join(
          dataset_root,
          folder[image_or_label],
          dataset_split,
          "*",
          "*",
          "*",
          "*",
          pattern,
      )  # 包含五级目录
  
      filenames = glob.glob(search_files)
      filenames2 = glob.glob(search_files2)
      filenames3 = glob.glob(search_files3)
      filenames4 = glob.glob(search_files4)
      filenames5 = glob.glob(search_files5)
  
      filenames = (
          filenames + filenames2 + filenames3 + filenames4 + filenames5
      )
  
      return sorted(filenames)
  
file_path: PaddleSeg/tools/data/create_dataset_list.py
imports: import glob
  import os.path
  import argparse
  import warnings
label_desc: Use image node_id 3 for calling a global function with example usage: get_files(image_or_label, dataset_split, args) and returns: sorted