code: def _estimate_gaussian_covariances_diag(
      resp, X, nk, means, reg_covar
  ):
      """Estimate the diagonal covariance vectors.
  
      Parameters
      ----------
      responsibilities : array-like, shape (n_samples, n_components)
  
      X : array-like, shape (n_samples, n_features)
  
      nk : array-like, shape (n_components,)
  
      means : array-like, shape (n_components, n_features)
  
      reg_covar : float
  
      Returns
      -------
      covariances : array, shape (n_components, n_features)
          The covariance vector of the current components.
      """
      avg_X2 = np.dot(resp.T, X * X) / nk[:, np.newaxis]
      avg_means2 = means**2
      avg_X_means = means * np.dot(resp.T, X) / nk[:, np.newaxis]
      return avg_X2 - 2 * avg_X_means + avg_means2 + reg_covar
  
imports: import numpy
  from scipy import linalg
  from .base import BaseMixture, _check_shape
  from ..externals.six.moves import zip
  from ..utils import check_array
  from ..utils.validation import check_is_fitted
  from ..utils.extmath import row_norms
label_desc: Use image node_id 9 for calling a global function with example usage: _estimate_gaussian_covariances_diag(resp, X, nk, means, reg_covar) and returns: unknown