code: def test_4d_affine_bounding_box_error(affine_eye):
      bigger_data = np.zeros([10, 10, 10])
      bigger_img = Nifti1Image(bigger_data, affine_eye)
  
      small_data = np.ones([4, 4, 4])
      small_data_4D_affine = affine_eye
      small_data_4D_affine[:3, -1] = np.array([5, 4, 5])
      small_img = Nifti1Image(small_data, small_data_4D_affine)
  
      # We would like to check whether all/most of the data
      # will be contained in the resampled image
      # The measure will be the l2 norm, since some resampling
      # schemes approximately conserve it
  
      def l2_norm(arr):
          return (arr**2).sum()
  
      # resample using 4D affine and specified target shape
      small_to_big_with_shape = resample_img(
          small_img,
          target_affine=bigger_img.affine,
          target_shape=bigger_img.shape,
      )
      # resample using 3D affine and no target shape
      small_to_big_without_shape_3D_affine = resample_img(
          small_img, target_affine=bigger_img.affine[:3, :3]
      )
      # resample using 4D affine and no target shape
      small_to_big_without_shape = resample_img(
          small_img, target_affine=bigger_img.affine
      )
  
      # The first 2 should pass
      assert_almost_equal(
          l2_norm(small_data),
          l2_norm(get_data(small_to_big_with_shape)),
      )
      assert_almost_equal(
          l2_norm(small_data),
          l2_norm(get_data(small_to_big_without_shape_3D_affine)),
      )
  
      # After correcting decision tree for 4x4 affine given + no target shape
      # from "use initial shape" to "calculate minimal bounding box respecting
      # the affine anchor and the data"
      assert_almost_equal(
          l2_norm(small_data),
          l2_norm(get_data(small_to_big_without_shape)),
      )
  
      assert_array_equal(
          small_to_big_without_shape.shape,
          small_data_4D_affine[:3, -1] + np.array(small_img.shape),
      )
  
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 15 for calling a global function with example usage: test_4d_affine_bounding_box_error(affine_eye) and returns: unknown