code: def test_frame_init_df_target_setter(self):
      # initialization by dataframe and dataframe
      df = pd.DataFrame(
          {"A": [1, 2, 3], "B": [4, 5, 6], "C": [7, 8, 9]},
          index=["a", "b", "c"],
          columns=["A", "B", "C"],
      )
      mdf = pdml.ModelFrame(df)
      self.assertFalse(mdf.has_target())
      target = pd.DataFrame(
          {"t1": [10, 11, 12], "t2": [13, 14, 15]},
          index=["a", "b", "c"],
      )
      mdf.target = target
  
      self.assertIsInstance(mdf, pdml.ModelFrame)
      self.assertEqual(mdf.shape, (3, 5))
      expected = pd.DataFrame(
          {
              "t1": [10, 11, 12],
              "t2": [13, 14, 15],
              "A": [1, 2, 3],
              "B": [4, 5, 6],
              "C": [7, 8, 9],
          },
          index=["a", "b", "c"],
          columns=["t1", "t2", "A", "B", "C"],
      )
      tm.assert_frame_equal(mdf, expected)
      tm.assert_index_equal(mdf.index, pd.Index(["a", "b", "c"]))
      tm.assert_index_equal(
          mdf.columns, pd.Index(["t1", "t2", "A", "B", "C"])
      )
      tm.assert_frame_equal(mdf.data, df)
      tm.assert_frame_equal(mdf.target, target)
      tm.assert_index_equal(mdf.target.columns, pd.Index(["t1", "t2"]))
      tm.assert_index_equal(mdf.target_name, pd.Index(["t1", "t2"]))
      self.assertTrue(mdf.has_multi_targets())
  
      target = pd.DataFrame(
          {"x1": [20, 21, 22], "x2": [23, 24, 25]},
          index=["a", "b", "c"],
      )
  
      with tm.assert_produces_warning(UserWarning):
          # when the target has the same length as the target_name,
          # is renamed to existing target ['t1', 't2']
          mdf.target = target
  
      self.assertIsInstance(mdf, pdml.ModelFrame)
      self.assertEqual(mdf.shape, (3, 5))
      expected = pd.DataFrame(
          {
              "t1": [20, 21, 22],
              "t2": [23, 24, 25],
              "A": [1, 2, 3],
              "B": [4, 5, 6],
              "C": [7, 8, 9],
          },
          index=["a", "b", "c"],
          columns=["t1", "t2", "A", "B", "C"],
      )
      tm.assert_frame_equal(mdf, expected)
      tm.assert_index_equal(mdf.index, pd.Index(["a", "b", "c"]))
      tm.assert_index_equal(
          mdf.columns, pd.Index(["t1", "t2", "A", "B", "C"])
      )
      tm.assert_frame_equal(mdf.data, df)
      expected = pd.DataFrame(
          {"t1": [20, 21, 22], "t2": [23, 24, 25]},
          index=["a", "b", "c"],
      )
      tm.assert_frame_equal(mdf.target, expected)
      tm.assert_index_equal(mdf.target.columns, pd.Index(["t1", "t2"]))
      tm.assert_index_equal(mdf.target_name, pd.Index(["t1", "t2"]))
      self.assertTrue(mdf.has_multi_targets())
  
      target = pd.DataFrame(
          {"x1": [20, 21, 22], "x2": [23, 24, 25], "x3": [25, 26, 27]},
          index=["a", "b", "c"],
      )
  
      # when the target has the different length as the target_name,
      # target is being replaced
      mdf.target = target
  
      self.assertIsInstance(mdf, pdml.ModelFrame)
      self.assertEqual(mdf.shape, (3, 6))
      expected = pd.DataFrame(
          {
              "x1": [20, 21, 22],
              "x2": [23, 24, 25],
              "x3": [25, 26, 27],
              "A": [1, 2, 3],
              "B": [4, 5, 6],
              "C": [7, 8, 9],
          },
          index=["a", "b", "c"],
          columns=["x1", "x2", "x3", "A", "B", "C"],
      )
      tm.assert_frame_equal(mdf, expected)
      tm.assert_index_equal(mdf.index, pd.Index(["a", "b", "c"]))
      tm.assert_index_equal(
          mdf.columns, pd.Index(["x1", "x2", "x3", "A", "B", "C"])
      )
      tm.assert_frame_equal(mdf.data, df)
      tm.assert_frame_equal(mdf.target, target)
      tm.assert_index_equal(
          mdf.target.columns, pd.Index(["x1", "x2", "x3"])
      )
      tm.assert_index_equal(
          mdf.target_name, pd.Index(["x1", "x2", "x3"])
      )
      self.assertTrue(mdf.has_multi_targets())
  
imports: import pytest
  import datetime
  import warnings
  import numpy
  import pandas
  import sklearn.datasets
  import sklearn.svm
  import pandas_ml
  import pandas_ml.util.testing
label_desc: Use image node_id 3 for calling the TestModelFrameMultiTarges obj's underlying member method code with example usage: obj.test_frame_init_df_target_setter() without return types