code: def test_nmf_n_components_auto_no_h_update():
      # Tests that non_negative_factorization does not fail when setting
      # n_components="auto" also tests that the inferred n_component
      # value is the right one.
      rng = np.random.RandomState(0)
      X = rng.random_sample((6, 5))
      H_true = rng.random_sample((2, 5))
      W, H, _ = non_negative_factorization(
          X, H=H_true, n_components="auto", update_H=False
      )  # should not fail
      assert_allclose(H, H_true)
      assert W.shape == (X.shape[0], H_true.shape[0])
  
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 39 for calling a global function with example usage: test_nmf_n_components_auto_no_h_update() without return types