code: def test_pca_defaults(n_samples, n_features, sparse):
      # FIXME: Disable the case True-300-200 due to flaky test
      if sparse and n_features == 300 and n_samples == 200:
          pytest.xfail(
              "Skipping the case True-300-200 due to flaky test"
          )
  
      if sparse:
          X = cupyx.scipy.sparse.random(
              n_samples,
              n_features,
              density=0.03,
              dtype=cp.float32,
              random_state=10,
          )
      else:
          X, Y = make_multilabel_classification(
              n_samples=n_samples,
              n_features=n_features,
              n_classes=2,
              n_labels=1,
              random_state=1,
          )
      cupca = cuPCA()
      cupca.fit(X)
      curesult = cupca.transform(X)
      cupca.handle.sync()
  
      if sparse:
          X = X.toarray().get()
      skpca = skPCA()
      skpca.fit(X)
      skresult = skpca.transform(X)
  
      assert skpca.svd_solver == cupca.svd_solver
      assert cupca.components_.shape[0] == skpca.components_.shape[0]
      assert curesult.shape == skresult.shape
      assert array_equal(curesult, skresult, 1e-3, with_sign=False)
  
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 2 for calling a global function with example usage: test_pca_defaults(n_samples, n_features, sparse) without return types