code: def get_host_ip(host_ip: Optional[str] = None) -> str:
      """Get the IP address of current host.  If `host_ip` is not none then it will be
      returned as it's
      """
      if host_ip is None or host_ip == "auto":
          host_ip = "ip"
  
      if host_ip == "dns":
          host_ip = socket.getfqdn()
      elif host_ip == "ip":
          from socket import gaierror
  
          try:
              host_ip = socket.gethostbyname(socket.getfqdn())
          except gaierror:
              logger.debug(
                  "gethostbyname(socket.getfqdn()) failed... trying on hostname()"
              )
              host_ip = socket.gethostbyname(socket.gethostname())
          if host_ip.startswith("127."):
              s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
              # doesn't have to be reachable
              s.connect(("10.255.255.255", 1))
              host_ip = s.getsockname()[0]
  
      assert host_ip is not None
      return host_ip
  
imports: import socket
  import struct
  import logging
  from threading import Thread
  import argparse
  import sys
  from typing import Dict, List, Tuple, Union, Optional, Set
label_desc: Use image node_id 3 for calling a global function with example usage: get_host_ip(host_ip) and returns: host_ip