code: def get_image_file_list(img_file):
      imgs_lists = []
      if img_file is None or not os.path.exists(img_file):
          raise Exception(
              "not found any img file in {}".format(img_file)
          )
  
      if os.path.isfile(img_file) and _check_image_file(img_file):
          imgs_lists.append(img_file)
      elif os.path.isdir(img_file):
          for single_file in os.listdir(img_file):
              file_path = os.path.join(img_file, single_file)
              if os.path.isfile(file_path) and _check_image_file(
                  file_path
              ):
                  imgs_lists.append(file_path)
      if len(imgs_lists) == 0:
          raise Exception(
              "not found any img file in {}".format(img_file)
          )
      imgs_lists = sorted(imgs_lists)
      return imgs_lists
  
imports: import logging
  import os
  import imghdr
  import cv2
  import random
  import numpy
  import paddle
  import importlib.util
  import sys
  import subprocess
label_desc: Use image node_id 4 for calling a global function with example usage: get_image_file_list(img_file) and returns: imgs_lists