code: def reader(images, paths, scale, rotation):
      """
      Preprocess to yield image.
  
      Args:
          images (list(numpy.ndarray)): images data, shape of each is [H, W, C]
          paths (list[str]): paths to images.
          scale (tuple): size of preprocessed image.
          rotation (int): rotation angle, used for obtaining affine matrix in preprocess.
  
      Yield:
          element (collections.OrderedDict): info of original image and preprocessed image.
      """
      component = list()
      if paths:
          for im_path in paths:
              each = OrderedDict()
              assert os.path.isfile(
                  im_path
              ), "The {} isn't a valid file path.".format(im_path)
              im = cv2.imread(im_path)
              each["org_im"] = im
              each["org_im_path"] = im_path
              component.append(each)
      if images is not None:
          assert type(images) is list, "images should be a list."
          for im in images:
              each = OrderedDict()
              each["org_im"] = im
              each["org_im_path"] = "ndarray_time={}.jpg".format(
                  round(time.time(), 6) * 1e6
              )
              component.append(each)
  
      for element in component:
          element["image"], element["image_info"] = preprocess(
              element["org_im"], scale, rotation
          )
          yield element
  
file_path: PaddleHub/modules/image/semantic_segmentation/ace2p/data_feed.py
imports: import os
  import time
  from collections import OrderedDict
  import cv2
  import numpy
  from .processor import get_affine_transform
label_desc: Use image node_id 4 for calling a global function with example usage: reader(images, paths, scale, rotation) without return types