code: def get_internal_ip() -> Optional[str]:
      """Get the *local* IP address of the current machine.
  
      From: https://stackoverflow.com/a/28950776
  
      Returns
      -------
      string
          The local IPv4 address of the current machine.
  
      """
      global _internal_ip
  
      if _internal_ip is not None:
          return _internal_ip
  
      with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s:
          try:
              # Doesn't even have to be reachable
              s.connect(("8.8.8.8", 1))
              _internal_ip = s.getsockname()[0]
          except Exception:
              _internal_ip = "127.0.0.1"
  
      return _internal_ip
  
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 2 for calling a global function with example usage: get_internal_ip() and returns: _internal_ip, _internal_ip