code: def run(self):
      with self.default_sess():
          while not self.stopped():
              batched, futures = self.fetch_batch()
              try:
                  outputs = self.func(*batched)
              except tf.errors.CancelledError:
                  for f in futures:
                      f.cancel()
                  logger.warn(
                      "In PredictorWorkerThread id={}, call was cancelled.".format(
                          self.id
                      )
                  )
                  return
              # print "Worker {} batched {} Queue {}".format(
              #         self.id, len(futures), self.queue.qsize())
              #  debug, for speed testing
              # if not hasattr(self, 'xxx'):
              # self.xxx = outputs = self.func(batched)
              # else:
              # outputs = [[self.xxx[0][0]] * len(batched[0]), [self.xxx[1][0]] * len(batched[0])]
  
              for idx, f in enumerate(futures):
                  f.set_result([k[idx] for k in outputs])
  
imports: import multiprocessing
  import numpy
  from concurrent.futures import Future
  import tensorflow
  from six.moves import queue, range
  from ..compat import tfv1
  from ..tfutils.model_utils import describe_trainable_vars
  from ..utils import logger
  from ..utils.concurrency import DIE, ShareSessionThread, StoppableThread
  from .base import AsyncPredictorBase, OfflinePredictor, OnlinePredictor
label_desc: Use image node_id 2 for calling the PredictorWorkerThread obj's underlying member method code with example usage: obj.run() without return types