code: def _update_coordinate_descent(
      X, W, Ht, l1_reg, l2_reg, shuffle, random_state
  ):
      """Helper function for _fit_coordinate_descent
  
      Update W to minimize the objective function, iterating once over all
      coordinates. By symmetry, to update H, one can call
      _update_coordinate_descent(X.T, Ht, W, ...)
  
      """
      n_components = Ht.shape[1]
  
      HHt = fast_dot(Ht.T, Ht)
      XHt = safe_sparse_dot(X, Ht)
  
      # L2 regularization corresponds to increase of the diagonal of HHt
      if l2_reg != 0.0:
          # adds l2_reg only on the diagonal
          HHt.flat[:: n_components + 1] += l2_reg
      # L1 regularization corresponds to decrease of each element of XHt
      if l1_reg != 0.0:
          XHt -= l1_reg
  
      if shuffle:
          permutation = random_state.permutation(n_components)
      else:
          permutation = np.arange(n_components)
      # The following seems to be required on 64-bit Windows w/ Python 3.5.
      permutation = np.asarray(permutation, dtype=np.intp)
      return _update_cdnmf_fast(W, HHt, XHt, permutation)
  
imports: from __future__ import division, print_function
  from math import sqrt
  import warnings
  import numbers
  import numpy
  import scipy.sparse
  from ..base import BaseEstimator, TransformerMixin
  from ..utils import check_random_state, check_array
  from ..utils.extmath import randomized_svd, safe_sparse_dot, squared_norm
  from ..utils.extmath import fast_dot
  from ..utils.validation import check_is_fitted, check_non_negative
  from ..utils import deprecated
  from ..exceptions import ConvergenceWarning
  from .cdnmf_fast import _update_cdnmf_fast
label_desc: Use image node_id 13 for calling a global function with example usage: _update_coordinate_descent(X, W, Ht, l1_reg, l2_reg, shuffle, random_state) and returns: _update_cdnmf_fast