code: def validate_args(args):
      # if not in API mode, public path cannot be set to root path
      if not args.api_only and args.public_path == "/":
          logger.error("Public path cannot be set to root path.")
          sys.exit(-1)
  
      # public path must start with `/`
      if (
          args.public_path is not None
          and not args.public_path.startswith("/")
      ):
          logger.error("Public path should always start with a `/`.")
          sys.exit(-1)
  
      # theme not support
      if args.theme is not None and args.theme not in support_themes:
          logger.error("Theme {} is not support.".format(args.theme))
          sys.exit(-1)
  
      # input unsupported component tab name
      supported_tabs = [
          "scalar",
          "image",
          "text",
          "embeddings",
          "audio",
          "histogram",
          "hyper_parameters",
          "static_graph",
          "dynamic_graph",
          "pr_curve",
          "roc_curve",
          "profiler",
          "x2paddle",
          "fastdeploy_server",
          "fastdeploy_client",
      ]
      if args.component_tabs is not None:
          for component_tab in args.component_tabs:
              if component_tab not in supported_tabs:
                  logger.error(
                      "Component_tab {} is not support. Please choose tabs in {}".format(
                          component_tab, supported_tabs
                      )
                  )
                  sys.exit(-1)
  
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 2 for calling a global function with example usage: validate_args(args) without return types