code: def url_ok(url: str) -> bool:
      try:
          for _ in range(5):
              with warnings.catch_warnings():
                  warnings.filterwarnings("ignore")
                  r = httpx.head(url, timeout=3, verify=False)
              if r.status_code in (
                  200,
                  401,
                  302,
              ):  # 401 or 302 if auth is set
                  return True
              time.sleep(0.500)
      except (ConnectionError, httpx.ConnectError):
          return False
      return False
  
imports: from __future__ import annotations
  import os
  import socket
  import threading
  import time
  import warnings
  from functools import partial
  from typing import TYPE_CHECKING
  import httpx
  import uvicorn
  from uvicorn.config import Config
  from gradio.exceptions import ServerFailedToStartError
  from gradio.routes import App
  from gradio.tunneling import Tunnel
  from gradio.utils import SourceFileReloader, watchfn
label_desc: Use image node_id 5 for calling a global function with example usage: url_ok(url) and returns: False, False, True