code: def run_check_fn(check_class) -> Callable:
      def run(self, cache, dataset_name):
          train_ds, test_ds, train_pred, test_pred = cache[dataset_name]
          check = check_class()
          try:
              if isinstance(check, SingleDatasetCheck):
                  check.run(
                      train_ds,
                      train_predictions=train_pred,
                      device=device,
                  )
              elif isinstance(check, TrainTestCheck):
                  check.run(
                      train_ds,
                      test_ds,
                      train_predictions=train_pred,
                      test_predictions=test_pred,
                      device=device,
                  )
          except DeepchecksBaseError:
              pass
  
      return run
  
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 2 for calling a global function with example usage: run_check_fn(check_class) and returns: run