code: def create_fb_format(outpath, dtype, inpath):
      print("building fbformat:" + dtype)
      with PathManager.open(inpath) as data_file:
          data = json.load(data_file)
      fout = open(os.path.join(outpath, dtype + ".txt"), "w")
      for i in range(len(data)):
          q = data[i]["utterance"]
          a = parse_ans(data[i]["targetValue"])
          s = "1 " + q + "\t" + a
          fout.write(s + "\n")
      fout.close()
  
file_path: ParlAI/parlai/tasks/webquestions/build.py
imports: import parlai.core.build_data
  import json
  import os
  import re
  from parlai.core.build_data import DownloadableFile
  from parlai.utils.io import PathManager
label_desc: Use image node_id 2 for calling a global function with example usage: create_fb_format(outpath, dtype, inpath) without return types