code: def test_zero_capacity_deletion_semantics(shutdown_only):
      ray.init(num_cpus=2, num_gpus=1, resources={"test_resource": 1})
  
      def delete_miscellaneous_item(resources):
          del resources["memory"]
          del resources["object_store_memory"]
          for key in list(resources.keys()):
              if key.startswith("node:"):
                  del resources[key]
  
      def test():
          resources = ray.available_resources()
          MAX_RETRY_ATTEMPTS = 5
          retry_count = 0
  
          delete_miscellaneous_item(resources)
  
          while resources and retry_count < MAX_RETRY_ATTEMPTS:
              time.sleep(0.1)
              resources = ray.available_resources()
              delete_miscellaneous_item(resources)
              retry_count += 1
  
          if retry_count >= MAX_RETRY_ATTEMPTS:
              raise RuntimeError(
                  "Resources were available even after {} retries.".format(
                      MAX_RETRY_ATTEMPTS
                  ),
                  resources,
              )
  
          return resources
  
      function = ray.remote(
          num_cpus=2, num_gpus=1, resources={"test_resource": 1}
      )(test)
      cluster_resources = ray.get(function.remote())
  
      # All cluster resources should be utilized and
      # cluster_resources must be empty
      assert cluster_resources == {}
  
imports: import logging
  import os
  import sys
  import time
  import numpy
  import pytest
  import ray
  import ray.cluster_utils
  from ray._private.test_utils import RayTestTimeoutException, wait_for_condition
  from ray.util.placement_group import placement_group
  from ray.util.accelerators import AWS_NEURON_CORE
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy
label_desc: Use image node_id 14 for calling a global function with example usage: test_zero_capacity_deletion_semantics(shutdown_only) and returns: resources