class_docstr: This class has pool interface but performs all work in calls to get_results. It is sometimes convenient
  to substitute a real pool with this dummy implementation.
  
  Found this class useful when profiling worker code. When on a separate thread, the worker code was not observable
  (out of the box) by the profiler
docstr: Returns results
  
  The processing is done on the get_results caller thread if the results queue is empty
  
  :return: arguments passed to publish_func(...) by a worker
docstr_tok: ["Returns","results","The","processing","is","done","on","the","get_results","caller","thread","if","the","results","queue","is","empty",":","return",":","arguments","passed","to","publish_func","(","...",")","by","a","worker"]
code: def get_results(self):
      """Returns results
  
      The processing is done on the get_results caller thread if the results queue is empty
  
      :return: arguments passed to publish_func(...) by a worker
      """
  
      if self._results_queue:
          # We have already calculated result. Just return it
          return self._results_queue.pop(0)
      else:
          # If we don't have any tasks waiting for processing, then indicate empty queue
          while self._ventilator_queue or (
              self._ventilator and not self._ventilator.completed()
          ):
              # To prevent a race condition of the ventilator working but not yet placing an item
              # on the ventilator queue. We block until something is on the ventilator queue.
              while not self._ventilator_queue:
                  sleep(0.1)
  
              # If we do have some tasks, then process a task from the head of a queue
              args, kargs = self._ventilator_queue.pop(0)
              self._worker.process(*args, **kargs)
  
              if self._ventilator:
                  self._ventilator.processed_item()
  
              if self._results_queue:
                  return self._results_queue.pop(0)
  
          raise EmptyResultError()
  
file_path: petastorm/petastorm/workers_pool/dummy_pool.py
imports: from time import sleep
  from petastorm.workers_pool import EmptyResultError
label_desc: Use image node_id 4 for calling the DummyPool obj's underlying member method code with example usage: obj.get_results() and returns: self, self