code: def test_plot_surf_contours():
      mesh = generate_surf()
      # we need a valid parcellation for testing
      parcellation = np.zeros((mesh[0].shape[0],))
      parcellation[mesh[1][3]] = 1
      parcellation[mesh[1][5]] = 2
      plot_surf_contours(mesh, parcellation)
      plot_surf_contours(mesh, parcellation, levels=[1, 2])
      plot_surf_contours(
          mesh, parcellation, levels=[1, 2], cmap="gist_ncar"
      )
      plot_surf_contours(
          mesh, parcellation, levels=[1, 2], colors=["r", "g"]
      )
      plot_surf_contours(
          mesh,
          parcellation,
          levels=[1, 2],
          colors=["r", "g"],
          labels=["1", "2"],
      )
      fig = plot_surf_contours(
          mesh,
          parcellation,
          levels=[1, 2],
          colors=["r", "g"],
          labels=["1", "2"],
          legend=True,
      )
      assert fig.legends is not None
      plot_surf_contours(
          mesh,
          parcellation,
          levels=[1, 2],
          colors=[[0, 0, 0, 1], [1, 1, 1, 1]],
      )
      fig, axes = plt.subplots(1, 1, subplot_kw={"projection": "3d"})
      plot_surf_contours(mesh, parcellation, axes=axes)
      plot_surf_contours(mesh, parcellation, figure=fig)
      fig = plot_surf(mesh)
      plot_surf_contours(mesh, parcellation, figure=fig)
      display = plot_surf_contours(
          mesh,
          parcellation,
          levels=[1, 2],
          labels=["1", "2"],
          colors=["r", "g"],
          legend=True,
          title="title",
          figure=fig,
      )
      # Non-regression assertion: we switched from _suptitle to axis title
      assert display._suptitle is None
      assert display.axes[0].get_title() == "title"
      fig = plot_surf(mesh, title="title 2")
      display = plot_surf_contours(
          mesh,
          parcellation,
          levels=[1, 2],
          labels=["1", "2"],
          colors=["r", "g"],
          legend=True,
          figure=fig,
      )
      # Non-regression assertion: we switched from _suptitle to axis title
      assert display._suptitle is None
      assert display.axes[0].get_title() == "title 2"
      with tempfile.NamedTemporaryFile() as tmp_file:
          plot_surf_contours(
              mesh, parcellation, output_file=tmp_file.name
          )
      plt.close()
  
imports: import re
  import tempfile
  import unittest.mock
  import matplotlib.pyplot
  import numpy
  import pytest
  from matplotlib.figure import Figure
  from numpy.testing import assert_array_equal
  from nilearn._utils.helpers import is_kaleido_installed, is_plotly_installed
  from nilearn.conftest import _rng
  from nilearn.datasets import fetch_surf_fsaverage
  from nilearn.plotting.displays import PlotlySurfaceFigure
  from nilearn.plotting.surf_plotting import VALID_HEMISPHERES, VALID_VIEWS, _compute_facecolors_matplotlib, _get_ticks_matplotlib, _get_view_plot_surf_matplotlib, _get_view_plot_surf_plotly, plot_img_on_surf, plot_surf, plot_surf_contours, plot_surf_roi, plot_surf_stat_map
  from nilearn.surface import load_surf_data, load_surf_mesh
  from nilearn.surface.tests._testing import generate_surf
label_desc: Use image node_id 41 for calling a global function with example usage: test_plot_surf_contours() without return types