code: def test_mini_batch_correct_shapes():
      rng = np.random.RandomState(0)
      X = rng.randn(12, 10)
      pca = MiniBatchSparsePCA(
          n_components=8, max_iter=1, random_state=rng
      )
      U = pca.fit_transform(X)
      assert pca.components_.shape == (8, 10)
      assert U.shape == (12, 8)
      # test overcomplete decomposition
      pca = MiniBatchSparsePCA(
          n_components=13, max_iter=1, random_state=rng
      )
      U = pca.fit_transform(X)
      assert pca.components_.shape == (13, 10)
      assert U.shape == (12, 13)
  
imports: import sys
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from sklearn.decomposition import PCA, MiniBatchSparsePCA, SparsePCA
  from sklearn.utils import check_random_state
  from sklearn.utils._testing import assert_allclose, assert_array_almost_equal, if_safe_multiprocessing_with_blas
label_desc: Use image node_id 8 for calling a global function with example usage: test_mini_batch_correct_shapes() without return types