code: def _check_service_url_is_ready(
      url: str, timeout: float = 5, metadata=""
  ) -> bool:
      try:
          response = requests.get(url, timeout=timeout)
          return response.status_code in (200, 404)
      except (ConnectionError, ConnectTimeout, ReadTimeout):
          logger.debug(f"The url {url} is not ready. {metadata}")
          return False
  
imports: import socket
  from functools import wraps
  from typing import Any, Callable, Dict, Optional
  from urllib.parse import urljoin
  import requests
  from lightning_cloud.rest_client import GridRestClient, LightningClient, create_swagger_client
  from requests import Session
  from requests.adapters import HTTPAdapter
  from requests.exceptions import ConnectionError, ConnectTimeout, ReadTimeout
  from urllib3.util.retry import Retry
  from lightning.app.core import constants
  from lightning.app.utilities.app_helpers import Logger
label_desc: Use image node_id 4 for calling a global function with example usage: _check_service_url_is_ready(url, timeout, metadata) and returns: unknown, False