code: def test_sample_locations_between_surfaces(
      depth, n_points, affine_eye
  ):
      inner = flat_mesh(5, 7)
      outer = inner[0] + [0.0, 0.0, 1.0], inner[1]
  
      locations = surface._sample_locations_between_surfaces(
          outer, inner, affine_eye, n_points=n_points, depth=depth
      )
  
      if depth is None:
          expected = np.asarray(
              [
                  np.linspace(b, a, n_points)
                  for (a, b) in zip(inner[0].ravel(), outer[0].ravel())
              ]
          )
          expected = np.rollaxis(
              expected.reshape((*outer[0].shape, n_points)), 2, 1
          )
  
      else:
          offsets = [[0.0, 0.0, -z] for z in depth]
          expected = np.asarray(
              [vertex + offsets for vertex in outer[0]]
          )
  
      assert np.allclose(locations, expected)
  
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 23 for calling a global function with example usage: test_sample_locations_between_surfaces(depth, n_points, affine_eye) without return types