code: def _check_data_consistent_shape(data: PolyData):
      """Check that shapes of PolyData parts match.
  
      They must match in all but the last dimension (which is the number of
      vertices, and can be different for each part).
  
      """
      if len(data) == 0:
          raise ValueError(
              "Surface image data must have at least one item."
          )
      first_name = next(iter(data.keys()))
      first_shape = data[first_name].shape
      for part_name, part_data in data.items():
          if part_data.shape[:-1] != first_shape[:-1]:
              raise ValueError(
                  f"Data arrays for keys '{first_name}' and '{part_name}' "
                  "have incompatible shapes: "
                  f"{first_shape} and {part_data.shape}"
              )
  
imports: from __future__ import annotations
  import abc
  import dataclasses
  import pathlib
  from typing import Dict
  import numpy
  from nilearn.experimental.surface import _io
label_desc: Use image node_id 1 for calling a global function with example usage: _check_data_consistent_shape(data) without return types