code: def _check_n_matrices(X, n_matrices):
      """Check number of matrices in ndarray."""
      if X.shape[0] != n_matrices:
          raise ValueError(
              "Unequal n_matrices between ndarray of X. Should be %d but"
              " got %d." % (n_matrices, X.shape[0])
          )
  
imports: import numpy
  from joblib import Parallel, delayed
  from scipy.stats import norm, chi2
  import sklearn
  from sklearn.base import BaseEstimator, ClassifierMixin, TransformerMixin, ClusterMixin, clone
  from sklearn.cluster import KMeans
  from .classification import MDM, _check_metric
  from .utils.mean import mean_covariance
  from .utils.geodesic import geodesic
label_desc: Use image node_id 3 for calling a global function with example usage: _check_n_matrices(X, n_matrices) without return types