code: def test_iloc_setitem():
      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)
      df2 = tile(df2)
  
      # plain index
      df3 = md.DataFrame(df1, chunk_size=2)
      df3.iloc[1] = 100
      df3 = tile(df3)
      assert isinstance(df3.op, DataFrameIlocSetItem)
      assert df3.chunk_shape == df2.chunk_shape
      pd.testing.assert_index_equal(
          df2.index_value.to_pandas(), df3.index_value.to_pandas()
      )
      pd.testing.assert_index_equal(
          df2.columns_value.to_pandas(), df3.columns_value.to_pandas()
      )
      for c1, c2 in zip(df2.chunks, df3.chunks):
          assert c1.shape == c2.shape
          pd.testing.assert_index_equal(
              c1.index_value.to_pandas(), c2.index_value.to_pandas()
          )
          pd.testing.assert_index_equal(
              c1.columns_value.to_pandas(), c2.columns_value.to_pandas()
          )
          if isinstance(c2.op, DataFrameIlocSetItem):
              assert c1.key == c2.inputs[0].key
          else:
              assert c1.key == c2.key
      assert df3.chunks[0].op.indexes == [1, slice(None, None, None)]
      assert df3.chunks[1].op.indexes == [1, slice(None, None, None)]
  
      # # slice index
      df4 = md.DataFrame(df1, chunk_size=2)
      df4.iloc[:, 2:4] = 1111
      df4 = tile(df4)
      assert isinstance(df4.op, DataFrameIlocSetItem)
      assert df4.chunk_shape == df2.chunk_shape
      pd.testing.assert_index_equal(
          df2.index_value.to_pandas(), df4.index_value.to_pandas()
      )
      pd.testing.assert_index_equal(
          df2.columns_value.to_pandas(), df4.columns_value.to_pandas()
      )
      for c1, c2 in zip(df2.chunks, df4.chunks):
          assert c1.shape == c2.shape
          pd.testing.assert_index_equal(
              c1.index_value.to_pandas(), c2.index_value.to_pandas()
          )
          pd.testing.assert_index_equal(
              c1.columns_value.to_pandas(), c2.columns_value.to_pandas()
          )
          if isinstance(c2.op, DataFrameIlocSetItem):
              assert c1.key == c2.inputs[0].key
          else:
              assert c1.key == c2.key
      assert df4.chunks[1].op.indexes == [
          slice(None, None, None),
          slice(None, None, None),
      ]
      assert df4.chunks[3].op.indexes == [
          slice(None, None, None),
          slice(None, None, None),
      ]
  
      # plain fancy index
      df5 = md.DataFrame(df1, chunk_size=2)
      df5.iloc[[0], [0, 1, 2]] = 2222
      df5 = tile(df5)
      assert isinstance(df5.op, DataFrameIlocSetItem)
      assert df5.chunk_shape == df2.chunk_shape
      pd.testing.assert_index_equal(
          df2.index_value.to_pandas(), df5.index_value.to_pandas()
      )
      pd.testing.assert_index_equal(
          df2.columns_value.to_pandas(), df5.columns_value.to_pandas()
      )
      for c1, c2 in zip(df2.chunks, df5.chunks):
          assert c1.shape == c2.shape
          pd.testing.assert_index_equal(
              c1.index_value.to_pandas(), c2.index_value.to_pandas()
          )
          pd.testing.assert_index_equal(
              c1.columns_value.to_pandas(), c2.columns_value.to_pandas()
          )
          if isinstance(c2.op, DataFrameIlocSetItem):
              assert c1.key == c2.inputs[0].key
          else:
              assert c1.key == c2.key
      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])
  
      # fancy index
      df6 = md.DataFrame(df1, chunk_size=2)
      df6.iloc[[1, 2], [0, 1, 2]] = 3333
      df6 = tile(df6)
      assert isinstance(df6.op, DataFrameIlocSetItem)
      assert df6.chunk_shape == df2.chunk_shape
      pd.testing.assert_index_equal(
          df2.index_value.to_pandas(), df6.index_value.to_pandas()
      )
      pd.testing.assert_index_equal(
          df2.columns_value.to_pandas(), df6.columns_value.to_pandas()
      )
      for c1, c2 in zip(df2.chunks, df6.chunks):
          assert c1.shape == c2.shape
          pd.testing.assert_index_equal(
              c1.index_value.to_pandas(), c2.index_value.to_pandas()
          )
          pd.testing.assert_index_equal(
              c1.columns_value.to_pandas(), c2.columns_value.to_pandas()
          )
          if isinstance(c2.op, DataFrameIlocSetItem):
              assert c1.key == c2.inputs[0].key
          else:
              assert c1.key == c2.key
      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])
  
      # plain index
      df7 = md.DataFrame(df1, chunk_size=2)
      df7.iloc[1, 2] = 4444
      df7 = tile(df7)
      assert isinstance(df7.op, DataFrameIlocSetItem)
      assert df7.chunk_shape == df2.chunk_shape
      pd.testing.assert_index_equal(
          df2.index_value.to_pandas(), df7.index_value.to_pandas()
      )
      pd.testing.assert_index_equal(
          df2.columns_value.to_pandas(), df7.columns_value.to_pandas()
      )
      for c1, c2 in zip(df2.chunks, df7.chunks):
          assert c1.shape == c2.shape
          pd.testing.assert_index_equal(
              c1.index_value.to_pandas(), c2.index_value.to_pandas()
          )
          pd.testing.assert_index_equal(
              c1.columns_value.to_pandas(), c2.columns_value.to_pandas()
          )
          if isinstance(c2.op, DataFrameIlocSetItem):
              assert c1.key == c2.inputs[0].key
          else:
              assert c1.key == c2.key
      assert df7.chunks[1].op.indexes == [1, 0]
  
      # test Series
  
      # slice
      series = md.Series(pd.Series(np.arange(10)), chunk_size=3)
      series.iloc[:4] = 2
      series = tile(series)
  
      assert series.shape == (10,)
      assert len(series.chunks) == 4
  
      assert series.chunks[0].op.indexes == [
          slice(None, None, None),
      ]
      assert series.chunks[0].op.value == 2
      assert series.chunks[1].op.indexes == [
          slice(0, 1, 1),
      ]
      assert series.chunks[1].op.value == 2
  
      raw = pd.DataFrame(
          np.random.rand(9, 2),
          index=["a1", "a2", "a3"] * 3,
          columns=["x", "y"],
      )
      df = md.DataFrame(raw, chunk_size=4)
      iloc_df = df.iloc[:, 1:]
      tiled_df, tiled_iloc_df = tile(df, iloc_df)
      # for full slice, index_value should be same as input chunk
      for loc_chunk, chunk in zip(
          tiled_iloc_df.chunks, tiled_df.chunks
      ):
          assert loc_chunk.index_value.key == chunk.index_value.key
  
      # fancy index
      series = md.Series(pd.Series(np.arange(10)), chunk_size=3)
      series.iloc[[2, 4, 9]] = 3
      series = tile(series)
  
      assert series.shape == (10,)
  
      assert len(series.chunks) == 4
      assert series.chunks[0].index == (0,)
      assert series.chunks[0].op.indexes[0].tolist() == [2]
      assert series.chunks[0].op.value == 3
      assert series.chunks[1].index == (1,)
      assert series.chunks[1].op.indexes[0].tolist() == [1]
      assert series.chunks[1].op.value == 3
      assert series.chunks[3].index == (3,)
      assert series.chunks[3].op.indexes[0].tolist() == [0]
      assert series.chunks[3].op.value == 3
  
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 3 for calling a global function with example usage: test_iloc_setitem() without return types