code: def validate_onboarding(data):
      """
      Check the contents of the data to ensure they are valid.
      """
      logging.info(f"Validating onboarding data {data}")
      messages = data["outputs"]["messages"]
      if len(messages) == 0:
          return False
      status_message = messages[-2]
      if status_message is None:
          return False
      final_status = status_message.get("final_status")
      return final_status == ONBOARD_SUCCESS
  
imports: import random
  import parlai.utils.logging
  from typing import Any, Dict, Optional
  from parlai.core.agents import create_agent_from_shared
  from parlai.core.message import Message
  from parlai.core.worlds import validate
  from parlai.crowdsourcing.tasks.model_chat.constants import ONBOARD_SUCCESS
  from parlai.crowdsourcing.tasks.model_chat.utils import Compatibility
  from parlai.crowdsourcing.tasks.model_chat.worlds import BaseModelChatWorld, ModelChatWorld, ModelChatOnboardWorld
  from parlai.crowdsourcing.utils.acceptability import AcceptabilityChecker
  from parlai.crowdsourcing.utils.mturk import get_mturk_id_from_mephisto_wrapper
  from parlai.crowdsourcing.tasks.pairwise_per_turn_eval.bot_agent import PerTurnEvalTurkLikeAgent
label_desc: Use image node_id 2 for calling a global function with example usage: validate_onboarding(data) and returns: unknown, False, False