importargparsefromoffice365.sharepoint.client_contextimportClientContextfromtests.settingsimportclient_id,password,site_url,tenant,usernamedefmain():argparse.ArgumentParser(description="List alerts for the current user").parse_args()ctx=ClientContext(site_url).with_username_and_password(tenant=tenant,client_id=client_id,username=username,password=password)alerts=ctx.web.current_user.alerts.get().execute_query()print(f"Alerts for the current user ({len(alerts)}):")forainalerts:title=a.properties.get("Title","?")alert_type=a.properties.get("AlertType","?")frequency=a.alert_frequencyprint(f" {title} (type: {alert_type}, frequency: {frequency})")if__name__=="__main__":main()