code: def wait_until_server_ready(
      host: str,
      port: int,
      timeout: float = 30,
      check_interval: int = 1,
      # set kwargs here to omit gRPC kwargs
      **kwargs: t.Any,
  ) -> None:
      host = host if "://" in host else "http://" + host
      start_time = time.time()
  
      logger.debug("Waiting for host %s to be ready.", f"{host}:{port}")
      while time.time() - start_time < timeout:
          try:
              status = httpx.get(f"{host}:{port}/readyz").status_code
              if status == 200:
                  break
              else:
                  time.sleep(check_interval)
          except (
              httpx.TimeoutException,
              httpx.NetworkError,
              httpx.HTTPStatusError,
          ):
              logger.debug("Server is not ready. Retrying...")
  
      # try to connect one more time and raise exception.
      try:
          status = httpx.get(f"{host}:{port}/readyz").status_code
          if status != 200:
              raise TimeoutError(
                  f"Timed out waiting {timeout} seconds for server at '{host}:{port}' to be ready."
              )
      except (
          httpx.TimeoutException,
          httpx.NetworkError,
          httpx.HTTPStatusError,
      ) as err:
          logger.error(
              "Timed out while connecting to %s:%s:", host, port
          )
          logger.error(err)
          raise
  
imports: from __future__ import annotations
  import asyncio
  import json
  import logging
  import time
  import typing
  from functools import cached_property
  import httpx
  import starlette.datastructures
  import starlette.requests
  from ...exceptions import BentoMLException
  from ...exceptions import RemoteException
  from ..None import io_descriptors
  from ..service import Service
  from ..service.inference_api import InferenceAPI
  from .None import AsyncClient
  from .None import Client
  from .None import SyncClient
label_desc: Use image node_id 2 for calling the SyncHTTPClient obj's underlying member method code with example usage: obj.wait_until_server_ready(host, port, timeout, check_interval) without return types