code: def test_resample_clip(affine_eye):
      # Resample and image and get larger and smaller
      # value than in the original. Use clip to get rid of these images
  
      shape = (6, 3, 6)
      data = np.zeros(shape=shape)
      data[1:-2, 1:-1, 1:-2] = 1
  
      source_affine = np.diag((2, 2, 2, 1))
      source_img = Nifti1Image(data, source_affine)
  
      no_clip_data = get_data(
          resample_img(source_img, target_affine=affine_eye, clip=False)
      )
      clip_data = get_data(
          resample_img(source_img, target_affine=affine_eye, clip=True)
      )
  
      not_clip = np.where(
          (no_clip_data > data.min()) & (no_clip_data < data.max())
      )
  
      assert np.any(no_clip_data > data.max())
      assert np.any(no_clip_data < data.min())
      assert np.all(clip_data <= data.max())
      assert np.all(clip_data >= data.min())
      assert_array_equal(no_clip_data[not_clip], clip_data[not_clip])
  
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 25 for calling a global function with example usage: test_resample_clip(affine_eye) without return types