code: def valid_url(url: str) -> bool:
      # Function taken from https://stackoverflow.com/questions/7160737/how-to-validate-a-url-in-python-malformed-or-not
      try:
          result = urlparse(url)
          if result.scheme == "mailto":
              return all([result.scheme, result.path])
          return all([result.scheme, result.netloc])
      except Exception:
          return False
  
file_path: streamlit/lib/streamlit/commands/page_config.py
imports: import random
  from textwrap import dedent
  from typing import TYPE_CHECKING, Mapping, Optional, Union, cast
  from urllib.parse import urlparse
  from typing_extensions import Final, Literal, TypeAlias
  from streamlit.elements import image
  from streamlit.errors import StreamlitAPIException
  from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
  from streamlit.proto.PageConfig_pb2 import PageConfig
  from streamlit.runtime.metrics_util import gather_metrics
  from streamlit.runtime.scriptrunner import get_script_run_ctx
  from streamlit.string_util import is_emoji
  from streamlit.util import lower_clean_dict_keys
label_desc: Use image node_id 7 for calling a global function with example usage: valid_url(url) and returns: all, all, False