code: def check_surface(surface):
      """Load a surface as a Surface object.
  
      This function will make sure that the surfaces's
      mesh and data have compatible shapes.
  
      Parameters
      ----------
      surface : Surface-like (see description)
          The surface to be loaded.
          A surface can be:
              - a nilearn.surface.Surface
              - a sequence (:term:`mesh`, data) where:
                  - :term:`mesh` can be:
                      - a nilearn.surface.Mesh
                      - a path to .gii or .gii.gz etc.
                      - a sequence of two numpy arrays,
                      the first containing :term:`vertex` coordinates
                      and the second containing triangles.
                  - data can be:
                      - a path to .gii or .gii.gz etc.
                      - a numpy array with shape (n_vertices,)
                      or (n_time_points, n_vertices)
  
      Returns
      -------
      surface : Surface
          Checked surface object.
  
      """
      surface = load_surface(surface)
      mesh, data = check_mesh_and_data(surface.mesh, surface.data)
      return Surface(mesh, data)
  
imports: import gzip
  import os
  import warnings
  from collections import namedtuple
  from collections.abc import Mapping
  import nibabel
  import numpy
  import sklearn.cluster
  import sklearn.preprocessing
  from nibabel import freesurfer, gifti
  from scipy import interpolate, sparse
  from nilearn import _utils, datasets
  from nilearn._utils import stringify_path
  from nilearn._utils.path_finding import resolve_globbing
  from nilearn.image import get_data, load_img, resampling
label_desc: Use image node_id 25 for calling a global function with example usage: check_surface(surface) and returns: Surface