code: def _class_means(X, y):
      """Compute class means.
  
      Parameters
      ----------
      X : array-like, shape (n_samples, n_features)
          Input data.
  
      y : array-like, shape (n_samples,) or (n_samples, n_targets)
          Target values.
  
      Returns
      -------
      means : array-like, shape (n_features,)
          Class means.
      """
      means = []
      classes = np.unique(y)
      for group in classes:
          Xg = X[y == group, :]
          means.append(Xg.mean(0))
      return np.asarray(means)
  
imports: from __future__ import print_function
  import warnings
  import numpy
  from scipy import linalg
  from .externals.six import string_types
  from .externals.six.moves import xrange
  from .base import BaseEstimator, TransformerMixin, ClassifierMixin
  from .linear_model.base import LinearClassifierMixin
  from .covariance import ledoit_wolf, empirical_covariance, shrunk_covariance
  from .utils.multiclass import unique_labels
  from .utils import check_array, check_X_y
  from .utils.validation import check_is_fitted
  from .utils.fixes import bincount
  from .utils.multiclass import check_classification_targets
  from .preprocessing import StandardScaler
label_desc: Use image node_id 2 for calling a global function with example usage: _class_means(X, y) and returns: np