code: def test_resampling_fill_value(affine_eye, shape, value, rng):
      """Test resampling with a non-zero fill value
  
      Check on 3D and 4D data.
      """
      data = rng.uniform(size=shape)
  
      angle = np.pi / 4
      rot = rotation(0, angle)
  
      if value:
          rot_img = resample_img(
              Nifti1Image(data, affine_eye),
              target_affine=rot,
              interpolation="nearest",
              fill_value=value,
              clip=False,
          )
      else:
          rot_img = resample_img(
              Nifti1Image(data, affine_eye),
              target_affine=rot,
              interpolation="nearest",
              clip=False,
          )
  
      assert get_data(rot_img).flatten()[0] == value
  
      rot_img2 = resample_to_img(
          Nifti1Image(data, affine_eye),
          rot_img,
          interpolation="nearest",
          fill_value=value,
      )
  
      assert get_data(rot_img2).flatten()[0] == value
  
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 8 for calling a global function with example usage: test_resampling_fill_value(affine_eye, shape, value, rng) without return types