code: def test_train_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(" "),
      )
      tr, te = df.ms.train_test_split(random_state=self.random_state)
      tm.assert_frame_equal(tr, df.loc[["g", "a", "e", "f", "d", "h"]])
      tm.assert_frame_equal(te, df.loc[["c", "b"]])
  
      tr, te = df.ms.train_test_split(
          random_state=self.random_state, reset_index=True
      )
      tm.assert_frame_equal(
          tr,
          df.loc[["g", "a", "e", "f", "d", "h"]].reset_index(drop=True),
      )
      tm.assert_frame_equal(
          te, df.loc[["c", "b"]].reset_index(drop=True)
      )
  
      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(" "),
          target=[1, 2, 3, 4, 5, 6, 7, 8],
      )
      tr, te = df.ms.train_test_split(random_state=self.random_state)
      tm.assert_frame_equal(tr, df.loc[["g", "a", "e", "f", "d", "h"]])
      tm.assert_numpy_array_equal(
          tr.target.values, np.array([7, 1, 5, 6, 4, 8])
      )
      tm.assert_frame_equal(te, df.loc[["c", "b"]])
      tm.assert_numpy_array_equal(te.target.values, np.array([3, 2]))
  
      tr, te = df.ms.train_test_split(
          random_state=self.random_state, reset_index=True
      )
      tm.assert_frame_equal(
          tr,
          df.loc[["g", "a", "e", "f", "d", "h"]].reset_index(drop=True),
      )
      tm.assert_numpy_array_equal(
          tr.target.values, np.array([7, 1, 5, 6, 4, 8])
      )
      tm.assert_frame_equal(
          te, df.loc[["c", "b"]].reset_index(drop=True)
      )
      tm.assert_numpy_array_equal(te.target.values, np.array([3, 2]))
  
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 6 for calling the TestSplitter obj's underlying member method code with example usage: obj.test_train_test_split_keep_index() without return types