code: def test_api_functions():
      # These are pulled from the "Python API" of the Ray Docs
      # util.queue.Queue & util.ActorPool are removed because they are under
      # util.*, not the top-level Ray namespace.
      PYTHON_API = [
          "init",
          "is_initialized",
          "remote",
          "get",
          "wait",
          "put",
          "kill",
          "cancel",
          "get_actor",
          "get_gpu_ids",
          "shutdown",
          "method",
          "nodes",
          "timeline",
          "cluster_resources",
          "available_resources",
          "java_function",
          "java_actor_class",
          "client",
      ]
  
      OTHER_ALLOWED_FUNCTIONS = [
          # In the RuntimeContext API
          "get_runtime_context",
      ]
  
      IMPL_FUNCTIONS = ["__getattr__"]
  
      functions = getmembers(ray, isfunction)
      function_names = [f[0] for f in functions]
      assert set(function_names) == set(
          PYTHON_API + OTHER_ALLOWED_FUNCTIONS + IMPL_FUNCTIONS
      )
  
file_path: ray/python/ray/tests/test_top_level_api.py
imports: from inspect import getmembers, isfunction, ismodule
  import sys
  import pytest
  import ray
label_desc: Use image node_id 1 for calling a global function with example usage: test_api_functions() without return types