code: def test_iloc_getitem():
      df1 = pd.DataFrame(
          [[1, 3, 3], [4, 2, 6], [7, 8, 9]],
          index=["a1", "a2", "a3"],
          columns=["x", "y", "z"],
      )
      df2 = md.DataFrame(df1, chunk_size=2)
  
      with pytest.raises(IndexingError):
          _ = df2.iloc[1, 1, 1]
  
      # index cannot be tuple
      with pytest.raises(IndexingError):
          _ = df2.iloc[((1,),)]
  
      # index wrong type
      with pytest.raises(TypeError):
          _ = df2.iloc["a1":]
  
      with pytest.raises(NotImplementedError):
          _ = df2.iloc[0, md.Series(["a2", "a3"])]
  
      # fancy index should be 1-d
      with pytest.raises(ValueError):
          _ = df2.iloc[[[0, 1], [1, 2]]]
  
      with pytest.raises(ValueError):
          _ = df2.iloc[1, ...]
  
      with pytest.raises(IndexError):
          _ = df2.iloc[-4]
  
      with pytest.raises(IndexError):
          _ = df2.iloc[3]
  
      # plain index
      df3 = df2.iloc[1]
      df3 = tile(df3)
      assert isinstance(df3, SERIES_TYPE)
      assert isinstance(df3.op, DataFrameIlocGetItem)
      assert df3.shape == (3,)
      assert df3.chunk_shape == (2,)
      assert df3.chunks[0].shape == (2,)
      assert df3.chunks[1].shape == (1,)
      assert df3.chunks[0].op.indexes == [1, slice(None, None, None)]
      assert df3.chunks[1].op.indexes == [1, slice(None, None, None)]
      assert df3.chunks[0].inputs[0].index == (0, 0)
      assert df3.chunks[0].inputs[0].shape == (2, 2)
      assert df3.chunks[1].inputs[0].index == (0, 1)
      assert df3.chunks[1].inputs[0].shape == (2, 1)
  
      # slice index
      df4 = df2.iloc[:, 2:4]
      df4 = tile(df4)
      assert isinstance(df4, DATAFRAME_TYPE)
      assert isinstance(df4.op, DataFrameIlocGetItem)
      assert df4.index_value.key == df2.index_value.key
      assert df4.shape == (3, 1)
      assert df4.chunk_shape == (2, 1)
      assert df4.chunks[0].shape == (2, 1)
      pd.testing.assert_index_equal(
          df4.chunks[0].columns_value.to_pandas(), df1.columns[2:3]
      )
      pd.testing.assert_series_equal(
          df4.chunks[0].dtypes, df1.dtypes[2:3]
      )
      assert isinstance(
          df4.chunks[0].index_value.to_pandas(), type(df1.index)
      )
      assert df4.chunks[1].shape == (1, 1)
      pd.testing.assert_index_equal(
          df4.chunks[1].columns_value.to_pandas(), df1.columns[2:3]
      )
      pd.testing.assert_series_equal(
          df4.chunks[1].dtypes, df1.dtypes[2:3]
      )
      assert (
          df4.chunks[0].index_value.key != df4.chunks[1].index_value.key
      )
      assert isinstance(
          df4.chunks[1].index_value.to_pandas(), type(df1.index)
      )
      assert df4.chunks[0].op.indexes == [
          slice(None, None, None),
          slice(None, None, None),
      ]
      assert df4.chunks[1].op.indexes == [
          slice(None, None, None),
          slice(None, None, None),
      ]
      assert df4.chunks[0].inputs[0].index == (0, 1)
      assert df4.chunks[0].inputs[0].shape == (2, 1)
      assert df4.chunks[1].inputs[0].index == (1, 1)
      assert df4.chunks[1].inputs[0].shape == (1, 1)
  
      # plain fancy index
      df5 = df2.iloc[[0], [0, 1, 2]]
      df5 = tile(df5)
      assert isinstance(df5, DATAFRAME_TYPE)
      assert isinstance(df5.op, DataFrameIlocGetItem)
      assert df5.shape == (1, 3)
      assert df5.chunk_shape == (1, 2)
      assert df5.chunks[0].shape == (1, 2)
      pd.testing.assert_index_equal(
          df5.chunks[0].columns_value.to_pandas(), df1.columns[:2]
      )
      pd.testing.assert_series_equal(
          df5.chunks[0].dtypes, df1.dtypes[:2]
      )
      assert isinstance(
          df5.chunks[0].index_value.to_pandas(), type(df1.index)
      )
      assert df5.chunks[1].shape == (1, 1)
      pd.testing.assert_index_equal(
          df5.chunks[1].columns_value.to_pandas(), df1.columns[2:]
      )
      pd.testing.assert_series_equal(
          df5.chunks[1].dtypes, df1.dtypes[2:]
      )
      assert isinstance(
          df5.chunks[1].index_value.to_pandas(), type(df1.index)
      )
      np.testing.assert_array_equal(df5.chunks[0].op.indexes[0], [0])
      np.testing.assert_array_equal(df5.chunks[0].op.indexes[1], [0, 1])
      np.testing.assert_array_equal(df5.chunks[1].op.indexes[0], [0])
      np.testing.assert_array_equal(df5.chunks[1].op.indexes[1], [0])
      assert df5.chunks[0].inputs[0].index == (0, 0)
      assert df5.chunks[0].inputs[0].shape == (2, 2)
      assert df5.chunks[1].inputs[0].index == (0, 1)
      assert df5.chunks[1].inputs[0].shape == (2, 1)
  
      # fancy index
      df6 = df2.iloc[[1, 2], [0, 1, 2]]
      df6 = tile(df6)
      assert isinstance(df6, DATAFRAME_TYPE)
      assert isinstance(df6.op, DataFrameIlocGetItem)
      assert df6.shape == (2, 3)
      assert df6.chunk_shape == (2, 2)
      assert df6.chunks[0].shape == (1, 2)
      assert df6.chunks[1].shape == (1, 1)
      assert df6.chunks[2].shape == (1, 2)
      assert df6.chunks[3].shape == (1, 1)
      np.testing.assert_array_equal(df6.chunks[0].op.indexes[0], [1])
      np.testing.assert_array_equal(df6.chunks[0].op.indexes[1], [0, 1])
      np.testing.assert_array_equal(df6.chunks[1].op.indexes[0], [1])
      np.testing.assert_array_equal(df6.chunks[1].op.indexes[1], [0])
      np.testing.assert_array_equal(df6.chunks[2].op.indexes[0], [0])
      np.testing.assert_array_equal(df6.chunks[2].op.indexes[1], [0, 1])
      np.testing.assert_array_equal(df6.chunks[3].op.indexes[0], [0])
      np.testing.assert_array_equal(df6.chunks[3].op.indexes[1], [0])
      assert df6.chunks[0].inputs[0].index == (0, 0)
      assert df6.chunks[0].inputs[0].shape == (2, 2)
      assert df6.chunks[1].inputs[0].index == (0, 1)
      assert df6.chunks[1].inputs[0].shape == (2, 1)
      assert df6.chunks[2].inputs[0].index == (1, 0)
      assert df6.chunks[2].inputs[0].shape == (1, 2)
      assert df6.chunks[3].inputs[0].index == (1, 1)
      assert df6.chunks[3].inputs[0].shape == (1, 1)
  
      # plain index
      df7 = df2.iloc[1, 2]
      df7 = tile(df7)
      assert isinstance(df7, TENSOR_TYPE)  # scalar
      assert isinstance(df7.op, DataFrameIlocGetItem)
      assert df7.shape == ()
      assert df7.chunk_shape == ()
      assert df7.chunks[0].dtype == df7.dtype
      assert df7.chunks[0].shape == ()
      assert df7.chunks[0].op.indexes == [1, 0]
      assert df7.chunks[0].inputs[0].index == (0, 1)
      assert df7.chunks[0].inputs[0].shape == (2, 1)
  
      # test Series iloc getitem
  
      # slice
      series = md.Series(pd.Series(np.arange(10)), chunk_size=3).iloc[
          4:8
      ]
      series = tile(series)
  
      assert series.shape == (4,)
  
      assert len(series.chunks) == 2
      assert series.chunks[0].shape == (2,)
      assert series.chunks[0].index == (0,)
      assert series.chunks[0].op.indexes == [slice(1, 3, 1)]
      assert series.chunks[1].shape == (2,)
      assert series.chunks[1].op.indexes == [slice(0, 2, 1)]
      assert series.chunks[1].index == (1,)
  
      # fancy index
      series = md.Series(pd.Series(np.arange(10)), chunk_size=3).iloc[
          [2, 4, 8]
      ]
      series = tile(series)
  
      assert series.shape == (3,)
  
      assert len(series.chunks) == 3
      assert series.chunks[0].shape == (1,)
      assert series.chunks[0].index == (0,)
      assert series.chunks[0].op.indexes[0] == [2]
      assert series.chunks[1].shape == (1,)
      assert series.chunks[1].op.indexes[0] == [1]
      assert series.chunks[1].index == (1,)
      assert series.chunks[2].shape == (1,)
      assert series.chunks[2].op.indexes[0] == [2]
      assert series.chunks[2].index == (2,)
  
imports: import numpy
  import pandas
  import pytest
  from ....None import dataframe
  from ....None import tensor
  from ....core import tile
  from ....tensor.core import TENSOR_CHUNK_TYPE, TENSOR_TYPE, Tensor
  from ...core import SERIES_CHUNK_TYPE, SERIES_TYPE, Series, DATAFRAME_TYPE, DataFrame, DATAFRAME_CHUNK_TYPE
  from ...datasource.from_tensor import dataframe_from_tensor
  from ..iloc import DataFrameIlocGetItem, DataFrameIlocSetItem, IndexingError, HeadTailOptimizedOperandMixin
  from ..loc import DataFrameLocGetItem
label_desc: Use image node_id 2 for calling a global function with example usage: test_iloc_getitem() without return types