code: def testParallelWorkersInitFun(self):
      workspace.ResetWorkspace()
  
      queue = create_queue()
      dummy_worker = create_worker(
          queue, lambda worker_id: workspace.FetchBlob("data")
      )
      workspace.FeedBlob("data", "not initialized")
  
      def init_fun(worker_coordinator, global_coordinator):
          workspace.FeedBlob("data", "initialized")
  
      worker_coordinator = parallel_workers.init_workers(
          dummy_worker, init_fun=init_fun
      )
      worker_coordinator.start()
  
      for _ in range(10):
          value = dequeue_value(queue)
          self.assertEqual(
              value,
              b"initialized",
              "Got unexpected value " + str(value),
          )
  
      # A best effort attempt at a clean shutdown
      worker_coordinator.stop()
  
file_path: pytorch/caffe2/python/parallel_workers_test.py
imports: import unittest
  from caffe2.python import workspace, core
  import caffe2.python.parallel_workers
label_desc: Use image node_id 2 for calling the ParallelWorkersTest obj's underlying member method code with example usage: obj.testParallelWorkersInitFun() without return types