code: def serve_with_client(ray_client_instance, ray_init_kwargs=None):
      if ray_init_kwargs is None:
          ray_init_kwargs = dict()
      ray.init(
          f"ray://{ray_client_instance}",
          namespace="default_test_namespace",
          **ray_init_kwargs,
      )
      assert ray.util.client.ray.is_connected()
  
      yield
  
      serve.shutdown()
      ray.util.disconnect()
  
file_path: ray/python/ray/serve/tests/test_ray_client.py
imports: import random
  import subprocess
  import sys
  import time
  import pytest
  import requests
  import ray
  from ray import serve
  from ray._private.test_utils import run_string_as_driver
label_desc: Use image node_id 2 for calling a global function with example usage: serve_with_client(ray_client_instance, ray_init_kwargs) without return types