code: def _fold_utterances(raw_dialog):
      dialog = []
      for utterance in raw_dialog:
          if (
              len(dialog) > 0
              and dialog[-1]["userId"] == utterance["userId"]
          ):
              dialog[-1]["text"] = (
                  dialog[-1]["text"] + "\n" + utterance["text"]
              )
          else:
              dialog.append(
                  {
                      "text": utterance["text"],
                      "userId": utterance["userId"],
                  }
              )
      return dialog
  
file_path: ParlAI/parlai/tasks/convai_chitchat/agents.py
imports: from .build import build
  from parlai.core.teachers import DialogTeacher
  from parlai.utils.io import PathManager
  import json
  import os
label_desc: Use image node_id 3 for calling the DefaultTeacher obj's underlying member method code with example usage: obj._fold_utterances(raw_dialog) and returns: dialog