code: def test_pca_randomized_svd_n_oversamples():
      """Check that exposing and setting `n_oversamples` will provide accurate results
      even when `X` as a large number of features.
  
      Non-regression test for:
      https://github.com/scikit-learn/scikit-learn/issues/20589
      """
      rng = np.random.RandomState(0)
      n_features = 100
      X = rng.randn(1_000, n_features)
  
      # The default value of `n_oversamples` will lead to inaccurate results
      # We force it to the number of features.
      pca_randomized = PCA(
          n_components=1,
          svd_solver="randomized",
          n_oversamples=n_features,
          random_state=0,
      ).fit(X)
      pca_full = PCA(n_components=1, svd_solver="full").fit(X)
      pca_arpack = PCA(
          n_components=1, svd_solver="arpack", random_state=0
      ).fit(X)
  
      assert_allclose(
          np.abs(pca_full.components_), np.abs(pca_arpack.components_)
      )
      assert_allclose(
          np.abs(pca_randomized.components_),
          np.abs(pca_arpack.components_),
      )
  
imports: import re
  import warnings
  import numpy
  import pytest
  import scipy
  from numpy.testing import assert_array_equal
  from sklearn import config_context, datasets
  from sklearn.base import clone
  from sklearn.datasets import load_iris, make_classification
  from sklearn.decomposition import PCA
  from sklearn.decomposition._pca import _assess_dimension, _infer_dimension
  from sklearn.utils._array_api import _atol_for_type, _convert_to_numpy, yield_namespace_device_dtype_combinations
  from sklearn.utils._array_api import device
  from sklearn.utils._testing import _array_api_for_tests, assert_allclose
  from sklearn.utils.estimator_checks import _get_check_estimator_ids, check_array_api_input_and_values
  from sklearn.utils.fixes import CSC_CONTAINERS, CSR_CONTAINERS
label_desc: Use image node_id 41 for calling a global function with example usage: test_pca_randomized_svd_n_oversamples() without return types