code: def test_custom_label_placement(ray_start_cluster):
      cluster = ray_start_cluster
      custom_resource1_node = cluster.add_node(
          num_cpus=2, resources={"CustomResource1": 2}
      )
      custom_resource2_node = cluster.add_node(
          num_cpus=2, resources={"CustomResource2": 2}
      )
      ray.init(address=cluster.address)
  
      @ray.remote(resources={"CustomResource1": 1})
      class ResourceActor1:
          def get_location(self):
              return ray._private.worker.global_worker.node.unique_id
  
      @ray.remote(resources={"CustomResource2": 1})
      class ResourceActor2:
          def get_location(self):
              return ray._private.worker.global_worker.node.unique_id
  
      # Create some actors.
      actors1 = [ResourceActor1.remote() for _ in range(2)]
      actors2 = [ResourceActor2.remote() for _ in range(2)]
      locations1 = ray.get([a.get_location.remote() for a in actors1])
      locations2 = ray.get([a.get_location.remote() for a in actors2])
      for location in locations1:
          assert location == custom_resource1_node.unique_id
      for location in locations2:
          assert location == custom_resource2_node.unique_id
  
imports: import collections
  import os
  import sys
  import time
  import pytest
  import ray
  import ray.cluster_utils
label_desc: Use image node_id 12 for calling a global function with example usage: test_custom_label_placement(ray_start_cluster) and returns: ray, ray