code: def run_test_locally(self, fn, device_option=None, **kwargs):
      # Queue for assertion errors on subprocesses
      queue = Queue()
  
      # Capture any exception thrown by the subprocess
      def run_fn(*args, **kwargs):
          try:
              with core.DeviceScope(device_option):
                  fn(*args, **kwargs)
                  workspace.ResetWorkspace()
                  queue.put(True)
          except Exception as ex:
              queue.put(ex)
  
      # Start N processes in the background
      procs = []
      for i in range(kwargs["comm_size"]):
          kwargs["comm_rank"] = i
          proc = Process(target=run_fn, kwargs=kwargs)
          proc.start()
          procs.append(proc)
  
      # Test complete, join background processes
      while len(procs) > 0:
          proc = procs.pop(0)
          while proc.is_alive():
              proc.join(10)
  
          # Raise exception if we find any. Otherwise each worker
          # should put a True into the queue
          # Note that the following is executed ALSO after
          # the last process was joined, so if ANY exception
          # was raised, it will be re-raised here.
          self.assertFalse(queue.empty(), "Job failed without a result")
          o = queue.get()
          if isinstance(o, Exception):
              raise o
          else:
              self.assertTrue(o)
  
imports: from hypothesis import given, settings
  import hypothesis.strategies
  from multiprocessing import Process, Queue
  import numpy
  import os
  import pickle
  import tempfile
  import shutil
  from caffe2.python import core, workspace, dyndep
  import caffe2.python.hypothesis_test_util
  from gloo.python import IoError
label_desc: Use image node_id 1 for calling the TestCase obj's underlying member method code with example usage: obj.run_test_locally(fn, device_option) without return types