code: def test_randomized_eigsh(dtype):
      """Test that `_randomized_eigsh` returns the appropriate components"""
  
      rng = np.random.RandomState(42)
      X = np.diag(np.array([1.0, -2.0, 0.0, 3.0], dtype=dtype))
      # random rotation that preserves the eigenvalues of X
      rand_rot = np.linalg.qr(rng.normal(size=X.shape))[0]
      X = rand_rot @ X @ rand_rot.T
  
      # with 'module' selection method, the negative eigenvalue shows up
      eigvals, eigvecs = _randomized_eigsh(
          X, n_components=2, selection="module"
      )
      # eigenvalues
      assert eigvals.shape == (2,)
      assert_array_almost_equal(
          eigvals, [3.0, -2.0]
      )  # negative eigenvalue here
      # eigenvectors
      assert eigvecs.shape == (4, 2)
  
      # with 'value' selection method, the negative eigenvalue does not show up
      with pytest.raises(NotImplementedError):
          _randomized_eigsh(X, n_components=2, selection="value")
  
imports: import numpy
  import pytest
  from scipy import linalg, sparse
  from scipy.linalg import eigh
  from scipy.sparse.linalg import eigsh
  from scipy.special import expit
  from sklearn.datasets import make_low_rank_matrix, make_sparse_spd_matrix
  from sklearn.utils import gen_batches
  from sklearn.utils._arpack import _init_arpack_v0
  from sklearn.utils._testing import assert_allclose, assert_allclose_dense_sparse, assert_almost_equal, assert_array_almost_equal, assert_array_equal, skip_if_32bit
  from sklearn.utils.extmath import _deterministic_vector_sign_flip, _incremental_mean_and_var, _randomized_eigsh, _safe_accumulator_op, cartesian, density, log_logistic, randomized_svd, row_norms, safe_sparse_dot, softmax, stable_cumsum, svd_flip, weighted_mode
  from sklearn.utils.fixes import COO_CONTAINERS, CSC_CONTAINERS, CSR_CONTAINERS, DOK_CONTAINERS, LIL_CONTAINERS, _mode
label_desc: Use image node_id 5 for calling a global function with example usage: test_randomized_eigsh(dtype) without return types