code: def test_diagonal_solve():
      raises(
          TypeError, lambda: Matrix([1, 1]).diagonal_solve(Matrix([1]))
      )
      A = Matrix([[1, 0], [0, 1]]) * 2
      B = Matrix([[x, y], [y, x]])
      assert A.diagonal_solve(B) == B / 2
  
      A = Matrix([[1, 0], [1, 2]])
      raises(TypeError, lambda: A.diagonal_solve(B))
  
imports: import pytest
  from sympy.core.function import expand_mul
  from sympy.core.numbers import I, Rational
  from sympy.core.singleton import S
  from sympy.core.symbol import Symbol, symbols
  from sympy.core.sympify import sympify
  from sympy.simplify.simplify import simplify
  from sympy.matrices.exceptions import ShapeError, NonSquareMatrixError
  from sympy.matrices import ImmutableMatrix, Matrix, eye, ones, ImmutableDenseMatrix, dotprodsimp
  from sympy.matrices.determinant import _det_laplace
  from sympy.testing.pytest import raises
  from sympy.matrices.exceptions import NonInvertibleMatrixError
  from sympy.polys.matrices.exceptions import DMShapeError
  from sympy.solvers.solveset import linsolve
  from sympy.abc import x, y
label_desc: Use image node_id 12 for calling a global function with example usage: test_diagonal_solve() without return types