code: def _setup_data(self):
      fpath = os.path.join(self.opt["datapath"], "CCPE", "ccpe.json")
  
      with PathManager.open(fpath, "r") as infile:
          json_data = json.load(infile)
  
      flattenedData = []
      for ep in range(len(json_data)):
          currEp = []
          entry = {}
          currSegments = []
          for i, utterance in enumerate(json_data[ep]["utterances"]):
              if (
                  i < len(json_data[ep]["utterances"]) - 1
                  and json_data[ep]["utterances"][i + 1]["speaker"]
                  == utterance["speaker"]
              ):
                  json_data[ep]["utterances"][i + 1]["text"] = (
                      utterance["text"]
                      + "\n"
                      + json_data[ep]["utterances"][i + 1]["text"]
                  )
                  currSegments.append(
                      utterance["segments"]
                      if "segments" in utterance
                      else []
                  )
                  continue
  
              if (
                  i == len(json_data[ep]["utterances"]) - 1
                  or json_data[ep]["utterances"][i + 1]["speaker"]
                  != utterance["speaker"]
              ):
                  entry["speaker"] = utterance["speaker"]
                  entry["text"] = utterance["text"]
                  currSegments.append(
                      utterance["segments"]
                  ) if "segments" in utterance else currSegments.append(
                      []
                  )
                  entry["segments"] = currSegments
                  currEp.append(entry)
                  entry = {}
                  currSegments = []
  
          flattenedData.append(currEp)
  
      self.userData = []
      self.assistantData = []
  
      for ep in range(len(flattenedData)):
          currUserEp = []
          currAssistantEp = []
  
          userCnt = 0
          asssistantCnt = 0
          for i, currUtt in enumerate(flattenedData[ep]):
              if i > 0:
                  if (
                      currUtt["speaker"] == "USER"
                      and flattenedData[ep][i - 1]["speaker"]
                      == "ASSISTANT"
                  ):
                      entry = []
                      entry.append(userCnt)
                      entry.append(currUtt["text"])
                      entry.append([flattenedData[ep][i - 1]["text"]])
                      entry.append(currUtt["segments"])
                      entry.append(flattenedData[ep][i - 1]["segments"])
                      entry.append(False)
                      currUserEp.append(entry)
                      userCnt += 1
                  if (
                      currUtt["speaker"] == "ASSISTANT"
                      and flattenedData[ep][i - 1]["speaker"] == "USER"
                  ):
                      entry = []
                      entry.append(asssistantCnt)
                      entry.append(currUtt["text"])
                      entry.append([flattenedData[ep][i - 1]["text"]])
                      entry.append(currUtt["segments"])
                      entry.append(flattenedData[ep][i - 1]["segments"])
                      entry.append(False)
                      currAssistantEp.append(entry)
                      asssistantCnt += 1
  
          currUserEp[-1][5] = True
          currAssistantEp[-1][5] = True
          self.userData.append(currUserEp)
          self.assistantData.append(currAssistantEp)
  
      self.data = self.assistantData + self.userData
  
file_path: ParlAI/parlai/tasks/ccpe/agents.py
imports: from parlai.core.teachers import FixedDialogTeacher
  from parlai.utils.io import PathManager
  from .build import build
  import os
  import json
label_desc: Use image node_id 4 for calling the CCPEAllTeacher obj's underlying member method code with example usage: obj._setup_data() without return types