code: def test_fourier(index):
      f = Fourier(period=12, order=3)
      terms = f.in_sample(index)
      assert f.order == 3
      assert terms.shape == (index.shape[0], 2 * f.order)
      loc = np.arange(index.shape[0]) / 12
      for i, col in enumerate(terms):
          j = i // 2 + 1
          fn = np.cos if (i % 2) else np.sin
          expected = fn(2 * np.pi * j * loc)
          np.testing.assert_allclose(terms[col], expected, atol=1e-8)
      cols = []
      for i in range(2 * f.order):
          fn = "cos" if (i % 2) else "sin"
          cols.append(f"{fn}({(i // 2) + 1},12)")
      assert list(terms.columns) == cols
  
imports: from statsmodels.compat.pandas import MONTH_END, PD_LT_1_0_0, QUARTER_END, YEAR_END, is_int_index
  from statsmodels.compat.pytest import pytest_warns
  from collections.abc import Hashable
  import numpy
  import pandas
  import pytest
  from statsmodels.tsa.deterministic import CalendarFourier, CalendarSeasonality, CalendarTimeTrend, DeterministicProcess, DeterministicTerm, Fourier, Seasonality, TimeTrend
label_desc: Use image node_id 20 for calling a global function with example usage: test_fourier(index) without return types