code: def format_args(args):
      # set default public path according to API mode option
      if args.public_path is None:
          args.public_path = (
              "" if args.api_only else default_public_path
          )
      else:
          args.public_path = args.public_path.rstrip("/")
  
      # don't open browser in API mode
      if args.api_only:
          args.open_browser = False
  
      # set host to localhost if host is not set
      if not args.host:
          args.host = get_host(args.host, args.port)
  
      return args
  
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 3 for calling a global function with example usage: format_args(args) and returns: args