code: def test_pca_validation():
      # Ensures that solver-specific extreme inputs for the n_components
      # parameter raise errors
      X = np.array([[0, 1, 0], [1, 0, 0]])
      X = da.from_array(X, chunks=(2, 3))
      smallest_d = 2  # The smallest dimension
  
      for solver in solver_list:
          # We conduct the same test on X.T so that it is invariant to axis.
          # But dask-ml needs tall and skinny
          for data in [X]:
              for n_components in [-1, 3]:
                  with pytest.raises(ValueError, match="n_components"):
                      dd.PCA(n_components, svd_solver=solver).fit(data)
  
              if solver == "arpack":
                  n_components = smallest_d
                  with pytest.raises(ValueError, match="n_components"):
                      dd.PCA(n_components, svd_solver=solver).fit(data)
  
imports: from itertools import product
  import dask.array
  import dask.dataframe
  import numpy
  import pandas
  import pytest
  import scipy
  import sklearn.decomposition
  from dask.array.utils import assert_eq
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_raises
  from sklearn import datasets
  from sklearn.utils import check_random_state
  import dask_ml.decomposition
  from dask_ml._compat import DASK_2_26_0
  from dask_ml.utils import assert_estimator_equal, flip_vector_signs, svd_flip
label_desc: Use image node_id 11 for calling a global function with example usage: test_pca_validation() without return types