code: def check_svdp(n, m, constructor, dtype, k, irl_mode, which, f=0.8):
      tol = TOLS[dtype]
  
      M = generate_matrix(np.asarray, n, m, f, dtype)
      Msp = constructor(M)
  
      u1, sigma1, vt1 = np.linalg.svd(M, full_matrices=False)
      u2, sigma2, vt2, _ = _svdp(
          Msp, k=k, which=which, irl_mode=irl_mode, tol=tol
      )
  
      # check the which
      if which.upper() == "SM":
          u1 = np.roll(u1, k, 1)
          vt1 = np.roll(vt1, k, 0)
          sigma1 = np.roll(sigma1, k)
  
      # check that singular values agree
      assert_allclose(sigma1[:k], sigma2, rtol=tol, atol=tol)
  
      # check that singular vectors are orthogonal
      assert_orthogonal(u1, u2, rtol=tol, atol=tol)
      assert_orthogonal(vt1.T, vt2.T, rtol=tol, atol=tol)
  
file_path: scipy/scipy/sparse/linalg/tests/test_propack.py
imports: import os
  import pytest
  import sys
  import numpy
  from numpy.testing import assert_allclose
  from pytest import raises
  from scipy.sparse.linalg._svdp import _svdp
  from scipy.sparse import csr_matrix, csc_matrix
label_desc: Use image node_id 6 for calling a global function with example usage: check_svdp(n, m, constructor, dtype, k, irl_mode, which, f) without return types