code: def test_frame_target_proparty(self):
      df = pd.DataFrame(
          {"A": [1, 2, 3], "B": [4, 5, 6], "C": [7, 8, 9]},
          index=["a", "b", "c"],
          columns=["A", "B", "C"],
      )
      s = pd.Series([1, 2, 3], index=["a", "b", "c"])
      mdf = pdml.ModelFrame(df, target=s)
  
      new = pd.Series([4, 5, 6], index=["a", "b", "c"], name=".target")
      # set target property
      mdf.target = new
  
      self.assertIsInstance(mdf, pdml.ModelFrame)
      self.assertEqual(mdf.shape, (3, 4))
      tm.assert_index_equal(mdf.index, pd.Index(["a", "b", "c"]))
      tm.assert_index_equal(
          mdf.columns, pd.Index([".target", "A", "B", "C"])
      )
      tm.assert_frame_equal(mdf.data, df)
      tm.assert_series_equal(mdf.target, new)
      self.assertEqual(mdf.target.name, ".target")
      self.assertEqual(mdf.target_name, ".target")
  
      with tm.assert_produces_warning(UserWarning):
          new = pd.Series([4, 5, 6], index=["a", "b", "c"], name="xxx")
          # set target property
          mdf.target = new
  
          self.assertIsInstance(mdf, pdml.ModelFrame)
          self.assertEqual(mdf.shape, (3, 4))
          tm.assert_index_equal(mdf.index, pd.Index(["a", "b", "c"]))
          tm.assert_index_equal(
              mdf.columns, pd.Index([".target", "A", "B", "C"])
          )
          tm.assert_frame_equal(mdf.data, df)
  
          exp_target = pd.Series(new, name=".target")
          tm.assert_series_equal(mdf.target, exp_target)
          self.assertEqual(mdf.target.name, ".target")
          self.assertEqual(mdf.target_name, ".target")
  
      new = pd.Series([4, 5, 6], name=".target")
      with pytest.raises(
          ValueError, match="data and target must have equal index"
      ):
          mdf.target = new
  
      # set target property
      mdf.target = [7, 8, 9]
  
      self.assertIsInstance(mdf, pdml.ModelFrame)
      self.assertEqual(mdf.shape, (3, 4))
      tm.assert_index_equal(mdf.index, pd.Index(["a", "b", "c"]))
      tm.assert_index_equal(
          mdf.columns, pd.Index([".target", "A", "B", "C"])
      )
      tm.assert_frame_equal(mdf.data, df)
      expected = pd.Series(
          [7, 8, 9], index=["a", "b", "c"], name=".target"
      )
      tm.assert_series_equal(mdf.target, expected)
      self.assertEqual(mdf.target.name, ".target")
      self.assertEqual(mdf.target_name, ".target")
  
      if pdml.compat._PANDAS_ge_023:
          msg = "Length of passed values is 2, index implies 3"
      else:
          msg = "Wrong number of items passed 2, placement implies 3"
  
      with pytest.raises(ValueError, match=msg):
          mdf.target = [1, 2]
  
      # set target property
      mdf.target = None
  
      self.assertIsInstance(mdf, pdml.ModelFrame)
      self.assertEqual(mdf.shape, (3, 3))
      tm.assert_index_equal(mdf.index, pd.Index(["a", "b", "c"]))
      tm.assert_index_equal(mdf.columns, pd.Index(["A", "B", "C"]))
      tm.assert_frame_equal(mdf.data, df)
      self.assertEqual(mdf.target_name, ".target")
  
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 14 for calling the TestModelFrame obj's underlying member method code with example usage: obj.test_frame_target_proparty() without return types