code: def build(datapath, use_history):
      dpath = os.path.join(datapath, "OpenSubtitles2018")
      if not use_history:
          dpath += "_no_history"
      version = "1"
  
      if not build_data.built(dpath, version_string=version):
          print("[building data: " + dpath + "]")
          if build_data.built(dpath):
              # An older version exists, so remove these outdated files.
              build_data.remove_dir(dpath)
          build_data.make_dir(dpath)
  
          untar_path = os.path.join(dpath, "OpenSubtitles", "xml", "en")
  
          if (
              len(glob.glob(untar_path + "/*/*/*.xml"))
              != NUM_SUBTITLES_FILES
          ):
              # Download the data.
              for downloadable_file in RESOURCES:
                  downloadable_file.download_file(dpath)
  
          create_fb_format(untar_path, dpath, use_history)
  
          # Mark the data as built.
          build_data.mark_done(dpath, version_string=version)
      return dpath
  
imports: import parlai.core.build_data
  import glob
  import gzip
  import multiprocessing
  import os
  import re
  import sys
  import time
  import tqdm
  import xml.etree.ElementTree
  from parlai.core.build_data import DownloadableFile
  from parlai.utils.io import PathManager
label_desc: Use image node_id 12 for calling a global function with example usage: build(datapath, use_history) and returns: dpath