code: def dataset_build(self, opt):
      try:
          prepare_transforms_vocabs(opt, {})
      except SystemExit as err:
          print(err)
      except IOError as err:
          if opt.skip_empty_level != "error":
              raise err
          else:
              print(f"Catched IOError: {err}")
      finally:
          # Remove the generated *pt files.
          for pt in glob.glob(SAVE_DATA_PREFIX + "*.pt"):
              os.remove(pt)
          if self.opt.save_data:
              # Remove the generated data samples
              sample_path = os.path.join(
                  os.path.dirname(self.opt.save_data), CorpusName.SAMPLE
              )
              if os.path.exists(sample_path):
                  for f in glob.glob(sample_path + "/*"):
                      os.remove(f)
                  os.rmdir(sample_path)
  
file_path: OpenNMT-py/onmt/tests/test_data_prepare.py
imports: import copy
  import unittest
  import glob
  import os
  from onmt.utils.parse import ArgumentParser
  from onmt.opts import data_prepare_opts
  from onmt.train_single import prepare_transforms_vocabs
  from onmt.constants import CorpusName
label_desc: Use image node_id 2 for calling the TestData obj's underlying member method code with example usage: obj.dataset_build(opt) without return types