code: def _collate_fn(batch: List[Dict]) -> Tuple[torch.tensor, str, str]:
      ims, filenames, bad_images = [], [], []
  
      for b in batch:
          im = b["image"]
          if im is not None:
              ims.append(im)
              filenames.append(b["filename"])
          else:
              bad_images.append(b["filename"])
      return torch.stack(ims), filenames, bad_images
  
file_path: imagededup/imagededup/utils/data_generator.py
imports: from pathlib import PurePath
  from typing import Dict, Callable, Optional, List, Tuple
  import numpy
  import torch
  from torch.utils.data import Dataset, DataLoader
  from imagededup.utils.image_utils import load_image
  from imagededup.utils.general_utils import generate_files
label_desc: Use image node_id 1 for calling a global function with example usage: _collate_fn(batch) and returns: torch,  filenames,  bad_images