code: def test_non_negative_factorization_checking():
      # Note that the validity of parameter types and range of possible values
      # for scalar numerical or str parameters is already checked in the common
      # tests. Here we only check for problems that cannot be captured by simple
      # declarative constraints on the valid parameter values.
  
      A = np.ones((2, 2))
      # Test parameters checking in public function
      nnmf = non_negative_factorization
      msg = re.escape("Negative values in data passed to NMF (input H)")
      with pytest.raises(ValueError, match=msg):
          nnmf(A, A, -A, 2, init="custom")
      msg = re.escape("Negative values in data passed to NMF (input W)")
      with pytest.raises(ValueError, match=msg):
          nnmf(A, -A, A, 2, init="custom")
      msg = re.escape("Array passed to NMF (input H) is full of zeros")
      with pytest.raises(ValueError, match=msg):
          nnmf(A, A, 0 * A, 2, init="custom")
  
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 18 for calling a global function with example usage: test_non_negative_factorization_checking() without return types