code: def mnist_drifted_datasets(
      mnist_visiondata_train, mnist_visiondata_test
  ):  # pylint: disable=redefined-outer-name
      full_mnist = torch.utils.data.ConcatDataset(
          [
              mnist_visiondata_train.batch_loader.dataset,
              mnist_visiondata_test.batch_loader.dataset,
          ]
      )
      set_seeds(42)
      train_dataset, test_dataset, _ = torch.utils.data.random_split(
          full_mnist, [1000, 500, 68500], generator=torch.Generator()
      )
      model = load_mnist_model(pretrained=True)
  
      def collate_drifted(data):
          raw_images = torch.stack([x[0] for x in data])
          labels = [x[1] for x in data]
  
          modified_labels, modified_raw_images = [], []
          for raw_image, label in zip(raw_images, labels):
              if label == 0 and np.random.randint(4) != 0:
                  modified_labels.append(2)
                  modified_raw_images.append(raw_image)
              elif label == 1 and np.random.randint(3) != 0:
                  pass
              else:
                  modified_labels.append(label)
                  modified_raw_images.append(raw_image)
          modified_raw_images = torch.stack(modified_raw_images)
          predictions = model(modified_raw_images)
          predictions[:, 0] = 0
          images = modified_raw_images.permute(0, 2, 3, 1)
          images = un_normalize_batch(
              images, mean=(0.1307,), std=(0.3081,)
          )
          return {
              "images": images,
              "labels": modified_labels,
              "predictions": predictions,
          }
  
      mod_train_loader = torch.utils.data.DataLoader(
          train_dataset,
          batch_size=64,
          collate_fn=mnist_deepchecks_collate(model),
      )
      mod_test_loader = torch.utils.data.DataLoader(
          test_dataset, batch_size=64, collate_fn=collate_drifted
      )
      mod_train_ds = VisionData(
          mod_train_loader, task_type=TaskType.CLASSIFICATION.value
      )
      mod_test_ds = VisionData(
          mod_test_loader, task_type=TaskType.CLASSIFICATION.value
      )
      return mod_train_ds, mod_test_ds
  
imports: import pathlib
  import numpy
  import pytest
  import torch
  from torch.utils.data import DataLoader, Dataset
  from deepchecks.vision.context import Context
  from deepchecks.vision.datasets.classification.mnist_torch import collate_without_model
  from deepchecks.vision.datasets.classification.mnist_torch import deepchecks_collate
  from deepchecks.vision.datasets.classification.mnist_torch import load_dataset
  from deepchecks.vision.datasets.classification.mnist_torch import load_model
  from deepchecks.vision.datasets.detection import coco_tensorflow
  from deepchecks.vision.datasets.detection.coco_torch import collate_without_model
  from deepchecks.vision.datasets.detection.coco_torch import load_dataset
  from deepchecks.vision.datasets.segmentation.segmentation_coco import load_dataset
  from deepchecks.vision.utils.test_utils import replace_collate_fn_dataloader, replace_collate_fn_visiondata, un_normalize_batch
  from deepchecks.vision.vision_data import TaskType, VisionData
  from deepchecks.vision.vision_data.batch_wrapper import BatchWrapper
  from deepchecks.vision.vision_data.utils import set_seeds
label_desc: Use image node_id 9 for calling a global function with example usage: mnist_drifted_datasets(mnist_visiondata_train, mnist_visiondata_test) and returns: mod_train_ds,  mod_test_ds, dict