code: def is_valid_url(url: str) -> bool:
      """Checks if a given URL is valid.
  
      Args:
          url: The URL to check the validity.
  
      Returns:
          True if the URL is valid, False otherwise.
  
      """
      try:
          query = "ASK {}"
          res_code = requests.head(
              url, params={"query": query}
          ).status_code
          return res_code == requests.codes.ok
      except Exception:
          return False
  
imports: import os
  import attr
  import requests
label_desc: Use image node_id 5 for calling a global function with example usage: is_valid_url(url) and returns: unknown, False