code: def test_raises_bbox_error_if_data_outside_box(affine_eye):
      """Make some cases which should raise exceptions"""
      # original image
      data = np.zeros([8, 9, 10])
      affine_offset = np.array([1, 1, 1])
      affine = affine_eye
      affine[:3, 3] = affine_offset
      img = Nifti1Image(data, affine)
  
      # some axis flipping affines
      diag = [
          [-1, 1, 1, 1],
          [1, -1, 1, 1],
          [1, 1, -1, 1],
          [-1, -1, 1, 1],
          [-1, 1, -1, 1],
          [1, -1, -1, 1],
      ]
      axis_flips = np.array(list(map(np.diag, diag)))
  
      # some in plane 90 degree rotations base on these
      # (by permuting two lines)
      af = axis_flips
      rotations = np.array(
          [
              af[0][[1, 0, 2, 3]],
              af[0][[2, 1, 0, 3]],
              af[1][[1, 0, 2, 3]],
              af[1][[0, 2, 1, 3]],
              af[2][[2, 1, 0, 3]],
              af[2][[0, 2, 1, 3]],
          ]
      )
  
      new_affines = np.concatenate([axis_flips, rotations])
      new_offset = np.array([0.0, 0.0, 0.0])
      new_affines[:, :3, 3] = new_offset[np.newaxis, :]
  
      exception = BoundingBoxError
      message = (
          "The field of view given "
          "by the target affine does "
          "not contain any of the data"
      )
      for new_affine in new_affines:
          with pytest.raises(exception, match=message):
              resample_img(img, target_affine=new_affine)
  
imports: import copy
  import math
  import os
  from pathlib import Path
  import numpy
  import pytest
  from nibabel import Nifti1Header, Nifti1Image
  from nibabel.freesurfer import MGHImage
  from numpy.testing import assert_allclose, assert_almost_equal, assert_array_almost_equal, assert_array_equal, assert_equal
  from nilearn import _utils
  from nilearn._utils import testing
  from nilearn.conftest import _affine_eye, _rng
  from nilearn.image import get_data
  from nilearn.image.image import _pad_array, crop_img
  from nilearn.image.resampling import BoundingBoxError, coord_transform, from_matrix_vector, get_bounds, reorder_img, resample_img, resample_to_img
label_desc: Use image node_id 18 for calling a global function with example usage: test_raises_bbox_error_if_data_outside_box(affine_eye) without return types