code: def convert_file(input_file_path):
      print("Reading gzip file {}.".format(input_file_path))
      with gzip.open(input_file_path) as f:
          records = json.load(f)
      n = len(records["passages"].keys())
      for i in tqdm.tqdm(range(n), "Converting"):
          newline_dict = {}
          index = str(i)
          if "test" not in input_file_path:
              newline_dict["answers"] = records["answers"][index]
              newline_dict["wellFormedAnswers"] = records[
                  "wellFormedAnswers"
              ][index]
          newline_dict["passages"] = records["passages"][index]
          newline_dict["query"] = records["query"][index]
          newline_dict["query_id"] = records["query_id"][index]
          newline_dict["query_type"] = records["query_type"][index]
          yield newline_dict
  
file_path: ParlAI/parlai/tasks/ms_marco/build.py
imports: import gzip
  import json
  import os
  import tqdm
  import parlai.core.build_data
  from parlai.utils.io import PathManager
  from parlai.core.build_data import DownloadableFile
label_desc: Use image node_id 2 for calling a global function with example usage: convert_file(input_file_path) without return types