code: def _parse_cmd_line_args():
      """Parse CMD args, returns an object instance of all user passed in args"""
      parser = argparse.ArgumentParser(
          description="Takes all notebooks "
          "this in `gallery` directory, and will upload it to the specified "
          "portal/org in the right group with the right categories. "
          "(default is geosaurus.maps.arcgis.com, 'Esri Sample Notebooks' group)",
          formatter_class=argparse.RawTextHelpFormatter,
      )
      parser.add_argument(
          "--username",
          "-u",
          type=str,
          help="Required username for the portal/org",
      )
      parser.add_argument(
          "--password",
          "-p",
          type=str,
          help="Required password for the portal/org",
      )
      parser.add_argument(
          "--portal-url",
          "-r",
          type=str,
          help="The portal to connect to (Default:geosaurus.maps.arcgis.com)",
          default="https://geosaurus.maps.arcgis.com/",
      )
      parser.add_argument(
          "--verbose",
          "-v",
          action="store_true",
          help="Print all DEBUG log messages instead of just INFO",
      )
      parser.add_argument(
          "--replace-profiles",
          "-c",
          action="store_true",
          help="Replace all profiles in notebooks with their appropriate username "
          "and passwords. Does this by running misc/tools/replace_profiles.py",
      )
      args = parser.parse_args(
          sys.argv[1:]
      )  # don't use filename as 1st arg
      return args
  
imports: import os
  import sys
  import argparse
  import traceback
  import json
  import re
  import logging
  import yaml
  import nbformat
  from nbconvert import HTMLExporter
  from arcgis.gis import GIS
label_desc: Use image node_id 2 for calling a global function with example usage: _parse_cmd_line_args() and returns: args