code: def test_sparse_pca_inputs(
      nrows, ncols, whiten, return_sparse, cupy_input
  ):
      if ncols == 20000 and pytest.max_gpu_memory < 48:
          if pytest.adapt_stress_test:
              ncols = int(ncols * pytest.max_gpu_memory / 48)
          else:
              pytest.skip(
                  "Insufficient GPU memory for this test."
                  "Re-run with 'CUML_ADAPT_STRESS_TESTS=True'"
              )
  
      if return_sparse:
          pytest.skip(
              "Loss of information in converting to cupy sparse csr"
          )
  
      X = cupyx.scipy.sparse.random(
          nrows, ncols, density=0.07, dtype=cp.float32, random_state=10
      )
      if not (cupy_input):
          X = X.get()
  
      p_sparse = cuPCA(n_components=ncols, whiten=whiten)
  
      p_sparse.fit(X)
      t_sparse = p_sparse.transform(X)
      i_sparse = p_sparse.inverse_transform(
          t_sparse, return_sparse=return_sparse
      )
  
      if return_sparse:
          assert isinstance(i_sparse, cupyx.scipy.sparse.csr_matrix)
  
          assert array_equal(
              i_sparse.todense(), X.todense(), 1e-1, with_sign=True
          )
      else:
          if cupy_input:
              assert isinstance(i_sparse, cp.ndarray)
  
          assert array_equal(
              i_sparse, X.todense(), 1e-1, with_sign=True
          )
  
file_path: cuml/python/cuml/tests/test_pca.py
imports: from cuml.common.exceptions import NotFittedError
  from sklearn.datasets import make_blobs
  from sklearn.decomposition import PCA
  from sklearn.datasets import make_multilabel_classification
  from sklearn import datasets
  from cuml.testing.utils import get_handle, array_equal, unit_param, quality_param, stress_param
  from cuml import PCA
  import pytest
  from cuml.internals.safe_imports import gpu_only_import
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 6 for calling a global function with example usage: test_sparse_pca_inputs(nrows, ncols, whiten, return_sparse, cupy_input) without return types