code: def test_groupby_rolling_index_changed(self, func):
      # GH: #36018 nlevels of MultiIndex changed
      ds = Series(
          [1, 2, 2],
          index=MultiIndex.from_tuples(
              [("a", "x"), ("a", "y"), ("c", "z")], names=["1", "2"]
          ),
          name="a",
      )
  
      result = getattr(ds.groupby(ds).rolling(2), func)()
      expected = Series(
          [np.nan, np.nan, 2.0],
          index=MultiIndex.from_tuples(
              [(1, "a", "x"), (2, "a", "y"), (2, "c", "z")],
              names=["a", "1", "2"],
          ),
          name="a",
      )
      tm.assert_series_equal(result, expected)
  
imports: import numpy
  import pytest
  from pandas import DataFrame, DatetimeIndex, Index, MultiIndex, Series, Timestamp, date_range, to_datetime
  import pandas._testing
  from pandas.api.indexers import BaseIndexer
  from pandas.core.groupby.groupby import get_groupby
label_desc: Use image node_id 21 for calling the TestRolling obj's underlying member method code with example usage: obj.test_groupby_rolling_index_changed(func) without return types