code: def _main():
      """Parses arguments, connects to GIS, reads YAML, uploads NBs"""
      args = _parse_cmd_line_args()
      _setup_logging(args)
      gis = GIS(
          args.portal_url,
          args.username,
          args.password,
          verify_cert=False,
      )
      items_metadata_yaml = _read_items_metadata_yaml()
      if args.replace_profiles:
          _replace_profiles()
      s = ItemsUploader(gis, items_metadata_yaml)
      s.upload_items()
      if s.failed_uploads:
          raise Exception(f"Some uploads failed: {s.failed_uploads}")
  
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 1 for calling a global function with example usage: _main() without return types