code: def test_fh_expected_pred():
      """Test for expected prediction index method."""
      fh = ForecastingHorizon([1, 2, 3])
      y_pred_idx = fh.get_expected_pred_idx(pd.Index([2, 3, 4]))
  
      assert y_pred_idx.equals(pd.Index([5, 6, 7]))
  
      y_df = pd.DataFrame([1, 2, 3], index=[2, 3, 4])
      y_pred_idx = fh.get_expected_pred_idx(y_df)
  
      assert y_pred_idx.equals(pd.Index([5, 6, 7]))
  
      # pd.MultiIndex case, 2 levels
      idx = pd.MultiIndex.from_tuples(
          [("a", 3), ("a", 5), ("b", 4), ("b", 5), ("b", 6)]
      )
      y_pred_idx = fh.get_expected_pred_idx(idx)
  
      y_pred_idx_expected = pd.MultiIndex.from_tuples(
          [("a", 6), ("a", 7), ("a", 8), ("b", 7), ("b", 8), ("b", 9)]
      )
      assert y_pred_idx.equals(y_pred_idx_expected)
  
      y_pred_idx = fh.get_expected_pred_idx(idx, sort_by_time=True)
      y_pred_idx_expected = pd.MultiIndex.from_tuples(
          [("a", 6), ("a", 7), ("b", 7), ("a", 8), ("b", 8), ("b", 9)]
      )
      assert y_pred_idx.equals(y_pred_idx_expected)
  
      # pd.MultiIndex case, 3 levels
      idx = pd.MultiIndex.from_tuples(
          [
              ("a", 3, 4),
              ("a", 3, 5),
              ("b", 5, 4),
              ("b", 5, 5),
              ("b", 5, 6),
          ]
      )
      y_pred_idx = fh.get_expected_pred_idx(idx)
  
      y_pred_idx_expected = pd.MultiIndex.from_tuples(
          [
              ("a", 3, 6),
              ("a", 3, 7),
              ("a", 3, 8),
              ("b", 5, 7),
              ("b", 5, 8),
              ("b", 5, 9),
          ]
      )
      assert y_pred_idx.equals(y_pred_idx_expected)
  
      y_pred_idx = fh.get_expected_pred_idx(idx, sort_by_time=True)
  
      y_pred_idx_expected = pd.MultiIndex.from_tuples(
          [
              ("a", 3, 6),
              ("a", 3, 7),
              ("b", 5, 7),
              ("a", 3, 8),
              ("b", 5, 8),
              ("b", 5, 9),
          ]
      )
      assert y_pred_idx.equals(y_pred_idx_expected)
  
imports: from datetime import timedelta
  import numpy
  import pandas
  import pytest
  from numpy.testing._private.utils import assert_array_equal
  from pytest import raises
  from sktime.datasets import load_airline
  from sktime.datatypes._utilities import get_cutoff
  from sktime.forecasting.arima import AutoARIMA
  from sktime.forecasting.base import ForecastingHorizon
  from sktime.forecasting.base._fh import DELEGATED_METHODS, _check_freq, _extract_freq_from_cutoff
  from sktime.forecasting.ets import AutoETS
  from sktime.forecasting.exp_smoothing import ExponentialSmoothing
  from sktime.forecasting.naive import NaiveForecaster
  from sktime.forecasting.tests._config import INDEX_TYPE_LOOKUP, TEST_FHS, TEST_FHS_TIMEDELTA, VALID_INDEX_FH_COMBINATIONS
  from sktime.split import temporal_train_test_split
  from sktime.tests.test_switch import run_test_for_class
  from sktime.utils._testing.forecasting import _make_fh, make_forecasting_problem
  from sktime.utils._testing.series import _make_index, _make_series
  from sktime.utils.datetime import _coerce_duration_to_int, _get_duration, _get_freq, _get_intervals_count_and_unit, _shift, infer_freq
  from sktime.utils.validation.series import is_in_valid_index_types, is_integer_index
label_desc: Use image node_id 39 for calling a global function with example usage: test_fh_expected_pred() without return types