code: def test_decimate_surface_sphere():
      """Test sphere mode of decimation."""
      pytest.importorskip("nibabel")
      rr, tris = _tessellate_sphere(3)
      assert len(rr) == 66
      assert len(tris) == 128
      for kind, n_tri in [("ico", 20), ("oct", 32)]:
          with catch_logging() as log:
              _, tris_new = decimate_surface(
                  rr, tris, n_tri, method="sphere", verbose=True
              )
          log = log.getvalue()
          assert "Freesurfer" in log
          assert kind in log
          assert len(tris_new) == n_tri
  
imports: from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal, assert_equal
  from mne import decimate_surface, dig_mri_distances, get_montage_volume_labels, pick_types, read_surface, write_surface
  from mne._fiff.constants import FIFF
  from mne.channels import make_dig_montage
  from mne.datasets import testing
  from mne.io import read_info
  from mne.surface import _compute_nearest, _get_ico_surface, _marching_cubes, _normal_orth, _project_onto_surface, _read_patch, _tessellate_sphere, _voxel_neighbors, fast_cross_3d, get_head_surf, get_meg_helmet_surf, read_curvature
  from mne.transforms import _get_trans
  from mne.utils import _record_warnings, catch_logging, object_diff, requires_freesurfer
label_desc: Use image node_id 8 for calling a global function with example usage: test_decimate_surface_sphere() without return types