code: def image_dequeue(DB, img_num):
      print("Entering dequeue")
      dequeue_num = 0
      num_invalid = 0
      start = time.time()
      while dequeue_num < img_num:
          pipe = DB.pipeline()
          res_list = DB.keys(RESULT_PREFIX + name + ":*")
          for res in res_list:
              pipe.hgetall(res.decode("utf-8"))
          res_dict_list = pipe.execute()
          for res_dict in res_dict_list:
              try:
                  res_val = res_dict[b"value"].decode("utf-8")
              except Exception:
                  print("Irregular result dict:", res_dict)
                  num_invalid += 1
                  continue
              if res_val == "NaN":
                  num_invalid += 1
          num_res = len(res_list)
          if num_res > 0:
              dequeue_num += num_res
              print(
                  "Received",
                  dequeue_num,
                  "results, including",
                  num_invalid,
                  "invalid results",
              )
              DB.delete(*res_list)
  
      print("Total dequeue time:", time.time() - start)
      return time.time(), dequeue_num, num_invalid
  
file_path: analytics-zoo/scripts/cluster-serving/perf-benchmark/e2e_throughput.py
imports: from zoo.serving.client import InputQueue, OutputQueue
  from zoo.common.encryption_utils import encrypt_with_AES_GCM
  import os
  import cv2
  import json
  import time
  from optparse import OptionParser
  import base64
  from multiprocessing import Process
  import redis
  import yaml
  import argparse
  from numpy import *
label_desc: Use image node_id 3 for calling a global function with example usage: image_dequeue(DB, img_num) and returns: time,  dequeue_num,  num_invalid