code: def test_view_surf(rng):
      fsaverage = fetch_surf_fsaverage()
      mesh = surface.load_surf_mesh(fsaverage["pial_right"])
      surf_map = mesh[0][:, 0]
      html = html_surface.view_surf(
          fsaverage["pial_right"],
          surf_map,
          fsaverage["sulc_right"],
          "90%",
      )
      check_html(html, title="Surface plot")
      html = html_surface.view_surf(
          fsaverage["pial_right"],
          surf_map,
          fsaverage["sulc_right"],
          0.3,
          title="SOME_TITLE",
      )
      check_html(html, title="SOME_TITLE")
      assert "SOME_TITLE" in html.html
      html = html_surface.view_surf(fsaverage["pial_right"])
      check_html(html)
      atlas = rng.integers(0, 10, size=len(mesh[0]))
      html = html_surface.view_surf(
          fsaverage["pial_left"], atlas, symmetric_cmap=False
      )
      check_html(html)
      html = html_surface.view_surf(
          fsaverage["pial_right"],
          fsaverage["sulc_right"],
          threshold=None,
          cmap="Greys",
      )
      check_html(html)
      with pytest.raises(ValueError):
          html_surface.view_surf(mesh, mesh[0][::2, 0])
      with pytest.raises(ValueError):
          html_surface.view_surf(
              mesh, mesh[0][:, 0], bg_map=mesh[0][::2, 0]
          )
  
file_path: nilearn/nilearn/plotting/tests/test_html_surface.py
imports: import json
  import numpy
  import pytest
  from nilearn import datasets, image, surface
  from nilearn._utils.exceptions import DimensionError
  from nilearn.datasets import fetch_surf_fsaverage
  from nilearn.image import get_data
  from nilearn.plotting import html_surface
  from nilearn.plotting.js_plotting_utils import decode
  from .test_js_plotting_utils import check_colors, check_html
label_desc: Use image node_id 7 for calling a global function with example usage: test_view_surf(rng) without return types