code: def test_ndarray_ref_bounds_check():
      with pytest.raises(HailUserError) as exc:
          hl.eval(hl.nd.array([1, 2, 3])[4])
      assert "Index 4 is out of bounds for axis 0 with size 3" in str(
          exc.value
      )
  
      with pytest.raises(HailUserError) as exc:
          hl.eval(hl.nd.array([1, 2, 3])[-1])
      assert "Index -1 is out of bounds for axis 0 with size 3" in str(
          exc.value
      )
  
      with pytest.raises(HailUserError) as exc:
          hl.eval(hl.nd.array([1, 2, 3])[-4])
      assert "Index -4 is out of bounds for axis 0 with size 3" in str(
          exc.value
      )
  
      with pytest.raises(HailUserError) as exc:
          hl.eval(hl.nd.array([[1], [2], [3]])[4, :])
      assert "Index 4 is out of bounds for axis 0 with size 3" in str(
          exc.value
      )
  
      with pytest.raises(HailUserError) as exc:
          hl.eval(hl.nd.array([[1], [2], [3]])[-4, :])
      assert "Index -4 is out of bounds for axis 0 with size 3" in str(
          exc.value
      )
  
      with pytest.raises(HailUserError) as exc:
          hl.eval(hl.nd.array([[1], [2], [3]])[:, 4])
      assert "Index 4 is out of bounds for axis 1 with size 1" in str(
          exc.value
      )
  
      with pytest.raises(HailUserError) as exc:
          hl.eval(hl.nd.array([[1], [2], [3]])[:, -4])
      assert "Index -4 is out of bounds for axis 1 with size 1" in 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 5 for calling a global function with example usage: test_ndarray_ref_bounds_check() without return types