code: def test_nmf_minibatchnmf_equivalence(beta_loss):
      # Test that MiniBatchNMF is equivalent to NMF when batch_size = n_samples and
      # forget_factor 0.0 (stopping criterion put aside)
      rng = np.random.mtrand.RandomState(42)
      X = np.abs(rng.randn(48, 5))
  
      nmf = NMF(
          n_components=5,
          beta_loss=beta_loss,
          solver="mu",
          random_state=0,
          tol=0,
      )
      mbnmf = MiniBatchNMF(
          n_components=5,
          beta_loss=beta_loss,
          random_state=0,
          tol=0,
          max_no_improvement=None,
          batch_size=X.shape[0],
          forget_factor=0.0,
      )
      W = nmf.fit_transform(X)
      mbW = mbnmf.fit_transform(X)
      assert_allclose(W, mbW)
  
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 31 for calling a global function with example usage: test_nmf_minibatchnmf_equivalence(beta_loss) without return types