code: def test_mesh_to_plotly(hemi):
      """Tests for function mesh_to_plotly."""
      fsaverage = fetch_surf_fsaverage()
      coord, triangles = load_surf_mesh(fsaverage[f"pial_{hemi}"])
      plotly = mesh_to_plotly(fsaverage[f"pial_{hemi}"])
      for i, key in enumerate(["_x", "_y", "_z"]):
          assert np.allclose(decode(plotly[key], "<f4"), coord[:, i])
      for i, key in enumerate(["_i", "_j", "_k"]):
          assert np.allclose(
              decode(plotly[key], "<i4"), triangles[:, i]
          )
  
imports: import base64
  import os
  import re
  import tempfile
  import numpy
  import pytest
  from nilearn.datasets import fetch_surf_fsaverage
  from nilearn.plotting.js_plotting_utils import add_js_lib, colorscale, decode, encode, get_html_template, mesh_to_plotly, to_color_strings
  from nilearn.surface import load_surf_mesh
label_desc: Use image node_id 11 for calling a global function with example usage: test_mesh_to_plotly(hemi) without return types