code: def split_into_seen_unseen(dpath: str):
      """
      Following WoW, we have overlap in train, valid, and test seen but none in test
      unseen. Do an 80:10:5:5 split between train, valid, test_seen, test_unseen or as
      close to it.
  
      ~205 documents for test_unseen to do this, and movies 1 and 3 have 90 and 117
      movies, respectively, which is about that
      """
      random.seed(42)
      cdir = os.path.join(dpath, "conversations")
      new = {
          "train": {},
          "valid": {},
          "test_seen": {},
          "test_unseen": {},
      }
      for fold in ["test", "valid", "train"]:
          with PathManager.open(
              os.path.join(cdir, f"{fold}_deduped.json")
          ) as f:
              data = json.load(f)
          for k, v in data.items():
              if v["wikiDocumentIdx"] == 1 or v["wikiDocumentIdx"] == 3:
                  new["test_unseen"][k] = v
              else:
                  rand = random.randint(1, 95)
                  if rand <= 80:
                      new["train"][k] = v
                  elif rand <= 90:
                      new["valid"][k] = v
                  else:
                      new["test_seen"][k] = v
  
      for fold in new:
          with PathManager.open(
              os.path.join(cdir, f"{fold}_split_seen_unseen.json"), "w+"
          ) as f:
              json.dump(new[fold], f, indent=2)
          c_cnt = len(new[fold])
          logger.info(f"Seen/unseen {fold} conversation count: {c_cnt}")
  
file_path: ParlAI/parlai/tasks/cmu_dog/build.py
imports: import json
  import os
  import random
  import shutil
  from tqdm import tqdm
  import parlai.core.build_data
  from parlai.core.build_data import DownloadableFile
  from parlai.utils.io import PathManager
  from parlai.utils.logging import logger
label_desc: Use image node_id 7 for calling a global function with example usage: split_into_seen_unseen(dpath) without return types