code: def build_datasets(idir_txt, idir_img, odir, extra_args=[]):
      for name in os.listdir(idir_txt):
          sys.argv = [
              sys.argv[0],
              "--input",
              os.path.join(idir_txt, name),
              "--input-image",
              os.path.join(idir_img, os.path.splitext(name)[0]),
              "--output-prefix",
              os.path.join(odir, os.path.splitext(name)[0]),
          ] + extra_args
          build_main()
  
file_path: megatron-lm/tests/unit_tests/data/test_preprocess_mmdata.py
imports: import os
  import random
  import sys
  import tempfile
  import nltk
  import numpy
  from megatron.core.datasets.indexed_dataset import MMapIndexedDataset
  from tests.unit_tests.data.test_preprocess_data import dummy_jsonl, gpt2_vocab, gpt2_merge
  from tools.merge_datasets import main
  from tools.preprocess_mmdata import Encoder
  from tools.preprocess_mmdata import get_args
  from tools.preprocess_mmdata import main
label_desc: Use image node_id 2 for calling a global function with example usage: build_datasets(idir_txt, idir_img, odir, extra_args) without return types