code: def test_eigs(matrices):
      A_dense, A_sparse, v0 = matrices
  
      M_dense = np.diag(v0**2)
      M_sparse = A_sparse.__class__(M_dense)
  
      w_dense, v_dense = splin.eigs(A_dense, k=3, v0=v0)
      w, v = splin.eigs(A_sparse, k=3, v0=v0)
  
      assert_allclose(w, w_dense)
      assert_allclose(v, v_dense)
  
      for M in [M_sparse, M_dense]:
          w_dense, v_dense = splin.eigs(A_dense, M=M_dense, k=3, v0=v0)
          w, v = splin.eigs(A_sparse, M=M, k=3, v0=v0)
  
          assert_allclose(w, w_dense)
          assert_allclose(v, v_dense)
  
          w_dense, v_dense = splin.eigsh(A_dense, M=M_dense, k=3, v0=v0)
          w, v = splin.eigsh(A_sparse, M=M, k=3, v0=v0)
  
          assert_allclose(w, w_dense)
          assert_allclose(v, v_dense)
  
imports: import pytest
  import numpy
  import scipy.sparse
  import scipy.sparse.linalg
  from numpy.testing import assert_allclose
label_desc: Use image node_id 8 for calling a global function with example usage: test_eigs(matrices) without return types