class_docstr: Generates a controllable_gen version of a ParlAI task, i.e., for tasks with multi-
  turn dialogues (episodes), this will generate a task with single example episodes,
  in which we append to the context a special classification token.
class_docstr_tok: ["Generates","a","controllable_gen","version","of","a","ParlAI","task",",","i.e.",",","for","tasks","with","multi-","turn","dialogues","(","episodes",")",",","this","will","generate","a","task","with","single","example","episodes",",","in","which","we","append","to","the","context","a","special","classification","token","."]
docstr: Return a flattened example.
  
  If using a fixed control, put that in instead of what was originally in the text.
  
  :param episode_idx:
      index of ep in data
  :param entry_idx:
      index of ex in ep
  
  :return ex:
      return an example
docstr_tok: ["Return","a","flattened","example",".","If","using","a","fixed","control",",","put","that","in","instead","of","what","was","originally","in","the","text",".",":","param","episode_idx",":","index","of","ep","in","data",":","param","entry_idx",":","index","of","ex","in","ep",":","return","ex",":","return","an","example"]
code: def get(self, episode_idx: int, entry_idx: int = 0) -> Message:
      """
      Return a flattened example.
  
      If using a fixed control, put that in instead of what was originally in the text.
  
      :param episode_idx:
          index of ep in data
      :param entry_idx:
          index of ex in ep
  
      :return ex:
          return an example
      """
      ex = Message(self.data[episode_idx])
  
      if self.opt["fixed_control"] != "":
          old_text = " ".join(ex["text"].split(" ")[:-1])
          text = f"{old_text} {self.opt['fixed_control']}"
          ex.force_set("text", text)
  
      return ex
  
imports: from parlai.core.params import ParlaiParser
  from parlai.core.message import Message
  from parlai.core.opt import Opt
  from parlai.core.teachers import FixedDialogTeacher
  from parlai.utils.io import PathManager
  import parlai.utils.logging
  from parlai.utils.typing import TShared
  from parlai.tasks.genderation_bias.build import build
  from parlai.tasks.genderation_bias.utils import flatten_and_classify, get_original_task_module
  from copy import deepcopy
  import datetime
  import glob
  import json
  import os
  from tqdm import tqdm
  from typing import List, Optional, Tuple
label_desc: Use image node_id 10 for calling the ControllableTaskTeacher obj's underlying member method code with example usage: obj.get(episode_idx, entry_idx) and returns: ex