code: def test_indexed_array_invalid():
      values = np.random.rand(3, 4, 5)
  
      with pytest.raises(
          TypeError, match="values: expected a NumPy array .* found int"
      ):
          IndexedArray(123)
  
      with pytest.raises(
          ValueError,
          match=r"values: expected an array with shape .* found shape \(\) of length 0",
      ):
          IndexedArray(np.zeros(()))
  
      with pytest.raises(
          ValueError,
          match=r"values: expected an array with shape .* found shape \(123,\) of length 1",
      ):
          IndexedArray(np.zeros(123))
  
      # check that the index `len`-failure works with or without index inference
      with pytest.raises(
          TypeError, match="index: expected a sequence .* found int"
      ):
          IndexedArray(index=0)
  
      with pytest.raises(
          TypeError, match="index: expected a sequence .* found int"
      ):
          IndexedArray(values, index=123)
  
      with pytest.raises(
          ValueError,
          match="values: expected the index length 2 .* found 3 rows",
      ):
          IndexedArray(values, index=range(0, 3, 2))
  
imports: import numpy
  import pytest
  from stellargraph import IndexedArray
label_desc: Use image node_id 3 for calling a global function with example usage: test_indexed_array_invalid() without return types