code: def test_global_state_api(shutdown_only):
      ray.init(num_cpus=5, num_gpus=3, resources={"CustomResource": 1})
  
      assert ray.cluster_resources()["CPU"] == 5
      assert ray.cluster_resources()["GPU"] == 3
      assert ray.cluster_resources()["CustomResource"] == 1
  
      job_id = ray._private.utils.compute_job_id_from_driver(
          ray.WorkerID(ray._private.worker.global_worker.worker_id)
      )
  
      client_table = ray.nodes()
      node_ip_address = (
          ray._private.worker.global_worker.node_ip_address
      )
  
      assert len(client_table) == 1
      assert client_table[0]["NodeManagerAddress"] == node_ip_address
  
      @ray.remote
      class Actor:
          def __init__(self):
              pass
  
      _ = Actor.options(name="test_actor").remote()  # noqa: F841
      # Wait for actor to be created
      wait_for_num_actors(1)
  
      actor_table = ray._private.state.actors()
      assert len(actor_table) == 1
  
      (actor_info,) = actor_table.values()
      assert actor_info["JobID"] == job_id.hex()
      assert actor_info["Name"] == "test_actor"
      assert "IPAddress" in actor_info["Address"]
      assert "IPAddress" in actor_info["OwnerAddress"]
      assert (
          actor_info["Address"]["Port"]
          != actor_info["OwnerAddress"]["Port"]
      )
  
      job_table = ray._private.state.jobs()
  
      assert len(job_table) == 1
      assert job_table[0]["JobID"] == job_id.hex()
      assert job_table[0]["DriverIPAddress"] == node_ip_address
  
imports: import logging
  import os
  import pickle
  import socket
  import sys
  import time
  import numpy
  import pytest
  import ray
  import ray._private.utils
  import ray.cluster_utils
  import ray.util.accelerators
  from ray._private.test_utils import check_call_ray, wait_for_num_actors
  import setproctitle
label_desc: Use image node_id 1 for calling a global function with example usage: test_global_state_api(shutdown_only) without return types