def METHOD_NAME(last_settings_data: dict) -> tuple:
    if (
        (not last_settings_data)
        or ("SESSION_ORDER" not in last_settings_data.keys())
        or (last_settings_data["SESSION_ORDER"] is None)
    ):
        session_order = misc.draw_session_order()
        session_idx = 0
    elif "SESSION_ORDER" in last_settings_data.keys():
        session_order = last_settings_data["SESSION_ORDER"]
        session_idx = (last_settings_data["SESSION_IDX"] + 1) % N_PREGENERATED_SESSIONS
    return session_order, session_idx