code: def create_static_predictions(
      train: VisionData, test: VisionData, model
  ):
      static_preds = []
      for vision_data in [train, test]:
          if vision_data is not None:
              static_pred = {}
              for i, batch in enumerate(vision_data):
                  predictions = vision_data.infer_on_batch(
                      batch, model, device
                  )
                  indexes = list(vision_data.data_loader.batch_sampler)[
                      i
                  ]
                  static_pred.update(dict(zip(indexes, predictions)))
          else:
              static_pred = None
          static_preds.append(static_pred)
      train_preds, tests_preds = static_preds
      return train_preds, tests_preds
  
file_path: deepchecks/benchmarks/vision_bench.py
imports: from typing import Callable
  import torch
  from deepchecks.core.errors import DeepchecksBaseError
  from deepchecks.vision import SingleDatasetCheck, TrainTestCheck
  from deepchecks.vision.datasets.classification import mnist_torch
  from deepchecks.vision.datasets.detection import coco_torch
  from deepchecks.vision.vision_data import VisionData
label_desc: Use image node_id 1 for calling a global function with example usage: create_static_predictions(train, test, model) and returns: train_preds,  tests_preds