code: def get_data_gen(image_files=None):
      import imagededup.utils.data_generator as data_generator
  
      orig_datagen = data_generator.DataGenerator
  
      class PathNoName(PosixPath):
          @property
          def name(self):
              return str(self)
  
      class DataGenerator(orig_datagen):
          def _get_image_files(self) -> None:
              self.invalid_image_idx = []
              if image_files:
                  self.image_files = [
                      PathNoName(i) for i in image_files
                  ]
              else:
                  self.image_files = sorted(
                      [
                          PathNoName(i.absolute())
                          for i in self.image_dir.rglob("*.jpg")
                          if not i.name.startswith(".")
                      ]
                  )  # ignore hidden files
  
      return DataGenerator
  
file_path: gluon-cv/gluoncv/torch/data/gluoncv_motion_dataset/ingestion/duplicate_remover.py
imports: import logging
  from pathlib import Path, PosixPath
  from collections import defaultdict
  import tqdm
  from ..dataset import GluonCVMotionDataset, get_vis_thumb_location
  from ..utils.ingestion_utils import get_chunked_id_map
label_desc: Use image node_id 1 for calling a global function with example usage: get_data_gen(image_files) and returns: DataGenerator, str