code: def test_pwl_trend_nonnative_index(indextype):
      """Check pwl detrend with RangeIndex and PeriodIndex."""
      y = pd.DataFrame({"a": [1, 2, 3, 4]})
  
      if indextype == "period":
          y.index = pd.period_range("2000-01-01", periods=4)
  
      fh = [1, 2]
  
      f = ProphetPiecewiseLinearTrendForecaster()
      f.fit(y)
      y_pred = f.predict(fh=fh)
  
      if indextype == "range":
          assert pd.api.types.is_integer_dtype(y_pred.index)
      if indextype == "period":
          assert isinstance(y_pred.index, pd.PeriodIndex)
  
file_path: sktime/sktime/forecasting/trend/tests/test_pwl_trend.py
imports: import numpy
  import pandas
  import pytest
  from sktime.datasets import load_airline
  from sktime.forecasting.base import ForecastingHorizon
  from sktime.forecasting.trend import PolynomialTrendForecaster, ProphetPiecewiseLinearTrendForecaster
  from sktime.split import temporal_train_test_split
  from sktime.tests.test_switch import run_test_for_class
label_desc: Use image node_id 4 for calling a global function with example usage: test_pwl_trend_nonnative_index(indextype) without return types