class_docstr: Teacher for spoken two-person dialogues with labels being responses for the previous
  statement.
  
  The data is traversed twice (doubled), once for modelling USER replies and once for
  modelling ASSISTANT replies.
class_docstr_tok: ["Teacher","for","spoken","two-person","dialogues","with","labels","being","responses","for","the","previous","statement",".","The","data","is","traversed","twice","(","doubled",")",",","once","for","modelling","USER","replies","and","once","for","modelling","ASSISTANT","replies","."]
code: def _setup_data(self, data_path, opt):
      print("loading: " + data_path)
      with PathManager.open(data_path) as data_file:
          self.convos = json.load(data_file)
      # Pre-processing
      convos_update = []
      for convo in self.convos:
          conversation, corrupted = tm_utils.smoothen_convo(convo, opt)
          # Filter out single greet messages and corrupted examples
          if len(conversation) > 1 and not corrupted:
              actual_ep_idx = len(self.ep_cheat_sheet)
              self.ep_cheat_sheet[
                  actual_ep_idx
              ] = tm_utils.gen_ep_cheatsheet(conversation)
              curr_cheatsheet = self.ep_cheat_sheet[
                  len(self.ep_cheat_sheet) - 1
              ]
              # calc number of examples (done here to prevent double counting if done later)
              self.num_ex += (
                  curr_cheatsheet[tm_utils.USER_NUM_EX]
                  + curr_cheatsheet[tm_utils.ASSIS_NUM_EX]
              )
              # User example exists
              if curr_cheatsheet[tm_utils.USER_NUM_EX] != 0:
                  u_idx = len(self.episode_map["U"])
                  self.episode_map["U"][u_idx] = actual_ep_idx
              # Assistant example exists
              if curr_cheatsheet[tm_utils.ASSIS_NUM_EX] != 0:
                  a_idx = len(self.episode_map["A"])
                  self.episode_map["A"][a_idx] = actual_ep_idx
              convos_update += [conversation]
      self.convos = convos_update
  
imports: from parlai.core.params import ParlaiParser
  import os
  import pandas
  from parlai.core.opt import Opt
  import parlai.core.tod.tod_core
  from typing import Optional
  from parlai.utils.data import DatatypeHelper
  from parlai.utils.io import PathManager
  import parlai.tasks.taskmaster.build
  import parlai.core.tod.tod_agents
  from parlai.core.teachers import FixedDialogTeacher
  from .None import tm_utils
  import json
label_desc: Use image node_id 3 for calling the WozDialogueTeacher obj's underlying member method code with example usage: obj._setup_data(data_path, opt) without return types