code: def ray_instance(request):
      """Starts and stops a Ray instance for this test.
  
      Args:
          request: request.param should contain a dictionary of env vars and
              their values. The Ray instance will be started with these env vars.
      """
  
      original_env_vars = os.environ.copy()
  
      try:
          requested_env_vars = request.param
      except AttributeError:
          requested_env_vars = {}
  
      os.environ.update(requested_env_vars)
      importlib.reload(ray.serve._private.constants)
      importlib.reload(ray.serve._private.controller)
      importlib.reload(ray.serve._private.proxy)
  
      yield ray.init()
  
      serve.shutdown()
      ray.shutdown()
  
      os.environ.clear()
      os.environ.update(original_env_vars)
  
imports: import importlib
  import logging
  import os
  import sys
  import pytest
  import requests
  import starlette
  from starlette.middleware import Middleware
  import ray
  from ray import serve
  from ray._private.test_utils import wait_for_condition
  from ray.exceptions import RayActorError
  from ray.serve._private.common import ProxyStatus
  from ray.serve._private.utils import call_function_from_import_path
  from ray.serve.context import _get_global_client
  from ray.serve.schema import LoggingConfig, ServeInstanceDetails
label_desc: Use image node_id 5 for calling a global function with example usage: ray_instance(request) without return types