code: def check_generic_args(args):
      """
      Perform assertions on generic command-line arguments.
      """
  
      # check types and values:
      assert is_pos_int(args.visdom_port), "incorrect visdom port"
  
      # create checkpoint folder if it does not exist:
      if args.checkpoint_folder != "" and not os.path.exists(
          args.checkpoint_folder
      ):
          os.makedirs(args.checkpoint_folder, exist_ok=True)
          assert os.path.exists(args.checkpoint_folder), (
              "could not create folder %s" % args.checkpoint_folder
          )
  
      # when in debugging mode, enter debugger upon error:
      if args.debug:
          import sys
  
          from classy_vision.generic.debug import debug_info
  
          sys.excepthook = debug_info
  
      # check visdom server name:
      if args.visdom_server != "":
          if args.visdom_server.startswith("https://"):
              print("WARNING: Visdom does not work over HTTPS.")
              args.visdom_server = args.visdom_server[8:]
          if not args.visdom_server.startswith("http://"):
              args.visdom_server = "http://%s" % args.visdom_server
  
      # return input arguments:
      return args
  
imports: import argparse
  import os
  from classy_vision.generic.util import is_pos_int
label_desc: Use image node_id 2 for calling a global function with example usage: check_generic_args(args) and returns: args