code: def _update_projected_gradient_w(
      X,
      W,
      H,
      tolW,
      nls_max_iter,
      alpha,
      l1_ratio,
      sparseness,
      beta,
      eta,
  ):
      """Helper function for _fit_projected_gradient"""
      n_samples, n_features = X.shape
      n_components_ = H.shape[0]
  
      if sparseness is None:
          Wt, gradW, iterW = _nls_subproblem(
              X.T,
              H.T,
              W.T,
              tolW,
              nls_max_iter,
              alpha=alpha,
              l1_ratio=l1_ratio,
          )
      elif sparseness == "data":
          Wt, gradW, iterW = _nls_subproblem(
              safe_vstack([X.T, np.zeros((1, n_samples))]),
              safe_vstack(
                  [H.T, np.sqrt(beta) * np.ones((1, n_components_))]
              ),
              W.T,
              tolW,
              nls_max_iter,
              alpha=alpha,
              l1_ratio=l1_ratio,
          )
      elif sparseness == "components":
          Wt, gradW, iterW = _nls_subproblem(
              safe_vstack([X.T, np.zeros((n_components_, n_samples))]),
              safe_vstack([H.T, np.sqrt(eta) * np.eye(n_components_)]),
              W.T,
              tolW,
              nls_max_iter,
              alpha=alpha,
              l1_ratio=l1_ratio,
          )
  
      return Wt.T, gradW.T, iterW
  
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 10 for calling a global function with example usage: _update_projected_gradient_w(X, W, H, tolW, nls_max_iter, alpha, l1_ratio, sparseness, beta, eta) and returns: Wt,  gradW,  iterW