def METHOD_NAME(args):
    api_key = None
    if args.api_key is not None and len(args.api_key) > 0:
        api_key = args.api_key
    # MANDATORY. Define the listening address of ZAP instance
    zap_proxy = {"http": "http://127.0.0.1:8080", "https": "http://127.0.0.1:8080"}
    if args.zap_url is not None and len(args.zap_url) > 0:
        zap_proxy = {
            "http": "http://" + args.zap_url,
            "https": "http://" + args.zap_url,
        }
    logging.info(":: Configuring ZAP Instance with %s", zap_proxy)
    # Connect ZAP API client to the listening address of ZAP instance
    zap = ZAPv2(proxies=zap_proxy, apikey=api_key)
    logging.info(
        ":: Starting SCB ZAP Automation Framework with config %s", args.config_folder
    )
    zap_automation = ZapAutomation(
        zap=zap,
        config_dir=args.config_folder,
        target=args.target,
        forced_context=args.context,
    )
    try:
        logging.info(":: Starting SCB ZAP Scan with target %s", args.target)
        zap_automation.scan_target(target=args.target)
        alerts = zap_automation.get_zap_scanner.get_alerts(args.target, [], [])
        logging.info(":: Found ZAP Alerts: %s", str(len(alerts)))
        summary = zap.alert.alerts_summary(baseurl=args.target)
        logging.info(":: ZAP Alerts Summary: %s", str(summary))
        zap_automation.generate_report_file(
            file_path=args.output_folder, report_type=args.report_type
        )
        zap_automation.zap_shutdown()
        logging.info(":: Finished !")
    except argparse.ArgumentError as e:
        logging.exception(f"Argument error: {e}")
        sys.exit(1)
    except Exception as e:
        logging.exception(f"Unexpected error: {e}")
        zap_automation.zap_shutdown()
        sys.exit(3)