code: def _beta_loss_to_float(beta_loss):
      """Convert string beta_loss to float."""
      beta_loss_map = {
          "frobenius": 2,
          "kullback-leibler": 1,
          "itakura-saito": 0,
      }
      if isinstance(beta_loss, str):
          beta_loss = beta_loss_map[beta_loss]
      return beta_loss
  
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 6 for calling a global function with example usage: _beta_loss_to_float(beta_loss) and returns: beta_loss