code: def _coerce_int_to_range_index(y, X=None):
      new_index = pd.RangeIndex(y.index[0], y.index[-1] + 1)
      try:
          np.testing.assert_array_equal(y.index, new_index)
      except AssertionError:
          raise ValueError(
              "Coercion of integer pd.Index to pd.RangeIndex "
              "failed. Please provide `y_train` with a "
              "pd.RangeIndex."
          )
      y.index = new_index
      if X is not None:
          X.index = new_index
      return y, X
  
file_path: sktime/sktime/forecasting/base/adapters/_statsmodels.py
imports: import inspect
  import numpy
  import pandas
  from sktime.forecasting.base import BaseForecaster
  from sktime.utils.warnings import warn
label_desc: Use image node_id 1 for calling a global function with example usage: _coerce_int_to_range_index(y, X) and returns: y,  X