code: def test_crop_bboxes_from_image(geoms, mock_image_path):
      num_crops = 3
  
      with pytest.raises(ValueError):
          utils.crop_bboxes_from_image(
              mock_image_path, geoms=np.zeros((3, 1))
          )
  
      with pytest.raises(FileNotFoundError):
          utils.crop_bboxes_from_image("123", geoms=np.zeros((2, 4)))
  
      cropped_imgs = utils.crop_bboxes_from_image(
          mock_image_path, geoms=geoms
      )
      # Number of crops
      assert len(cropped_imgs) == num_crops
      # Data type and shape
      assert all(isinstance(crop, np.ndarray) for crop in cropped_imgs)
      assert all(crop.ndim == 3 for crop in cropped_imgs)
  
file_path: doctr/tests/common/test_datasets_utils.py
imports: import numpy
  import pytest
  from doctr.datasets import utils
label_desc: Use image node_id 8 for calling a global function with example usage: test_crop_bboxes_from_image(geoms, mock_image_path) without return types