code: def create_fb_format(outpath, dtype, inpath, inpath2):
      print("building fbformat:" + dtype)
      fout = open(os.path.join(outpath, dtype + ".txt"), "w")
      with PathManager.open(inpath + ".tsv") as f:
          lines = [line.strip("\n") for line in f]
      if inpath2 is None:
          fname_ans = inpath + ".ans"
      else:
          fname_ans = inpath2
      with PathManager.open(fname_ans) as f:
          ans = [line.strip("\n") for line in f]
      for i in range(len(lines)):
          l = lines[i].split("\t")
          off = 3
          for j in range(4):
              ai = ans[i].split("\t")[j]
              if ai == "A":
                  ai = 0
              if ai == "B":
                  ai = 1
              if ai == "C":
                  ai = 2
              if ai == "D":
                  ai = 3
              a = l[off + 1 + ai]
              s = (
                  "1 "
                  + l[2]
                  + " "
                  + l[off]
                  + "\t"
                  + a
                  + "\t\t"
                  + l[off + 1]
                  + "|"
                  + l[off + 2]
                  + "|"
                  + l[off + 3]
                  + "|"
                  + l[off + 4]
              )
              off = off + 5
              fout.write(s + "\n")
      fout.close()
  
imports: import parlai.core.build_data
  from parlai.utils.io import PathManager
  import os
  from parlai.core.build_data import DownloadableFile
label_desc: Use image node_id 1 for calling a global function with example usage: create_fb_format(outpath, dtype, inpath, inpath2) without return types