code: def test_svd_random_state(self):
      if self.solver == "propack":
          if not has_propack:
              pytest.skip("PROPACK not available")
      # check that the `random_state` parameter affects the solution
      # Admittedly, `n` and `k` are chosen so that all solver pass all
      # these checks. That's a tall order, since LOBPCG doesn't want to
      # achieve the desired accuracy and ARPACK often returns the same
      # singular values/vectors for different v0.
      n = 100
      k = 1
  
      rng = np.random.default_rng(0)
      A = rng.random((n, n))
  
      # with the same random_state, solutions are the same and accurate
      res1a = svds(A, k, solver=self.solver, random_state=0)
      res2a = svds(A, k, solver=self.solver, random_state=0)
      for idx in range(3):
          assert_allclose(
              res1a[idx], res2a[idx], rtol=1e-15, atol=2e-16
          )
      _check_svds(A, k, *res1a)
  
      # with the same random_state, solutions are the same and accurate
      res1b = svds(A, k, solver=self.solver, random_state=1)
      res2b = svds(A, k, solver=self.solver, random_state=1)
      for idx in range(3):
          assert_allclose(
              res1b[idx], res2b[idx], rtol=1e-15, atol=2e-16
          )
      _check_svds(A, k, *res1b)
  
      # with different random_state, solutions can be numerically different
      message = "Arrays are not equal"
      with pytest.raises(AssertionError, match=message):
          assert_equal(res1a, res1b)
  
imports: import os
  import re
  import copy
  import numpy
  from numpy.testing import assert_allclose, assert_equal, assert_array_equal
  import pytest
  from scipy.linalg import svd, null_space
  from scipy.sparse import csc_matrix, issparse, spdiags, random
  from scipy.sparse.linalg import LinearOperator, aslinearoperator
  from scipy.sparse.linalg import svds
  from scipy.sparse.linalg._eigen.arpack import ArpackNoConvergence
label_desc: Use image node_id 16 for calling the SVDSCommonTests obj's underlying member method code with example usage: obj.test_svd_random_state() without return types