code: def wait_for_url(
      url,
      timeout: float = 300.0,
      check_time: float = 30.0,
      status_time: float = 60.0,
  ) -> str:
      start_time = time.monotonic()
      timeout_at = start_time + timeout
      next_status = start_time + status_time
      logger.info(
          f"Waiting up to {timeout} seconds until URL is available "
          f"({url})"
      )
      while not url_exists(url):
          now = time.monotonic()
          if now >= timeout_at:
              raise RayWheelsTimeoutError(
                  f"Time out when waiting for URL to be available: {url}"
              )
  
          if now >= next_status:
              logger.info(
                  f"... still waiting for URL {url} "
                  f"({int(now - start_time)} seconds) ..."
              )
              next_status += status_time
  
          # Sleep `check_time` sec before next check.
          time.sleep(check_time)
      logger.info(f"URL is now available: {url}")
      return url
  
imports: import importlib
  import os
  import re
  import shlex
  import subprocess
  import sys
  from datetime import datetime
  import tempfile
  import time
  import urllib.request
  from typing import Optional, List, Tuple
  from ray_release.config import parse_python_version
  from ray_release.test import DEFAULT_PYTHON_VERSION
  from ray_release.template import set_test_env_var
  from ray_release.exception import RayWheelsUnspecifiedError, RayWheelsNotFoundError, RayWheelsTimeoutError, ReleaseTestSetupError
  from ray_release.logger import logger
  from ray_release.util import url_exists, python_version_str, resolve_url
  from ray_release.aws import upload_to_s3
label_desc: Use image node_id 7 for calling a global function with example usage: wait_for_url(url, timeout, check_time, status_time) and returns: url