code: def format_chats_june_2020(chats):
      """
      June 2020 format involves storing location and choice in the dialogue, but complete
      human and bot personas as objects that need to be json loaded.
  
      Model name also contains the full fixed candidates path, when we're only truly
      interested in the filename.
      """
      for c in chats:
          c["dialogue"] = json.loads(
              c["dialogue"].replace("\\\\", "\\")
          )
          c["human_persona"] = json.loads(
              c["human_persona"].replace('\\\\"', '\\"')
          )
          c["bot_persona"] = json.loads(
              c["bot_persona"].replace('\\\\"', '\\"')
          )
          c["model_name"] = remove_cand_path(
              c["model_name"].replace('\\\\"', '\\"')
          )
      chats = [
          c
          for c in chats
          if c["dialogue"] is not None and len(c["dialogue"]) > 1
      ]
  
      # Parse the choice and location out from the dialogue
      for c in chats:
          last_chat = c["dialogue"][-1]
          if last_chat["type"] == "choice":
              c["choice"] = last_chat
              c["dialogue"] = c["dialogue"][:-1]
          else:
              c["choice"] = None
  
          c["location"] = c["dialogue"][0]
          c["dialogue"] = c["dialogue"][1:]
          c["score"] = int(c["score"])
          c["is_complete"] = c["choice"] is not None
          c["did_continue"] = (
              c["choice"] is not None and c["choice"]["text"] != "EXIT"
          )
  
          for t in c["dialogue"]:
              if len(t["text"].strip()) == 0:
                  t["text"] = "__SILENCE__"
  
      return chats
  
imports: import random
  import io
  import os
  import json
  from parlai.utils.misc import msg_to_str
label_desc: Use image node_id 13 for calling a global function with example usage: format_chats_june_2020(chats) and returns: chats