code: def test_nifti_spheres_masker_overlap(rng):
      # Test resampling in NiftiMapsMasker
      affine = np.eye(4)
      shape = (5, 5, 5)
  
      data = rng.random(shape + (5,))
      fmri_img = nibabel.Nifti1Image(data, affine)
  
      seeds = [(0, 0, 0), (2, 2, 2)]
  
      overlapping_masker = NiftiSpheresMasker(
          seeds, radius=1, allow_overlap=True
      )
      overlapping_masker.fit_transform(fmri_img)
      overlapping_masker = NiftiSpheresMasker(
          seeds, radius=2, allow_overlap=True
      )
      overlapping_masker.fit_transform(fmri_img)
  
      noverlapping_masker = NiftiSpheresMasker(
          seeds, radius=1, allow_overlap=False
      )
      noverlapping_masker.fit_transform(fmri_img)
      noverlapping_masker = NiftiSpheresMasker(
          seeds, radius=2, allow_overlap=False
      )
      with pytest.raises(ValueError, match="Overlap detected"):
          noverlapping_masker.fit_transform(fmri_img)
  
imports: import warnings
  import nibabel
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from nilearn._utils import data_gen
  from nilearn.image import get_data, new_img_like
  from nilearn.maskers import NiftiSpheresMasker
label_desc: Use image node_id 5 for calling a global function with example usage: test_nifti_spheres_masker_overlap(rng) without return types