code: def check_same_n_vertices(mesh_1: PolyMesh, mesh_2: PolyMesh) -> None:
      """Check that 2 meshes have the same keys and that n vertices match."""
      keys_1, keys_2 = set(mesh_1.keys()), set(mesh_2.keys())
      if keys_1 != keys_2:
          diff = keys_1.symmetric_difference(keys_2)
          raise ValueError(
              "Meshes do not have the same keys. "
              f"Offending keys: {diff}"
          )
      for key in keys_1:
          if mesh_1[key].n_vertices != mesh_2[key].n_vertices:
              raise ValueError(
                  f"Number of vertices do not match for '{key}'."
                  f"number of vertices in mesh_1: {mesh_1[key].n_vertices}; "
                  f"in mesh_2: {mesh_2[key].n_vertices}"
              )
  
imports: from __future__ import annotations
  from typing import Any
  import numpy
  import pandas
  from joblib import Memory
  from sklearn.base import BaseEstimator, TransformerMixin
  from nilearn import signal
  from nilearn._utils.cache_mixin import CacheMixin, cache
  from nilearn._utils.class_inspect import get_params
  from nilearn.experimental.surface._surface_image import PolyMesh, SurfaceImage
label_desc: Use image node_id 1 for calling a global function with example usage: check_same_n_vertices(mesh_1, mesh_2) without return types