code: def create_fb_format(outpath, dtype, inpath):
      print("building fbformat:" + dtype)
      with PathManager.open(
          os.path.join(outpath, dtype + ".txt"), "w"
      ) as fout:
          with PathManager.open(inpath) as f:
              lines = [line.strip("\n") for line in f]
              for i in range(len(lines)):
                  use = True
                  if dtype == "train" and (i % 20) == 0:
                      use = False
                  if dtype == "valid" and (i % 20) != 0:
                      use = False
                  if use:
                      xy = lines[i].split("OUT: ")
                      x = xy[0].split("IN: ")[1].rstrip(" ").lstrip(" ")
                      y = xy[1].rstrip(" ").lstrip(" ")
                      s = "1 " + x + "\t" + y
                      fout.write(s + "\n\n")
  
imports: import parlai.core.build_data
  import os
  from parlai.core.build_data import DownloadableFile
  from parlai.utils.io import PathManager
label_desc: Use image node_id 1 for calling a global function with example usage: create_fb_format(outpath, dtype, inpath) without return types