code: def load_dataset_test(mock_download_and_extract_archive):
      def verify(loader):
          assert_that(loader, instance_of(DataLoader))
          assert_that(loader.dataset, instance_of(CocoDataset))
          assert_that(loader.dataset.train is True)
          assert_that((COCO_DIR / "coco128" / "images").exists())
          assert_that((COCO_DIR / "coco128" / "labels").exists())
  
      if not (COCO_DIR / "coco128").exists():
          loader = load_dataset(train=True, object_type="DataLoader")
          verify(loader)
          mock_download_and_extract_archive.reset_mock()
          load_dataset_test(mock_download_and_extract_archive)
      else:
          # verifying that downloaded prev data was used and not re-downloaded
          loader = load_dataset(train=True, object_type="DataLoader")
          assert_that(
              mock_download_and_extract_archive.called, is_(False)
          )
          verify(loader)
          assert_that(loader, instance_of(DataLoader))
  
file_path: deepchecks/tests/vision/datasets/test_coco_torch.py
imports: from unittest.mock import patch
  from hamcrest import assert_that, calling, instance_of, is_, raises
  from torch.utils.data import DataLoader
  from deepchecks import vision
  from deepchecks.vision.datasets.detection.coco_torch import COCO_DIR, CocoDataset, load_dataset
  from deepchecks.vision.datasets.detection.coco_utils import download_coco128
label_desc: Use image node_id 2 for calling a global function with example usage: load_dataset_test(mock_download_and_extract_archive) without return types