code: def reader(
      paths=[],
      images=None,
      decode_image=DecodeImage(to_rgb=True, with_mixup=False),
      resize_image=ResizeImage(
          target_size=512, interp=1, max_size=0, use_cv2=False
      ),
      permute_image=Permute(to_bgr=False),
      normalize_image=NormalizeImage(
          mean=[104, 117, 123], std=[1, 1, 1], is_scale=False
      ),
  ):
      """
      data generator
  
      Args:
          paths (list[str]): paths to images.
          images (list(numpy.ndarray)): data of images, shape of each is [H, W, C]
          decode_image (class object): instance of <class 'DecodeImage' object>
          resize_image (class object): instance of <class 'ResizeImage' object>
          permute_image (class object): instance of <class 'Permute' object>
          normalize_image (class object): instance of <class 'NormalizeImage' object>
      """
      img_list = []
      if paths is not None:
          assert type(paths) is list, "type(paths) is not list."
          for img_path in paths:
              assert os.path.isfile(
                  img_path
              ), "The {} isn't a valid file path.".format(img_path)
              img = cv2.imread(img_path).astype("float32")
              img_list.append(img)
      if images is not None:
          for img in images:
              img_list.append(img)
  
      for img in img_list:
          preprocessed_img = decode_image(img)
          preprocessed_img = resize_image(preprocessed_img)
          preprocessed_img = permute_image(preprocessed_img)
          preprocessed_img = normalize_image(preprocessed_img)
          yield [preprocessed_img]
  
imports: from __future__ import absolute_import
  from __future__ import print_function
  from __future__ import division
  import os
  import random
  import cv2
  import numpy
  from PIL import Image
label_desc: Use image node_id 1 for calling a global function with example usage: reader(paths, images, decode_image, resize_image, permute_image, normalize_image) without return types