code: def test_resample_identify_affine_int_translation(affine_eye, rng):
      source_shape = (6, 4, 6)
      source_affine = affine_eye
      source_affine[:, 3] = np.append(rng.integers(0, 4, 3), 1)
      source_data = rng.random(source_shape)
      source_img = Nifti1Image(source_data, source_affine)
  
      target_shape = (11, 10, 9)
      target_data = np.zeros(target_shape)
      target_affine = source_affine
      target_affine[:3, 3] -= 3  # add an offset of 3 in x, y, z
      target_data[
          3:9, 3:7, 3:9
      ] = source_data  # put the data at the offset location
      target_img = Nifti1Image(target_data, target_affine)
  
      result_img = resample_to_img(
          source_img, target_img, interpolation="nearest"
      )
      assert_almost_equal(get_data(target_img), get_data(result_img))
  
      result_img_2 = resample_to_img(
          result_img, source_img, interpolation="nearest"
      )
      assert_almost_equal(get_data(source_img), get_data(result_img_2))
  
      result_img_3 = resample_to_img(
          result_img,
          source_img,
          interpolation="nearest",
          force_resample=True,
      )
      assert_almost_equal(
          get_data(result_img_2), get_data(result_img_3)
      )
  
      result_img_4 = resample_to_img(
          source_img,
          target_img,
          interpolation="nearest",
          force_resample=True,
      )
      assert_almost_equal(get_data(target_img), get_data(result_img_4))
  
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 24 for calling a global function with example usage: test_resample_identify_affine_int_translation(affine_eye, rng) without return types