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: Save the data via dumping to a json file.
  
  :param data:
      list of episodes
docstr_tok: ["Save","the","data","via","dumping","to","a","json","file",".",":","param","data",":","list","of","episodes"]
code: def save_data(self, data: List[List[Message]]):
      """
      Save the data via dumping to a json file.
  
      :param data:
          list of episodes
      """
      try:
          json_data = json.dumps(data)
          with PathManager.open(self.save_path, "w") as f:
              f.write(json_data)
          logging.info(
              f"[ Data successfully saved to path: {self.save_path} ]"
          )
      except Exception:
          logging.warning("Data is not json serializable; not saving")
  
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 9 for calling the ControllableTaskTeacher obj's underlying member method code with example usage: obj.save_data(data) without return types