code: def generate_collate_function_with_leakage_coco(collate_fn, mod):
      def collate_function_with_leakage_coco(batch):
          import numpy as np
  
          batch_dict = collate_fn(batch)
          images = batch_dict["images"]
          labels = batch_dict["labels"]
          ret = [np.array(x) for x in images]
          for i, labels in enumerate(labels):
              if i % mod != 0:
                  for label in labels:
                      x, y, w, h = np.array(label[1:]).astype(int)
                      ret[i][y : y + h, x : x + w] = (
                          ret[i][y : y + h, x : x + w] * int(label[0])
                      ).clip(min=200, max=255)
          batch_dict["images"] = ret
          return batch_dict
  
      return collate_function_with_leakage_coco
  
imports: import numpy
  from deepchecks.vision.checks import PropertyLabelCorrelationChange
  from deepchecks.vision.datasets.classification.mnist_torch import load_dataset
  from deepchecks.vision.datasets.detection.coco_torch import load_dataset
label_desc: Use image node_id 2 for calling a global function with example usage: generate_collate_function_with_leakage_coco(collate_fn, mod) and returns: collate_function_with_leakage_coco, batch_dict