code: def test_sparse_matmat_exception():
      A = interface.LinearOperator((2, 2), matvec=lambda x: x)
      B = sparse.identity(2)
      msg = "Unable to multiply a LinearOperator with a sparse matrix."
      with assert_raises(TypeError, match=msg):
          A @ B
      with assert_raises(TypeError, match=msg):
          B @ A
      with assert_raises(ValueError):
          A @ np.identity(4)
      with assert_raises(ValueError):
          np.identity(4) @ A
  
imports: from functools import partial
  from itertools import product
  import operator
  from pytest import raises, warns
  from numpy.testing import assert_, assert_equal
  import numpy
  import scipy.sparse
  import scipy.sparse.linalg._interface
  from scipy.sparse._sputils import matrix
label_desc: Use image node_id 12 for calling a global function with example usage: test_sparse_matmat_exception() without return types