code: def test_detection_data_bad_batch_to_label_implementation(
      coco_dataloader_train,
  ):
      # Arrange
      loader_empty_batch = replace_collate_fn_dataloader(
          coco_dataloader_train, lambda x: {"labels": []}
      )
      loader_classification_shape = replace_collate_fn_dataloader(
          coco_dataloader_train, lambda x: {"labels": [8]}
      )
      loader_good_shape = replace_collate_fn_dataloader(
          coco_dataloader_train,
          lambda x: {"labels": [torch.Tensor([])]},
      )
      loader_incorrect_shape = replace_collate_fn_dataloader(
          coco_dataloader_train,
          lambda x: {"labels": [torch.Tensor([[1, 2], [1, 2]])]},
      )
  
      # Assert
      assert_that(
          calling(VisionData).with_args(
              loader_empty_batch, TaskType.OBJECT_DETECTION.value
          ),
          raises(
              ValidationError,
              "The batch labels must be a non empty iterable.",
          ),
      )
      assert_that(
          calling(VisionData).with_args(
              loader_classification_shape,
              TaskType.OBJECT_DETECTION.value,
          ),
          raises(
              ValidationError,
              "label for object_detection per image must be a multi dimensional array.",
          ),
      )
      VisionData(
          loader_good_shape, TaskType.OBJECT_DETECTION.value
      )  # should not raise error
      assert_that(
          calling(VisionData).with_args(
              loader_incorrect_shape, TaskType.OBJECT_DETECTION.value
          ),
          raises(
              ValidationError,
              r"Object detection label per image must be a sequence of 2D arrays, where each row has 5 "
              r"columns: \[class_id, x_min, y_min, width, height\]",
          ),
      )
  
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 11 for calling a global function with example usage: test_detection_data_bad_batch_to_label_implementation(coco_dataloader_train) without return types