code: def test_explained_variance_components_10_20(X_sparse, kind, solver):
      X = X_sparse if kind == "sparse" else X_sparse.toarray()
      svd_10 = TruncatedSVD(10, algorithm=solver, n_iter=10).fit(X)
      svd_20 = TruncatedSVD(20, algorithm=solver, n_iter=10).fit(X)
  
      # Assert the 1st component is equal
      assert_allclose(
          svd_10.explained_variance_ratio_,
          svd_20.explained_variance_ratio_[:10],
          rtol=5e-3,
      )
  
      # Assert that 20 components has higher explained variance than 10
      assert (
          svd_20.explained_variance_ratio_.sum()
          > svd_10.explained_variance_ratio_.sum()
      )
  
file_path: scikit-learn/sklearn/decomposition/tests/test_truncated_svd.py
imports: import numpy
  import pytest
  import scipy.sparse
  from sklearn.decomposition import PCA, TruncatedSVD
  from sklearn.utils import check_random_state
  from sklearn.utils._testing import assert_allclose, assert_array_less
label_desc: Use image node_id 9 for calling a global function with example usage: test_explained_variance_components_10_20(X_sparse, kind, solver) without return types