code: def test_linearoperator_deallocation():
      # Check that the linear operators used by the Arpack wrappers are
      # deallocatable by reference counting -- they are big objects, so
      # Python's cyclic GC may not collect them fast enough before
      # running out of memory if eigs/eigsh are called in a tight loop.
  
      M_d = np.eye(10)
      M_s = csc_matrix(M_d)
      M_o = aslinearoperator(M_d)
  
      with assert_deallocated(lambda: arpack.SpLuInv(M_s)):
          pass
      with assert_deallocated(lambda: arpack.LuInv(M_d)):
          pass
      with assert_deallocated(lambda: arpack.IterInv(M_s)):
          pass
      with assert_deallocated(lambda: arpack.IterOpInv(M_o, None, 0.3)):
          pass
      with assert_deallocated(lambda: arpack.IterOpInv(M_o, M_o, 0.3)):
          pass
  
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 34 for calling a global function with example usage: test_linearoperator_deallocation() without return types