code: def test_pca_fit(datatype, input_type, name, use_handle):
      if name == "blobs":
          pytest.skip("fails when using blobs dataset")
          X, y = make_blobs(
              n_samples=500000, n_features=1000, random_state=0
          )
  
      elif name == "digits":
          X, _ = datasets.load_digits(return_X_y=True)
  
      else:
          X, Y = make_multilabel_classification(
              n_samples=500,
              n_classes=2,
              n_labels=1,
              allow_unlabeled=False,
              random_state=1,
          )
  
      skpca = skPCA(n_components=2)
      skpca.fit(X)
  
      handle, stream = get_handle(use_handle)
      cupca = cuPCA(n_components=2, handle=handle)
      cupca.fit(X)
      cupca.handle.sync()
  
      for attr in [
          "singular_values_",
          "components_",
          "explained_variance_",
          "explained_variance_ratio_",
      ]:
          with_sign = False if attr in ["components_"] else True
          print(attr)
          print(getattr(cupca, attr))
          print(getattr(skpca, attr))
          cuml_res = getattr(cupca, attr)
  
          skl_res = getattr(skpca, attr)
          assert array_equal(
              cuml_res, skl_res, 1e-3, with_sign=with_sign
          )
  
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 1 for calling a global function with example usage: test_pca_fit(datatype, input_type, name, use_handle) without return types