def METHOD_NAME(
    prod_dir: str, username: str = "admin@nvidia.com", secure_mode: bool = True, timeout_in_sec: int = 30
):
    admin_user_dir = os.path.join(prod_dir, username)
    print("connect to nvflare server")
    sess = None
    conn_timeout = 10
    try:
        sess = Session(username=username, startup_path=admin_user_dir, secure_mode=secure_mode)
        sess.try_connect(conn_timeout)
        shutdown_system_by_session(sess=sess, timeout_in_sec=timeout_in_sec)
    except NoConnection:
        # system is already shutdown
        return
    finally:
        if sess:
            sess.close()