code: def test_ndarray_eval():
      data_list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
      mishapen_data_list1 = [[4], [1, 2, 3]]
      mishapen_data_list2 = [[[1], [2, 3]]]
      mishapen_data_list3 = [[4], [1, 2, 3], 5]
  
      nd_expr = hl.nd.array(data_list)
      evaled = hl.eval(nd_expr)
      np_equiv = np.array(data_list, dtype=np.int32)
      np_equiv_fortran_style = np.asfortranarray(np_equiv)
      np_equiv_extra_dimension = np_equiv.reshape((3, 1, 3))
      assert np.array_equal(evaled, np_equiv)
  
      assert np.array_equal(hl.eval(hl.nd.array([])), np.array([]))
  
      zero_array = np.zeros((10, 10), dtype=np.int64)
      evaled_zero_array = hl.eval(hl.literal(zero_array))
  
      assert np.array_equal(evaled_zero_array, zero_array)
      assert zero_array.dtype == evaled_zero_array.dtype
  
      # Testing correct interpretation of numpy strides
      assert np.array_equal(
          hl.eval(hl.literal(np_equiv_fortran_style)),
          np_equiv_fortran_style,
      )
      assert np.array_equal(
          hl.eval(hl.literal(np_equiv_extra_dimension)),
          np_equiv_extra_dimension,
      )
  
      # Testing from hail arrays
      assert np.array_equal(
          hl.eval(hl.nd.array(hl.range(6))), np.arange(6)
      )
      assert np.array_equal(
          hl.eval(hl.nd.array(hl.int64(4))), np.array(4)
      )
  
      # Testing from nested hail arrays
      assert np.array_equal(
          hl.eval(
              hl.nd.array(hl.array([hl.array(x) for x in data_list]))
          ),
          np.arange(9).reshape((3, 3)) + 1,
      )
  
      # Testing missing data
      assert (
          hl.eval(hl.nd.array(hl.missing(hl.tarray(hl.tint32)))) is None
      )
  
      with pytest.raises(ValueError) as exc:
          hl.nd.array(mishapen_data_list1)
      assert "inner dimensions do not match" in str(exc.value)
  
      with pytest.raises(HailUserError) as exc:
          hl.eval(hl.nd.array(hl.array(mishapen_data_list1)))
      assert "inner dimensions do not match" in str(exc.value)
  
      with pytest.raises(HailUserError) as exc:
          hl.eval(hl.nd.array(hl.array(mishapen_data_list2)))
      assert "inner dimensions do not match" in str(exc.value)
  
      with pytest.raises(ValueError) as exc:
          hl.nd.array(mishapen_data_list3)
      assert "inner dimensions do not match" in str(exc.value)
  
      with pytest.raises(HailUserError) as exc:
          hl.eval(hl.nd.array([1, hl.missing(hl.tint32), 3]))
  
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 8 for calling a global function with example usage: test_ndarray_eval() without return types