code: def test_singular_values_consistency(solver):
      # Check that the TruncatedSVD output has the correct singular values
      rng = np.random.RandomState(0)
      n_samples, n_features = 100, 80
      X = rng.randn(n_samples, n_features)
  
      pca = TruncatedSVD(
          n_components=2, algorithm=solver, random_state=rng
      ).fit(X)
  
      # Compare to the Frobenius norm
      X_pca = pca.transform(X)
      assert_allclose(
          np.sum(pca.singular_values_**2.0),
          np.linalg.norm(X_pca, "fro") ** 2.0,
          rtol=1e-2,
      )
  
      # Compare to the 2-norms of the score vectors
      assert_allclose(
          pca.singular_values_,
          np.sqrt(np.sum(X_pca**2.0, axis=0)),
          rtol=1e-2,
      )
  
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 10 for calling a global function with example usage: test_singular_values_consistency(solver) without return types