code: def test_nmf_w_h_not_used_warning():
      # Check that warnings are raised if user provided W and H are not used
      # and initialization overrides value of W or H
      rng = np.random.RandomState(0)
      X = rng.random_sample((6, 5))
      W_init = rng.random_sample((6, 2))
      H_init = rng.random_sample((2, 5))
      with pytest.warns(
          RuntimeWarning,
          match="When init!='custom', provided W or H are ignored",
      ):
          non_negative_factorization(
              X, H=H_init, update_H=True, n_components="auto"
          )
  
      with pytest.warns(
          RuntimeWarning,
          match="When init!='custom', provided W or H are ignored",
      ):
          non_negative_factorization(
              X, W=W_init, H=H_init, update_H=True, n_components="auto"
          )
  
      with pytest.warns(
          RuntimeWarning,
          match="When update_H=False, the provided initial W is not used.",
      ):
          # When update_H is False, W is ignored regardless of init
          # TODO: use the provided W when init="custom".
          non_negative_factorization(
              X, W=W_init, H=H_init, update_H=False, n_components="auto"
          )
  
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 40 for calling a global function with example usage: test_nmf_w_h_not_used_warning() without return types