code: def test_frame_loc_setitem(self):
      pdf = pd.DataFrame(
          [[1, 2], [4, 5], [7, 8]],
          index=["cobra", "viper", "sidewinder"],
          columns=["max_speed", "shield"],
      )
      psdf = ps.from_pandas(pdf)
  
      pser1 = pdf.max_speed
      pser2 = pdf.shield
      psser1 = psdf.max_speed
      psser2 = psdf.shield
  
      pdf.loc[["viper", "sidewinder"], ["shield", "max_speed"]] = 10
      psdf.loc[["viper", "sidewinder"], ["shield", "max_speed"]] = 10
      self.assert_eq(psdf, pdf)
      self.assert_eq(psser1, pser1)
      self.assert_eq(psser2, pser2)
  
      pdf.loc[["viper", "sidewinder"], "shield"] = 50
      psdf.loc[["viper", "sidewinder"], "shield"] = 50
      self.assert_eq(psdf, pdf)
      self.assert_eq(psser1, pser1)
      self.assert_eq(psser2, pser2)
  
      pdf.loc["cobra", "max_speed"] = 30
      psdf.loc["cobra", "max_speed"] = 30
      self.assert_eq(psdf, pdf)
      self.assert_eq(psser1, pser1)
      self.assert_eq(psser2, pser2)
  
      pdf.loc[pdf.max_speed < 5, "max_speed"] = -pdf.max_speed
      psdf.loc[psdf.max_speed < 5, "max_speed"] = -psdf.max_speed
      self.assert_eq(psdf, pdf)
      self.assert_eq(psser1, pser1)
      self.assert_eq(psser2, pser2)
  
      pdf.loc[pdf.max_speed < 2, "max_speed"] = -pdf.max_speed
      psdf.loc[psdf.max_speed < 2, "max_speed"] = -psdf.max_speed
      self.assert_eq(psdf, pdf)
      self.assert_eq(psser1, pser1)
      self.assert_eq(psser2, pser2)
  
      pdf.loc[:, "min_speed"] = 0
      psdf.loc[:, "min_speed"] = 0
      self.assert_eq(psdf, pdf, almost=True)
      self.assert_eq(psser1, pser1)
      self.assert_eq(psser2, pser2)
  
      with self.assertRaisesRegex(
          ValueError, "Incompatible indexer with Series"
      ):
          psdf.loc["cobra", "max_speed"] = -psdf.max_speed
      with self.assertRaisesRegex(ValueError, "shape mismatch"):
          psdf.loc[:, ["shield", "max_speed"]] = -psdf.max_speed
      with self.assertRaisesRegex(
          ValueError, "Only a dataframe with one column can be assigned"
      ):
          psdf.loc[:, "max_speed"] = psdf
  
      # multi-index columns
      columns = pd.MultiIndex.from_tuples(
          [("x", "max_speed"), ("x", "shield"), ("y", "min_speed")]
      )
      pdf.columns = columns
      psdf.columns = columns
  
      pdf.loc[:, ("y", "shield")] = -pdf[("x", "shield")]
      psdf.loc[:, ("y", "shield")] = -psdf[("x", "shield")]
      self.assert_eq(psdf, pdf, almost=True)
      self.assert_eq(psser1, pser1)
      self.assert_eq(psser2, pser2)
  
      pdf.loc[:, "z"] = 100
      psdf.loc[:, "z"] = 100
      self.assert_eq(psdf, pdf, almost=True)
      self.assert_eq(psser1, pser1)
      self.assert_eq(psser2, pser2)
  
      with self.assertRaisesRegex(
          KeyError, "Key length \\(3\\) exceeds index depth \\(2\\)"
      ):
          psdf.loc[:, [("x", "max_speed", "foo")]] = -psdf[
              ("x", "shield")
          ]
  
      pdf = pd.DataFrame(
          [[1], [4], [7]],
          index=["cobra", "viper", "sidewinder"],
          columns=["max_speed"],
      )
      psdf = ps.from_pandas(pdf)
  
      pdf.loc[:, "max_speed"] = pdf
      psdf.loc[:, "max_speed"] = psdf
      self.assert_eq(psdf, pdf)
  
imports: import unittest
  import numpy
  import pandas
  from pyspark import pandas
  from pyspark.testing.pandasutils import PandasOnSparkTestCase
  from pyspark.testing.sqlutils import SQLTestUtils
label_desc: Use image node_id 14 for calling the IndexingLocMixin obj's underlying member method code with example usage: obj.test_frame_loc_setitem() without return types