code: def test_repeated_measures_aggregate_func():
      double_data = pd.concat([data, data], axis=0)
      assert_raises(
          ValueError,
          AnovaRM,
          double_data,
          "DV",
          "id",
          within=["A", "B", "D"],
      )
  
      m1 = AnovaRM(
          double_data,
          "DV",
          "id",
          within=["A", "B", "D"],
          aggregate_func=pd.Series.mean,
      )
      m2 = AnovaRM(
          double_data,
          "DV",
          "id",
          within=["A", "B", "D"],
          aggregate_func=pd.Series.median,
      )
  
      assert_raises(
          AssertionError,
          assert_equal,
          m1.aggregate_func,
          m2.aggregate_func,
      )
      assert_frame_equal(m1.fit().anova_table, m2.fit().anova_table)
  
file_path: statsmodels/statsmodels/stats/tests/test_anova_rm.py
imports: from statsmodels.compat.pandas import assert_frame_equal
  from numpy.testing import assert_array_almost_equal, assert_equal, assert_raises
  import pandas
  from statsmodels.stats.anova import AnovaRM
label_desc: Use image node_id 9 for calling a global function with example usage: test_repeated_measures_aggregate_func() without return types