class_docstr: Thread class with a stop() method. The thread itself has to check
  regularly for the stopped() condition.
code: def __init__(
      self,
      worker_impl,
      stop_event,
      ventilator_queue,
      results_queue,
      profiling_enabled=False,
  ):
      super(WorkerThread, self).__init__()
      self._stop_event = stop_event
      self._worker_impl = worker_impl
      self._ventilator_queue = ventilator_queue
      self._results_queue = results_queue
      self._profiling_enabled = profiling_enabled
      if profiling_enabled:
          self.prof = cProfile.Profile()
  
imports: import cProfile
  import pstats
  import random
  import sys
  from threading import Thread, Event
  from traceback import format_exc
  from six.moves import queue
  from petastorm.workers_pool import EmptyResultError, VentilatedItemProcessedMessage
label_desc: Use image node_id 1 to create a new WorkerThread object from inherited base classes: Thread with example: obj = WorkerThread(worker_impl, stop_event, ventilator_queue, results_queue, profiling_enabled)