code: def _check_svds(A, k, U, s, VH):
      n, m = A.shape
  
      # Check shapes.
      assert_equal(U.shape, (n, k))
      assert_equal(s.shape, (k,))
      assert_equal(VH.shape, (k, m))
  
      # Check that the original matrix can be reconstituted.
      A_rebuilt = (U * s).dot(VH)
      assert_equal(A_rebuilt.shape, A.shape)
      assert_allclose(A_rebuilt, A)
  
      # Check that U is a semi-orthogonal matrix.
      UH_U = np.dot(U.T.conj(), U)
      assert_equal(UH_U.shape, (k, k))
      assert_allclose(UH_U, np.identity(k), atol=1e-12)
  
      # Check that V is a semi-orthogonal matrix.
      VH_V = np.dot(VH, VH.T.conj())
      assert_equal(VH_V.shape, (k, k))
      assert_allclose(VH_V, np.identity(k), atol=1e-12)
  
imports: import threading
  import itertools
  import sys
  import platform
  import numpy
  from numpy.testing import assert_allclose, assert_array_almost_equal_nulp, assert_equal, assert_array_equal, suppress_warnings
  from pytest import raises
  import pytest
  from numpy import dot, conj, random
  from scipy.linalg import eig, eigh, hilbert, svd
  from scipy.sparse import csc_matrix, csr_matrix, isspmatrix, diags, rand
  from scipy.sparse.linalg import LinearOperator, aslinearoperator
  from scipy.sparse.linalg.eigen.arpack import eigs, eigsh, svds, ArpackNoConvergence, arpack
  from scipy._lib._gcutils import assert_deallocated, IS_PYPY
label_desc: Use image node_id 29 for calling a global function with example usage: _check_svds(A, k, U, s, VH) without return types