code: def test_reentering():
      # Just some linear operator that calls eigs recursively
      def A_matvec(x):
          x = diags([1, -2, 1], [-1, 0, 1], shape=(50, 50))
          w, v = eigs(x, k=1)
          return v / w[0]
  
      A = LinearOperator(matvec=A_matvec, dtype=float, shape=(50, 50))
  
      # The Fortran code is not reentrant, so this fails (gracefully, not crashing)
      assert_raises(RuntimeError, eigs, A, k=1)
      assert_raises(RuntimeError, eigsh, A, k=1)
  
imports: import threading
  import itertools
  import numpy
  from numpy.testing import assert_allclose, assert_equal, suppress_warnings
  from pytest import raises
  import pytest
  from numpy import dot, conj, random
  from scipy.linalg import eig, eigh
  from scipy.sparse import csc_matrix, csr_matrix, diags, rand
  from scipy.sparse.linalg import LinearOperator, aslinearoperator
  from scipy.sparse.linalg._eigen.arpack import eigs, eigsh, arpack, ArpackNoConvergence
  from scipy._lib._gcutils import assert_deallocated, IS_PYPY
label_desc: Use image node_id 21 for calling a global function with example usage: test_reentering() and returns: unknown