code: def test_vision_cache_object_detection(coco_visiondata_train):
      # Act
      run_update_loop(coco_visiondata_train)
      expected_classes = [
          0.0,
          1.0,
          2.0,
          3.0,
          4.0,
          5.0,
          6.0,
          7.0,
          9.0,
          11.0,
          13.0,
          14.0,
          16.0,
          17.0,
          20.0,
          22.0,
          23.0,
          24.0,
          25.0,
          26.0,
          27.0,
          28.0,
          29.0,
          30.0,
          31.0,
          32.0,
          33.0,
          34.0,
          35.0,
          36.0,
          39.0,
          40.0,
          41.0,
          42.0,
          43.0,
          44.0,
          45.0,
          46.0,
          48.0,
          49.0,
          50.0,
          51.0,
          52.0,
          53.0,
          55.0,
          56.0,
          57.0,
          58.0,
          59.0,
          60.0,
          62.0,
          65.0,
          67.0,
          68.0,
          69.0,
          71.0,
          72.0,
          73.0,
          74.0,
          75.0,
          76.0,
          77.0,
          79.0,
      ]
  
      # Assert
      assert_that(
          coco_visiondata_train.number_of_images_cached,
          equal_to(len(coco_visiondata_train.batch_loader.dataset)),
      )
      assert_that(
          sorted(coco_visiondata_train.get_observed_classes()),
          equal_to(
              sorted(
                  coco_visiondata_train.label_map[x]
                  for x in expected_classes
              )
          ),
      )
  
      # ReAct and ReAssert
      coco_visiondata_train.init_cache()
      assert_that(
          coco_visiondata_train.number_of_images_cached, equal_to(0)
      )
      assert_that(
          len(coco_visiondata_train.get_observed_classes()), equal_to(0)
      )
  
imports: import numpy
  import pytest
  import torch
  from hamcrest import assert_that, calling, equal_to, has_length, is_not, raises
  from torch.utils.data import DataLoader
  from deepchecks.core.errors import DatasetValidationError, ValidationError
  from deepchecks.vision.datasets.classification.mnist_torch import IterableTorchMnistDataset, collate_without_model
  from deepchecks.vision.datasets.detection import coco_torch
  from deepchecks.vision.datasets.segmentation import segmentation_coco
  from deepchecks.vision.utils.test_utils import replace_collate_fn_dataloader
  from deepchecks.vision.vision_data import TaskType, VisionData
  from deepchecks.vision.vision_data.utils import validate_vision_data_compatibility
  from tests.vision.conftest import run_update_loop
label_desc: Use image node_id 8 for calling a global function with example usage: test_vision_cache_object_detection(coco_visiondata_train) without return types