class_docstr: Generates contexts shown to bots for generating prompt when collecting human-human
  followup chat in the personal knowledge human evaluation.
  
  This generator was used to generate the context information shown to bots at the
  beginning of a conversation, when crowdsourcing the conversations that for per-turn
  human evaluation.
class_docstr_tok: ["Generates","contexts","shown","to","bots","for","generating","prompt","when","collecting","human-human","followup","chat","in","the","personal","knowledge","human","evaluation",".","This","generator","was","used","to","generate","the","context","information","shown","to","bots","at","the","beginning","of","a","conversation",",","when","crowdsourcing","the","conversations","that","for","per-turn","human","evaluation","."]
docstr: For the given ConvAI2 conversation, return strings of both speakers' personas.
docstr_tok: ["For","the","given","ConvAI2","conversation",",","return","strings","of","both","speakers","'","personas","."]
code: def _extract_personas(self, initial_data_index: str) -> dict:
      """
      For the given ConvAI2 conversation, return strings of both speakers' personas.
      """
      ui_first_entry = self.ui_sorted_initial_data_indices_to_episode[
          initial_data_index
      ][0]
      bot_first_entry = self.bot_sorted_initial_data_indices_to_episode[
          initial_data_index
      ][0]
  
      ui_context = ui_first_entry["text"].split("\n")
      your_persona_strings = []
      their_persona_strings = []
      for str_ in ui_context[
          :-1
      ]:  # The last string is the first utterance
          if str_.startswith(
              "your persona: "
          ):  # Here, "you" are Person 2
              your_persona_strings.append(str_[len("your persona: ") :])
          elif str_.startswith("partner's persona: "):
              their_persona_strings.append(
                  str_[len("partner's persona: ") :]
              )
      return {
          "context_dataset": bot_first_entry["id"],
          "your_persona_strings": your_persona_strings,
          "their_persona_strings": their_persona_strings,
          "context_for_bot_prompt": bot_first_entry["text"],
          "observation_for_bot": bot_first_entry,
          "time_num": bot_first_entry["time_num"],
          "time_unit": bot_first_entry["time_unit"],
      }
  
imports: from parlai.core.teachers import DialogTeacher
  from parlai.utils.io import PathManager
  from parlai.core.opt import Opt
  from parlai.utils.strings import normalize_reply
  from parlai.core.teachers import MultiTaskTeacher
  from .build import build
  import os
  import json
  from typing import Optional
  from parlai.core.params import ParlaiParser
  import copy
  import random
  import math
  from parlai.utils.logging import logger
  from parlai.core.message import Message
  import parlai.scripts.display_data
  from parlai.tasks.convai2.agents import NormalizedTeacherTrait, SelfOriginalTeacher
  from parlai.tasks.blended_skill_talk.agents import ContextGenerator
  from parlai.tasks.msc.constants import INITIAL_DATA_TO_COMPLETE, MODEL_OPT, UI_OPT, COMMON_CONFIG
  import parlai.tasks.msc.mutators
label_desc: Use image node_id 4 for calling the ContextGenerator obj's underlying member method code with example usage: obj._extract_personas(initial_data_index) and returns: dict