code: def _multiplicative_update_h(
      X,
      W,
      H,
      beta_loss,
      l1_reg_H,
      l2_reg_H,
      gamma,
      A=None,
      B=None,
      rho=None,
  ):
      """update H in Multiplicative Update NMF."""
      if beta_loss == 2:
          numerator = safe_sparse_dot(W.T, X)
          denominator = np.linalg.multi_dot([W.T, W, H])
  
      else:
          # Numerator
          WH_safe_X = _special_sparse_dot(W, H, X)
          if sp.issparse(X):
              WH_safe_X_data = WH_safe_X.data
              X_data = X.data
          else:
              WH_safe_X_data = WH_safe_X
              X_data = X
              # copy used in the Denominator
              WH = WH_safe_X.copy()
              if beta_loss - 1.0 < 0:
                  WH[WH < EPSILON] = EPSILON
  
          # to avoid division by zero
          if beta_loss - 2.0 < 0:
              WH_safe_X_data[WH_safe_X_data < EPSILON] = EPSILON
  
          if beta_loss == 1:
              np.divide(X_data, WH_safe_X_data, out=WH_safe_X_data)
          elif beta_loss == 0:
              # speeds up computation time
              # refer to /numpy/numpy/issues/9363
              WH_safe_X_data **= -1
              WH_safe_X_data **= 2
              # element-wise multiplication
              WH_safe_X_data *= X_data
          else:
              WH_safe_X_data **= beta_loss - 2
              # element-wise multiplication
              WH_safe_X_data *= X_data
  
          # here numerator = dot(W.T, (dot(W, H) ** (beta_loss - 2)) * X)
          numerator = safe_sparse_dot(W.T, WH_safe_X)
  
          # Denominator
          if beta_loss == 1:
              W_sum = np.sum(W, axis=0)  # shape(n_components, )
              W_sum[W_sum == 0] = 1.0
              denominator = W_sum[:, np.newaxis]
  
          # beta_loss not in (1, 2)
          else:
              # computation of WtWH = dot(W.T, dot(W, H) ** beta_loss - 1)
              if sp.issparse(X):
                  # memory efficient computation
                  # (compute column by column, avoiding the dense matrix WH)
                  WtWH = np.empty(H.shape)
                  for i in range(X.shape[1]):
                      WHi = np.dot(W, H[:, i])
                      if beta_loss - 1 < 0:
                          WHi[WHi < EPSILON] = EPSILON
                      WHi **= beta_loss - 1
                      WtWH[:, i] = np.dot(W.T, WHi)
              else:
                  WH **= beta_loss - 1
                  WtWH = np.dot(W.T, WH)
              denominator = WtWH
  
      # Add L1 and L2 regularization
      if l1_reg_H > 0:
          denominator += l1_reg_H
      if l2_reg_H > 0:
          denominator = denominator + l2_reg_H * H
      denominator[denominator == 0] = EPSILON
  
      if A is not None and B is not None:
          # Updates for the online nmf
          if gamma != 1:
              H **= 1 / gamma
          numerator *= H
          A *= rho
          B *= rho
          A += numerator
          B += denominator
          H = A / B
  
          if gamma != 1:
              H **= gamma
      else:
          delta_H = numerator
          delta_H /= denominator
          if gamma != 1:
              delta_H **= gamma
          H *= delta_H
  
      return H
  
imports: import itertools
  import time
  import warnings
  from abc import ABC
  from math import sqrt
  from numbers import Integral, Real
  import numpy
  import scipy.sparse
  from scipy import linalg
  from .._config import config_context
  from ..base import BaseEstimator, ClassNamePrefixFeaturesOutMixin, TransformerMixin, _fit_context
  from ..exceptions import ConvergenceWarning
  from ..utils import check_array, check_random_state, gen_batches, metadata_routing
  from ..utils._param_validation import Interval, StrOptions, validate_params
  from ..utils.extmath import randomized_svd, safe_sparse_dot, squared_norm
  from ..utils.validation import check_is_fitted, check_non_negative
  from ._cdnmf_fast import _update_cdnmf_fast
label_desc: Use image node_id 11 for calling a global function with example usage: _multiplicative_update_h(X, W, H, beta_loss, l1_reg_H, l2_reg_H, gamma, A, B, rho) and returns: H