code: def ray_start_cluster_with_resource():
      num_nodes = 5
      cluster = create_cluster(num_nodes)
      yield cluster, num_nodes
  
      # The code after the yield will run as teardown code.
      ray.shutdown()
      cluster.shutdown()
  
imports: import multiprocessing
  import time
  import warnings
  from collections import defaultdict
  import numpy
  import pytest
  import ray
  from ray.cluster_utils import Cluster, cluster_not_supported
  from ray.util.scheduling_strategies import NodeAffinitySchedulingStrategy
label_desc: Use image node_id 2 for calling a global function with example usage: ray_start_cluster_with_resource() without return types