code: def test_ndarray_solve():
      a = hl.nd.array([[1, 2], [3, 5]])
      b = hl.nd.array([1, 2])
      b2 = hl.nd.array([[1, 8], [2, 12]])
  
      assert np.allclose(
          hl.eval(hl.nd.solve(a, b)), np.array([-1.0, 1.0])
      )
      assert np.allclose(
          hl.eval(hl.nd.solve(a, b2)),
          np.array([[-1.0, -16.0], [1, 12]]),
      )
      assert np.allclose(
          hl.eval(hl.nd.solve(a.T, b2.T)),
          np.array([[19.0, 26.0], [-6, -8]]),
      )
  
      with pytest.raises(HailUserError) as exc:
          hl.eval(
              hl.nd.solve(
                  hl.nd.array([[1, 2], [1, 2]]), hl.nd.array([8, 10])
              )
          )
      assert "singular" in str(exc.value), str(exc.value)
  
imports: import math
  import numpy
  import re
  from ..helpers import *
  import pytest
  from hail.utils.java import FatalError, HailUserError
label_desc: Use image node_id 24 for calling a global function with example usage: test_ndarray_solve() without return types