code: def test_vectorization_preserves_row_index_names(method):
      """Test that forecaster vectorization preserves row index names in forecast."""
      hierarchy_levels = (2, 4)
      y = _make_hierarchical(
          hierarchy_levels=hierarchy_levels, random_state=84
      )
  
      est = ARIMA().fit(y, fh=[1, 2, 3])
      y_pred = getattr(est, method)()
  
      msg = (
          f"vectorization of forecaster method {method} changes row index names, "
          f"but it shouldn't. Tested using the ARIMA forecaster."
      )
  
      assert y_pred.index.names == y.index.names, msg
  
imports: from functools import reduce
  from operator import mul
  import numpy
  import pandas
  import pytest
  from pandas.testing import assert_series_equal
  from sktime.datatypes import check_is_mtype, convert
  from sktime.datatypes._utilities import get_cutoff, get_window
  from sktime.forecasting.arima import ARIMA
  from sktime.forecasting.naive import NaiveForecaster
  from sktime.forecasting.theta import ThetaForecaster
  from sktime.forecasting.var import VAR
  from sktime.utils._testing.hierarchical import _make_hierarchical
  from sktime.utils._testing.panel import _make_panel
  from sktime.utils._testing.series import _make_series
  from sktime.utils.parallel import _get_parallel_test_fixtures
  from sktime.utils.validation._dependencies import _check_estimator_deps
label_desc: Use image node_id 5 for calling a global function with example usage: test_vectorization_preserves_row_index_names(method) without return types