code: def test_iter(setup):
      raw_data = pd.DataFrame(np.random.randint(1000, size=(20, 10)))
      df = md.DataFrame(raw_data, chunk_size=5)
  
      for col, series in df.iteritems():
          pd.testing.assert_series_equal(
              series.execute().fetch(), raw_data[col]
          )
  
      for i, batch in enumerate(df.iterbatch(batch_size=15)):
          pd.testing.assert_frame_equal(
              batch, raw_data.iloc[i * 15 : (i + 1) * 15]
          )
  
      i = 0
      for result_row, expect_row in zip(
          df.iterrows(batch_size=15), raw_data.iterrows()
      ):
          assert result_row[0] == expect_row[0]
          pd.testing.assert_series_equal(result_row[1], expect_row[1])
          i += 1
  
      assert i == len(raw_data)
  
      i = 0
      for result_tup, expect_tup in zip(
          df.itertuples(batch_size=10), raw_data.itertuples()
      ):
          assert result_tup == expect_tup
          i += 1
  
      assert i == len(raw_data)
  
      raw_data = pd.Series(np.random.randint(1000, size=(20,)))
      s = md.Series(raw_data, chunk_size=5)
  
      for i, batch in enumerate(s.iterbatch(batch_size=15)):
          pd.testing.assert_series_equal(
              batch, raw_data.iloc[i * 15 : (i + 1) * 15]
          )
  
      i = 0
      for result_item, expect_item in zip(
          s.iteritems(batch_size=15), raw_data.iteritems()
      ):
          assert result_item[0] == expect_item[0]
          assert result_item[1] == expect_item[1]
          i += 1
  
      assert i == len(raw_data)
  
      # test to_dict
      assert s.to_dict() == raw_data.to_dict()
  
imports: import io
  import os
  import re
  import sys
  import tempfile
  from collections import namedtuple
  import numpy
  import pandas
  import pytest
  from ..None import tensor
  from ..None import dataframe
  from ..None import remote
  from ..config import option_context
  from ..deploy.utils import load_service_config_file
  from ..session import execute, fetch, fetch_log
label_desc: Use image node_id 11 for calling a global function with example usage: test_iter(setup) without return types