code: def test_initialize_variants():
      # Test NNDSVD variants correctness
      # Test that the variants 'nndsvda' and 'nndsvdar' differ from basic
      # 'nndsvd' only where the basic version has zeros.
      rng = np.random.mtrand.RandomState(42)
      data = np.abs(rng.randn(10, 10))
      W0, H0 = nmf._initialize_nmf(data, 10, init="nndsvd")
      Wa, Ha = nmf._initialize_nmf(data, 10, init="nndsvda")
      War, Har = nmf._initialize_nmf(
          data, 10, init="nndsvdar", random_state=0
      )
  
      for ref, evl in ((W0, Wa), (W0, War), (H0, Ha), (H0, Har)):
          assert_almost_equal(evl[ref != 0], ref[ref != 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 5 for calling a global function with example usage: test_initialize_variants() without return types