code: def _looks_like_an_ip_adress(address: Optional[str]) -> bool:
      if address is None:
          return False
  
      try:
          socket.inet_pton(socket.AF_INET, address)
          return True  # Yup, this is an IPv4 address!
      except (AttributeError, OSError):
          pass
  
      try:
          socket.inet_pton(socket.AF_INET6, address)
          return True  # Yup, this is an IPv6 address!
      except (AttributeError, OSError):
          pass
  
      # Nope, this is not an IP address.
      return False
  
file_path: streamlit/lib/streamlit/net_util.py
imports: import socket
  from typing import Optional
  from typing_extensions import Final
  from streamlit import util
  from streamlit.logger import get_logger
label_desc: Use image node_id 4 for calling a global function with example usage: _looks_like_an_ip_adress(address) and returns: False, False, True, True