code: def consolidate_wiki_data(dpath: str):
      all_articles = {}
      src_dir = os.path.join(dpath, "WikiData")
      for f_name in tqdm(os.listdir(src_dir)):
          with open(os.path.join(src_dir, f_name)) as f:
              wiki_page = json.load(f)
          idx = wiki_page["wikiDocumentIdx"]
          all_articles[idx] = wiki_page
      dest_path = os.path.join(dpath, "wiki_data.json")
      with open(dest_path, "w") as d:
          json.dump(all_articles, d, indent=2)
      shutil.rmtree(src_dir)
  
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 3 for calling a global function with example usage: consolidate_wiki_data(dpath) without return types