code: def test_n_components_mle(setup):
      # Ensure that n_components == 'mle' doesn't raise error for auto/full
      # svd_solver and raises error for arpack/randomized svd_solver
      rng = np.random.RandomState(0)
      n_samples = 600
      n_features = 10
      X = mt.tensor(rng.randn(n_samples, n_features))
      n_components_dict = {}
      for solver in solver_list:
          pca = PCA(n_components="mle", svd_solver=solver)
          if solver in ["auto", "full"]:
              pca.fit(X)
              n_components_dict[solver] = pca.n_components_
          else:  # arpack/randomized solver
              error_message = f"n_components='mle' cannot be a string with svd_solver='{solver}'"
              assert_raise_message(
                  ValueError, error_message, pca.fit, X
              )
      assert n_components_dict["auto"] == n_components_dict["full"]
  
imports: from itertools import product
  import numpy
  import pytest
  import scipy
  from sklearn import datasets
  from sklearn.utils._testing import assert_array_almost_equal, assert_almost_equal, assert_raises_regex, assert_raise_message, assert_raises
  from ....None import tensor
  from .._pca import PCA, _assess_dimension, _infer_dimension
label_desc: Use image node_id 13 for calling a global function with example usage: test_n_components_mle(setup) without return types