code: def get_host(host=default_host, port=default_port):
      if not host:
          host = socket.getfqdn()
          try:
              socket.create_connection((host, port), timeout=1)
          except socket.error:
              host = "localhost"
      return host
  
file_path: VisualDL/visualdl/server/args.py
imports: import socket
  import sys
  from argparse import ArgumentParser
  from visualdl import __version__
  from visualdl.server.log import init_logger
  from visualdl.server.log import logger
label_desc: Use image node_id 1 for calling a global function with example usage: get_host(host, port) and returns: host