code: def test_reader(paths=None, images=None):
      """data generator
      :param paths: path to images.
      :type paths: list, each element is a str
      :param images: data of images, [N, H, W, C]
      :type images: numpy.ndarray
      """
      img_list = []
      if paths:
          for img_path in paths:
              assert os.path.isfile(
                  img_path
              ), "The {} isn't a valid file path.".format(img_path)
              img = Image.open(img_path)
              # img = cv2.imread(img_path)
              img_list.append(img)
      if images is not None:
          for img in images:
              img_list.append(Image.fromarray(np.uint8(img)))
      for im in img_list:
          im = process_image(im)
          yield im
  
file_path: PaddleHub/modules/image/classification/darknet53_imagenet/data_feed.py
imports: from __future__ import absolute_import
  from __future__ import print_function
  from __future__ import division
  import os
  from collections import OrderedDict
  import cv2
  import numpy
  from PIL import Image, ImageEnhance
  from paddle import fluid
label_desc: Use image node_id 4 for calling a global function with example usage: test_reader(paths, images) without return types