code: def test_gifti_img_to_mesh():
      mesh = generate_surf()
  
      coord_array = gifti.GiftiDataArray(
          data=mesh[0], datatype="NIFTI_TYPE_FLOAT32"
      )
      coord_array.intent = nb.nifti1.intent_codes[
          "NIFTI_INTENT_POINTSET"
      ]
  
      face_array = gifti.GiftiDataArray(
          data=mesh[1], datatype="NIFTI_TYPE_FLOAT32"
      )
      face_array.intent = nb.nifti1.intent_codes[
          "NIFTI_INTENT_TRIANGLE"
      ]
  
      gii = gifti.GiftiImage(darrays=[coord_array, face_array])
      coords, faces = _gifti_img_to_mesh(gii)
      assert_array_equal(coords, mesh[0])
      assert_array_equal(faces, mesh[1])
  
imports: import os
  import tempfile
  import warnings
  import nibabel
  import numpy
  import pytest
  from nibabel import gifti
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from scipy.spatial import Delaunay
  from scipy.stats import pearsonr
  from nilearn import datasets, image
  from nilearn._utils import data_gen
  from nilearn.image import resampling
  from nilearn.surface import Mesh, Surface, load_surf_data, load_surf_mesh, surface
  from nilearn.surface.surface import _gifti_img_to_mesh, _load_surf_files_gifti_gzip
  from nilearn.surface.tests._testing import flat_mesh, generate_surf, z_const_img
label_desc: Use image node_id 10 for calling a global function with example usage: test_gifti_img_to_mesh() without return types