code: def _test_trend(degree, with_intercept):
      """Check trend, helper function."""
      y = make_forecasting_problem()
      forecaster = PolynomialTrendForecaster(
          degree=degree, with_intercept=with_intercept
      )
      forecaster.fit(y)
  
      # check coefficients
      # intercept is added in reverse order
      actual = forecaster.regressor_.steps[-1][1].coef_[::-1]
      expected = get_expected_polynomial_coefs(
          y, degree, with_intercept
      )
      np.testing.assert_allclose(actual, expected, rtol=1e-5)
  
file_path: sktime/sktime/forecasting/trend/tests/test_trend.py
imports: import numpy
  import pandas
  import pytest
  from sktime.datasets import load_airline
  from sktime.forecasting.trend import PolynomialTrendForecaster, TrendForecaster
  from sktime.forecasting.trend._util import _get_X_numpy_int_from_pandas
  from sktime.utils._testing.forecasting import make_forecasting_problem
label_desc: Use image node_id 3 for calling a global function with example usage: _test_trend(degree, with_intercept) without return types