code: def test_split_keep_index(self):
      df = pdml.ModelFrame(
          {
              "A": [1, 2, 3, 4, 5, 6, 7, 8],
              "B": [1, 2, 3, 4, 5, 6, 7, 8],
          },
          index="a b c d e f g h".split(" "),
      )
      kf = df.model_selection.KFold(3, random_state=self.random_state)
      folded = [f for f in df.model_selection.split(kf)]
      self.assertEqual(len(folded), 3)
      tm.assert_frame_equal(folded[0][0], df.iloc[3:, :])
      tm.assert_frame_equal(folded[0][1], df.iloc[:3, :])
      tm.assert_frame_equal(folded[1][0], df.iloc[[0, 1, 2, 6, 7], :])
      tm.assert_frame_equal(folded[1][1], df.iloc[3:6, :])
      tm.assert_frame_equal(folded[2][0], df.iloc[:6, :])
      tm.assert_frame_equal(folded[2][1], df.iloc[6:, :])
  
      folded = [
          f for f in df.model_selection.split(kf, reset_index=True)
      ]
      self.assertEqual(len(folded), 3)
      tm.assert_frame_equal(
          folded[0][0], df.iloc[3:, :].reset_index(drop=True)
      )
      tm.assert_frame_equal(
          folded[0][1], df.iloc[:3, :].reset_index(drop=True)
      )
      tm.assert_frame_equal(
          folded[1][0],
          df.iloc[[0, 1, 2, 6, 7], :].reset_index(drop=True),
      )
      tm.assert_frame_equal(
          folded[1][1], df.iloc[3:6, :].reset_index(drop=True)
      )
      tm.assert_frame_equal(
          folded[2][0], df.iloc[:6, :].reset_index(drop=True)
      )
      tm.assert_frame_equal(
          folded[2][1], df.iloc[6:, :].reset_index(drop=True)
      )
  
imports: import sklearn.datasets
  import sklearn.svm
  import sklearn.naive_bayes
  import numpy
  import pandas
  import pandas_ml
  import pandas_ml.util.testing
label_desc: Use image node_id 3 for calling the TestSplitter obj's underlying member method code with example usage: obj.test_split_keep_index() without return types