def METHOD_NAME(sess: Session, timeout_in_sec: int = 20):
    print("checking running jobs")
    jobs = sess.list_jobs()
    active_job_ids = get_running_job_ids(jobs)
    if len(active_job_ids) > 0:
        print("Warning: current running jobs will be aborted")
        abort_jobs(sess, active_job_ids)
    print("shutdown NVFLARE")
    sess.api.do_command("shutdown all")
    wait_for_system_shutdown(sess, timeout_in_sec=timeout_in_sec)