code: def get_runtime_context() -> RuntimeContext:
      """Get the runtime context of the current driver/worker.
  
      The obtained runtime context can be used to get the metadata
      of the current task and actor.
  
      Example:
  
          .. testcode::
  
              import ray
              # Get the job id.
              ray.get_runtime_context().get_job_id()
              # Get the actor id.
              ray.get_runtime_context().get_actor_id()
              # Get the task id.
              ray.get_runtime_context().get_task_id()
  
      """
      global _runtime_context
      if _runtime_context is None:
          _runtime_context = RuntimeContext(
              ray._private.worker.global_worker
          )
  
      return _runtime_context
  
imports: import logging
  from typing import Any, Dict, List, Optional
  import ray._private.worker
  from ray._private.client_mode_hook import client_mode_hook
  from ray._private.utils import pasre_pg_formatted_resources_to_original
  from ray._raylet import TaskID
  from ray.runtime_env import RuntimeEnv
  from ray.util.annotations import Deprecated, PublicAPI
label_desc: Use image node_id 1 for calling a global function with example usage: get_runtime_context() and returns: _runtime_context