code: def ray_8_cpus():
      ray.init(
          num_cpus=8, resources={f"node:host-{i}": 1 for i in range(10)}
      )
      yield
      # The code after the yield will run as teardown code.
      ray.shutdown()
  
imports: from contextlib import contextmanager
  import psutil
  import os
  import socket
  import mock
  import pytest
  import ray
  from horovod.common.util import gloo_built
  from horovod.runner.elastic.discovery import HostDiscovery
  from horovod.ray.elastic_v2 import RayHostDiscovery
  from horovod.ray.runner import RayExecutor
label_desc: Use image node_id 2 for calling a global function with example usage: ray_8_cpus() without return types