code: def __iter__(self):
      for _ in range(self.__len__()):
          batch = []
          texts_in_batch = set()
  
          while len(batch) < self.batch_size:
              example = self.train_examples[self.data_pointer]
  
              valid_example = True
              for text in example.texts:
                  if text.strip().lower() in texts_in_batch:
                      valid_example = False
                      break
  
              if valid_example:
                  batch.append(example)
                  for text in example.texts:
                      texts_in_batch.add(text.strip().lower())
  
              self.data_pointer += 1
              if self.data_pointer >= len(self.train_examples):
                  self.data_pointer = 0
                  random.shuffle(self.train_examples)
  
          yield self.collate_fn(
              batch
          ) if self.collate_fn is not None else batch
  
imports: import random
  import math
label_desc: Use image node_id 2 for calling the NoDuplicatesDataLoader obj's underlying member method code with example usage: obj.__iter__() without return types