code: def test_sparse_pca_dtype_match(
      SPCA, method, data_type, expected_type
  ):
      # Verify output matrix dtype
      n_samples, n_features, n_components = 12, 10, 3
      rng = np.random.RandomState(0)
      input_array = rng.randn(n_samples, n_features).astype(data_type)
      model = SPCA(n_components=n_components, method=method)
      transformed = model.fit_transform(input_array)
  
      assert transformed.dtype == expected_type
      assert model.components_.dtype == expected_type
  
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 13 for calling a global function with example usage: test_sparse_pca_dtype_match(SPCA, method, data_type, expected_type) without return types