code: def test_eigs_for_k_greater():
      # Test eigs() for k beyond limits.
      A_sparse = diags([1, -2, 1], [-1, 0, 1], shape=(4, 4))  # sparse
      A = generate_matrix(4, sparse=False)
      M_dense = np.random.random((4, 4))
      M_sparse = generate_matrix(4, sparse=True)
      M_linop = aslinearoperator(M_dense)
      eig_tuple1 = eig(A, b=M_dense)
      eig_tuple2 = eig(A, b=M_sparse)
  
      with suppress_warnings() as sup:
          sup.filter(RuntimeWarning)
  
          assert_equal(eigs(A, M=M_dense, k=3), eig_tuple1)
          assert_equal(eigs(A, M=M_dense, k=4), eig_tuple1)
          assert_equal(eigs(A, M=M_dense, k=5), eig_tuple1)
          assert_equal(eigs(A, M=M_sparse, k=5), eig_tuple2)
  
          # M as LinearOperator
          assert_raises(TypeError, eigs, A, M=M_linop, k=3)
  
          # Test 'A' for different types
          assert_raises(TypeError, eigs, aslinearoperator(A), k=3)
          assert_raises(TypeError, eigs, A_sparse, k=3)
  
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 40 for calling a global function with example usage: test_eigs_for_k_greater() without return types