code: def _check_dimensions(X, Y, Cref):
      """Check for matching dimensions in X, Y and Cref."""
      if not isinstance(Y, type(None)):
          assert Y.shape[1:] == X.shape[1:], (
              f"Dimension of matrices in Y must "
              f"match dimension of matrices in "
              f"X. Expected {X.shape[1:]}, got "
              f"{Y.shape[1:]}."
          )
  
      if not isinstance(Cref, type(None)):
          assert Cref.shape == X.shape[1:], (
              f"Dimension of Cref must match "
              f"dimension of matrices in X. "
              f"Expected {X.shape[1:]}, got "
              f"{Cref.shape}."
          )
  
file_path: pyRiemann/pyriemann/utils/kernel.py
imports: import numpy
  from .base import invsqrtm, logm
  from .mean import mean_riemann
label_desc: Use image node_id 4 for calling a global function with example usage: _check_dimensions(X, Y, Cref) without return types