code: def test_calendar_fourier(reset_randomstate):
      inc = np.abs(np.random.standard_normal(1000))
      inc = np.cumsum(inc)
      inc = 10 * inc / inc[-1]
      offset = (24 * 3600 * inc).astype(np.int64)
      base = pd.Timestamp("2000-1-1")
      index = [base + pd.Timedelta(val, unit="s") for val in offset]
      index = pd.Index(index)
  
      cf = CalendarFourier("D", 2)
      assert cf.order == 2
      terms = cf.in_sample(index)
      cols = []
      for i in range(2 * cf.order):
          fn = "cos" if (i % 2) else "sin"
          cols.append(f"{fn}({(i // 2) + 1},freq=D)")
      assert list(terms.columns) == cols
  
      inc = offset / (24 * 3600)
      loc = 2 * np.pi * (inc - np.floor(inc))
      expected = []
      for i in range(4):
          scale = i // 2 + 1
          fn = np.cos if (i % 2) else np.sin
          expected.append(fn(scale * loc))
      expected = np.column_stack(expected)
      np.testing.assert_allclose(expected, terms.values)
  
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 22 for calling a global function with example usage: test_calendar_fourier(reset_randomstate) without return types