code: def _iterate_over_dataloader(
      dataloader: torch.utils.data.DataLoader,
  ) -> Tuple[List, List, List]:
      all_filenames, ims_arr, all_bad_images = [], [], []
  
      for ims, filenames, bad_images in dataloader:
          ims_arr.extend(ims)
          all_filenames.extend(filenames)
          all_bad_images.extend(bad_images)
  
      return all_filenames, ims_arr, all_bad_images
  
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 2 for calling a global function with example usage: _iterate_over_dataloader(dataloader) and returns: all_filenames,  ims_arr,  all_bad_images