code: def test_fit_remove_add_trend(order, n_instances, n_timepoints):
      """Test fitted coefficients."""
      coefs = np.random.normal(size=order + 1).reshape(-1, 1)
      x = np.column_stack(
          [
              _generate_polynomial_series(
                  n_timepoints, order, coefs=coefs
              )
              for _ in range(n_instances)
          ]
      ).T
      # assert x.shape == (n_samples, n_obs)
  
      # check shape of fitted coefficients
      coefs = _fit_trend(x, order=order)
      assert coefs.shape == (n_instances, order + 1)
  
imports: import numpy
  import pytest
  from scipy.stats import linregress
  from sktime.utils._testing.forecasting import _generate_polynomial_series
  from sktime.utils.slope_and_trend import _fit_trend, _slope
label_desc: Use image node_id 3 for calling a global function with example usage: test_fit_remove_add_trend(order, n_instances, n_timepoints) without return types