code: def get_file_list(source_root: str) -> [list, dict]:
      """Get file list.
  
      Args:
          source_root (str): image or video source path
  
      Return:
          source_file_path_list (list): A list for all source file.
          source_type (dict): Source type: file or url or dir.
      """
      is_dir = os.path.isdir(source_root)
      is_url = source_root.startswith(("http:/", "https:/"))
      is_file = (
          os.path.splitext(source_root)[-1].lower() in IMG_EXTENSIONS
      )
  
      source_file_path_list = []
      if is_dir:
          # when input source is dir
          for file in scandir(
              source_root, IMG_EXTENSIONS, recursive=True
          ):
              source_file_path_list.append(
                  os.path.join(source_root, file)
              )
      elif is_url:
          # when input source is url
          filename = os.path.basename(
              urllib.parse.unquote(source_root).split("?")[0]
          )
          file_save_path = os.path.join(os.getcwd(), filename)
          print(f"Downloading source file to {file_save_path}")
          torch.hub.download_url_to_file(source_root, file_save_path)
          source_file_path_list = [file_save_path]
      elif is_file:
          # when input source is single image
          source_file_path_list = [source_root]
      else:
          print("Cannot find image file.")
  
      source_type = dict(is_dir=is_dir, is_url=is_url, is_file=is_file)
  
      return source_file_path_list, source_type
  
file_path: mmdetection/projects/Detic/demo.py
imports: import os
  import urllib
  from argparse import ArgumentParser
  import mmcv
  import torch
  from mmengine.logging import print_log
  from mmengine.utils import ProgressBar, scandir
  from mmdet.apis import inference_detector, init_detector
  from mmdet.registry import VISUALIZERS
  from mmdet.utils import register_all_modules
label_desc: Use image node_id 1 for calling a global function with example usage: get_file_list(source_root) and returns: source_file_path_list,  source_type