code: def test_aggregate_relabel_multiindex(self):
      pdf = pd.DataFrame(
          {
              "A": [0, 1, 2, 3],
              "B": [5, 6, 7, 8],
              "group": ["a", "a", "b", "b"],
          }
      )
      pdf.columns = pd.MultiIndex.from_tuples(
          [("y", "A"), ("y", "B"), ("x", "group")]
      )
      psdf = ps.from_pandas(pdf)
  
      agg_pdf = (
          pdf.groupby(("x", "group"))
          .agg(a_max=(("y", "A"), "max"))
          .sort_index()
      )
      agg_psdf = (
          psdf.groupby(("x", "group"))
          .agg(a_max=(("y", "A"), "max"))
          .sort_index()
      )
      self.assert_eq(agg_pdf, agg_psdf)
  
      # same column, different methods
      agg_pdf = (
          pdf.groupby(("x", "group"))
          .agg(a_max=(("y", "A"), "max"), a_min=(("y", "A"), "min"))
          .sort_index()
      )
      agg_psdf = (
          psdf.groupby(("x", "group"))
          .agg(a_max=(("y", "A"), "max"), a_min=(("y", "A"), "min"))
          .sort_index()
      )
      self.assert_eq(agg_pdf, agg_psdf)
  
      # different column, different methods
      agg_pdf = (
          pdf.groupby(("x", "group"))
          .agg(a_max=(("y", "B"), "max"), a_min=(("y", "A"), "min"))
          .sort_index()
      )
      agg_psdf = (
          psdf.groupby(("x", "group"))
          .agg(a_max=(("y", "B"), "max"), a_min=(("y", "A"), "min"))
          .sort_index()
      )
      self.assert_eq(agg_pdf, agg_psdf)
  
file_path: spark/python/pyspark/pandas/tests/groupby/test_aggregate.py
imports: import unittest
  import pandas
  from pyspark import pandas
  from pyspark.testing.pandasutils import ComparisonTestBase
  from pyspark.testing.sqlutils import SQLTestUtils
label_desc: Use image node_id 4 for calling the GroupbyAggregateMixin obj's underlying member method code with example usage: obj.test_aggregate_relabel_multiindex() without return types