code: def test_train(ray_start_4_cpus):
      def simple_fn(worker):
          local_rank = _train()
          return local_rank
  
      setting = RayExecutor.create_settings(timeout_s=30)
      hjob = RayExecutor(
          setting, num_workers=3, use_gpu=torch.cuda.is_available()
      )
      hjob.start()
      result = hjob.execute(simple_fn)
      assert set(result) == {0, 1, 2}
      result = ray.get(hjob.run_remote(simple_fn, args=[None]))
      assert set(result) == {0, 1, 2}
      hjob.shutdown()
  
file_path: ray/python/ray/tests/horovod/test_horovod.py
imports: import pytest
  import torch
  import ray
  from ray.util.client.ray_client_helpers import ray_start_client_server
label_desc: Use image node_id 3 for calling a global function with example usage: test_train(ray_start_4_cpus) and returns: local_rank