code: def dummy_img(odir_txt, odir_img):
      for name in os.listdir(odir_txt):
          with open(os.path.join(odir_txt, name), "rt") as reader_txt:
              length = sum(1 for _ in reader_txt)
          os.makedirs(
              os.path.join(odir_img, os.path.splitext(name)[0]),
              exist_ok=False,
          )
          for i in range(length):
              with open(
                  os.path.join(
                      odir_img,
                      os.path.splitext(name)[0],
                      f"{str(i).zfill(4)}.img",
                  ),
                  "wb",
              ) as writer_img:
                  # 32 * 32 - 1 to induce preprocessing 0-index padding
                  writer_img.write(
                      bytes(
                          [
                              random.randint(0, 255)
                              for _ in range(32 * 32 - 1)
                          ]
                      )
                  )
  
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 1 for calling a global function with example usage: dummy_img(odir_txt, odir_img) without return types