code: def test_sampling_affine(affine_eye):
      # check sampled (projected) values on a toy image
      img = np.ones((4, 4, 4))
      img[1, :, :] = 2
      nodes = [[1, 1, 2], [10, 10, 20], [30, 30, 30]]
      mesh = [np.asarray(nodes), None]
      affine = 10 * affine_eye
      affine[-1, -1] = 1
      texture = surface._nearest_voxel_sampling(
          [img], mesh, affine=affine, radius=1, kind="ball"
      )
      assert_array_equal(texture[0], [1.0, 2.0, 1.0])
      texture = surface._interpolation_sampling(
          [img], mesh, affine=affine, radius=0, kind="ball"
      )
      assert_array_almost_equal(texture[0], [1.1, 2.0, 1.0])
  
imports: import os
  import tempfile
  import warnings
  import nibabel
  import numpy
  import pytest
  from nibabel import gifti
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from scipy.spatial import Delaunay
  from scipy.stats import pearsonr
  from nilearn import datasets, image
  from nilearn._utils import data_gen
  from nilearn.image import resampling
  from nilearn.surface import Mesh, Surface, load_surf_data, load_surf_mesh, surface
  from nilearn.surface.surface import _gifti_img_to_mesh, _load_surf_files_gifti_gzip
  from nilearn.surface.tests._testing import flat_mesh, generate_surf, z_const_img
label_desc: Use image node_id 28 for calling a global function with example usage: test_sampling_affine(affine_eye) without return types