code: def test__data_generator():
      dataloader = _init_dataloader(imdir=IMAGE_DIR, recursive=False)
      all_filenames, ims_arr, all_bad_images = _iterate_over_dataloader(
          dataloader
      )
      all_ims = torch.stack(ims_arr)
      assert all_ims.shape == tuple([10, 3, 224, 224])
      assert len(all_filenames) == 10  # 10 images in the directory
      assert len(all_bad_images) == 0
  
file_path: imagededup/tests/test_data_generator.py
imports: from pathlib import Path, PurePath
  from typing import List, Tuple
  import torch
  from imagededup.methods import CNN
  from imagededup.utils.data_generator import img_dataloader
label_desc: Use image node_id 3 for calling a global function with example usage: test__data_generator() without return types