code: def create_cluster(num_nodes):
      cluster = Cluster()
      for i in range(num_nodes):
          cluster.add_node(
              resources={str(i): 100}, object_store_memory=10**9
          )
  
      ray.init(address=cluster.address)
      return cluster
  
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 1 for calling a global function with example usage: create_cluster(num_nodes) and returns: cluster