code: def test_nmf_underflow():
      # Regression test for an underflow issue in _beta_divergence
      rng = np.random.RandomState(0)
      n_samples, n_features, n_components = 10, 2, 2
      X = np.abs(rng.randn(n_samples, n_features)) * 10
      W = np.abs(rng.randn(n_samples, n_components)) * 10
      H = np.abs(rng.randn(n_components, n_features))
  
      X[0, 0] = 0
      ref = nmf._beta_divergence(X, W, H, beta=1.0)
      X[0, 0] = 1e-323
      res = nmf._beta_divergence(X, W, H, beta=1.0)
      assert_almost_equal(res, ref)
  
imports: import re
  import sys
  import warnings
  from io import StringIO
  import numpy
  import pytest
  from scipy import linalg
  from sklearn.base import clone
  from sklearn.decomposition import NMF, MiniBatchNMF, non_negative_factorization
  from sklearn.decomposition import _nmf
  from sklearn.exceptions import ConvergenceWarning
  from sklearn.utils._testing import assert_allclose, assert_almost_equal, assert_array_almost_equal, assert_array_equal, ignore_warnings
  from sklearn.utils.extmath import squared_norm
  from sklearn.utils.fixes import CSC_CONTAINERS, CSR_CONTAINERS
label_desc: Use image node_id 27 for calling a global function with example usage: test_nmf_underflow() without return types