class_docstr: This onboarding world displays a sample conversation with checkboxes of the same
  annotations as in the real HIT, but it is not a live conversation (all utterances
  are displayed at once).
  
  constants.py has the task data with correct answers in json form
  (opt['onboard_task_data']). User gets to try again onboard_failures_max_allowed
  times and is soft banned if they fail more than that.
class_docstr_tok: ["This","onboarding","world","displays","a","sample","conversation","with","checkboxes","of","the","same","annotations","as","in","the","real","HIT",",","but","it","is","not","a","live","conversation","(","all","utterances","are","displayed","at","once",")",".","constants.py","has","the","task","data","with","correct","answers","in","json","form","(","opt","[","'onboard_task_data","'","]",")",".","User","gets","to","try","again","onboard_failures_max_allowed","times","and","is","soft","banned","if","they","fail","more","than","that","."]
code: def parley(self):
      if not self.skip_onboarding:
          print(
              f"{self.__class__.__name__}: starting parley for worker_id: {self.worker_id}"
          )
  
          # We are rendering a frontend based on the initial task data, so we just
          # wait for the results to come in
          act = self.agent.act(timeout=self.max_onboard_time)
          self.status = self._handle_act(act)
          self.agent.observe(
              {"id": "SYSTEM", "text": "", "final_status": self.status}
          )
          if self.status == ONBOARD_FAIL:
              start_time = time.time()
              # After soft ban, we just block in while loop until worker goes
              # away (Disconnects or returns the HIT as asked on the frontend)
              while time.time() - start_time < self.max_onboard_time:
                  _ = self.agent.act(timeout=self.max_onboard_time)
                  time.sleep(0.5)
          return None
  
      else:
          self.episodeDone = True  # Send the user directly to the HIT
          self.status = ONBOARD_SUCCESS  # Approve user by default
          self.agent.observe(
              {"id": "SYSTEM", "text": "", "final_status": self.status}
          )
  
imports: import time
  import os
  import json
  from abc import ABC, abstractmethod
  from typing import Any, Dict, List, Optional, Tuple
  import numpy
  from parlai.core.agents import create_agent_from_shared
  from parlai.core.message import Message
  from parlai.core.worlds import validate
  from parlai.crowdsourcing.utils.acceptability import AcceptabilityChecker
  from parlai.crowdsourcing.utils.worlds import CrowdOnboardWorld, CrowdTaskWorld
  from parlai.crowdsourcing.tasks.model_chat.bot_agent import TurkLikeAgent
  from parlai.crowdsourcing.tasks.model_chat.constants import ONBOARD_FAIL, ONBOARD_SUCCESS
  from parlai.crowdsourcing.tasks.model_chat.utils import Compatibility
  from parlai.crowdsourcing.utils.mturk import get_mturk_id_from_mephisto_wrapper
  from typing import TYPE_CHECKING
label_desc: Use image node_id 2 for calling the ModelChatOnboardWorld obj's underlying member method code with example usage: obj.parley() and returns: None