code: def test_LUsolve():
      A = Matrix([[2, 3, 5], [3, 6, 2], [8, 3, 6]])
      x = Matrix(3, 1, [3, 7, 5])
      b = A * x
      soln = A.LUsolve(b)
      assert soln == x
      A = Matrix([[0, -1, 2], [5, 10, 7], [8, 3, 4]])
      x = Matrix(3, 1, [-1, 2, 5])
      b = A * x
      soln = A.LUsolve(b)
      assert soln == x
      A = Matrix([[2, 1], [1, 0], [1, 0]])  # issue 14548
      b = Matrix([3, 1, 1])
      assert A.LUsolve(b) == Matrix([1, 1])
      b = Matrix([3, 1, 2])  # inconsistent
      raises(ValueError, lambda: A.LUsolve(b))
      A = Matrix(
          [
              [0, -1, 2],
              [5, 10, 7],
              [8, 3, 4],
              [2, 3, 5],
              [3, 6, 2],
              [8, 3, 6],
          ]
      )
      x = Matrix([2, 1, -4])
      b = A * x
      soln = A.LUsolve(b)
      assert soln == x
      A = Matrix([[0, -1, 2], [5, 10, 7]])  # underdetermined
      x = Matrix([-1, 2, 0])
      b = A * x
      raises(NotImplementedError, lambda: A.LUsolve(b))
  
      A = Matrix(4, 4, lambda i, j: 1 / (i + j + 1) if i != 3 else 0)
      b = Matrix.zeros(4, 1)
      raises(NonInvertibleMatrixError, lambda: A.LUsolve(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 5 for calling a global function with example usage: test_LUsolve() without return types