code: def test_ids(ray_start_regular):
      rtc = ray.get_runtime_context()
      # node id
      assert isinstance(rtc.get_node_id(), str)
      with warnings.catch_warnings(record=True) as w:
          assert rtc.get_node_id() == rtc.node_id.hex()
          assert any(
              "Use get_node_id() instead" in str(warning.message)
              for warning in w
          )
  
      # job id
      assert isinstance(rtc.get_job_id(), str)
      with warnings.catch_warnings(record=True) as w:
          assert rtc.get_job_id() == rtc.job_id.hex()
          assert any(
              "Use get_job_id() instead" in str(warning.message)
              for warning in w
          )
  
      # placement group id
      # Driver doesn't belong to any placement group.
      assert rtc.get_placement_group_id() is None
      pg = ray.util.placement_group(
          name="bar",
          strategy="PACK",
          bundles=[
              {"CPU": 1, "GPU": 0},
          ],
      )
      ray.get(pg.ready())
  
      @ray.remote
      def foo_pg():
          rtc = ray.get_runtime_context()
          assert isinstance(rtc.get_placement_group_id(), str)
          with warnings.catch_warnings(record=True) as w:
              warnings.simplefilter("always")
              assert (
                  rtc.get_placement_group_id()
                  == rtc.current_placement_group_id.hex()
              )
              assert any(
                  "Use get_placement_group_id() instead"
                  in str(warning.message)
                  for warning in w
              )
  
      ray.get(
          foo_pg.options(
              scheduling_strategy=PlacementGroupSchedulingStrategy(
                  placement_group=pg
              )
          ).remote()
      )
      ray.util.remove_placement_group(pg)
  
      # task id
      assert rtc.get_task_id() is None
  
      @ray.remote
      def foo_task():
          rtc = ray.get_runtime_context()
          assert isinstance(rtc.get_task_id(), str)
          with warnings.catch_warnings(record=True) as w:
              warnings.simplefilter("always")
              assert rtc.get_task_id() == rtc.task_id.hex()
              assert any(
                  "Use get_task_id() instead" in str(warning.message)
                  for warning in w
              )
  
      ray.get(foo_task.remote())
  
      # actor id
      assert rtc.get_actor_id() is None
  
      @ray.remote
      class FooActor:
          def foo(self):
              rtc = ray.get_runtime_context()
              assert isinstance(rtc.get_actor_id(), str)
              with warnings.catch_warnings(record=True) as w:
                  warnings.simplefilter("always")
                  assert rtc.get_actor_id() == rtc.actor_id.hex()
                  assert any(
                      "Use get_actor_id() instead"
                      in str(warning.message)
                      for warning in w
                  )
  
      actor = FooActor.remote()
      ray.get(actor.foo.remote())
  
      # actor name
      @ray.remote
      class NamedActor:
          def name(self):
              return ray.get_runtime_context().get_actor_name()
  
      ACTOR_NAME = "actor_name"
      named_actor = NamedActor.options(name=ACTOR_NAME).remote()
      assert ray.get(named_actor.name.remote()) == ACTOR_NAME
  
      # unnamed actor name
      unnamed_actor = NamedActor.options().remote()
      assert ray.get(unnamed_actor.name.remote()) == ""
  
      # task actor name
      @ray.remote
      def task_actor_name():
          ray.get_runtime_context().get_actor_name()
  
      assert ray.get(task_actor_name.remote()) is None
  
      # driver actor name
      assert rtc.get_actor_name() is None
  
imports: import ray
  import os
  import signal
  import time
  import sys
  import pytest
  import warnings
  from ray._private.test_utils import SignalActor
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy
  from ray.util.state import list_tasks
  from ray._private.test_utils import wait_for_condition
label_desc: Use image node_id 10 for calling a global function with example usage: test_ids(ray_start_regular) and returns: ray