code: def test_infer_order(df):
      """Tests the full functionality of inferring orders."""
      model = SeasonalityInferrer()
      result = model.infer_fourier_series_order(
          df=df,
          time_col=cst.TIME_COL,
          value_col=cst.VALUE_COL,
          configs=[
              SeasonalityInferConfig(
                  seas_name="yearly",
                  col_name="toy",
                  period=1.0,
                  max_order=50,
                  adjust_trend_param=dict(trend_average_col="year"),
                  tolerance=0.0,
                  aggregation_period="W",
                  offset=0,
              ),
              SeasonalityInferConfig(
                  seas_name="quarterly",
                  col_name="toq",
                  period=1.0,
                  max_order=20,
                  adjust_trend_param=dict(
                      trend_average_col="year_quarter"
                  ),
                  tolerance=0.0,
                  aggregation_period="2D",
                  offset=0,
              ),
              SeasonalityInferConfig(
                  seas_name="monthly",
                  col_name="tom",
                  period=1.0,
                  max_order=20,
                  adjust_trend_param=dict(
                      trend_average_col="year_month"
                  ),
                  tolerance=0.0,
                  aggregation_period=None,
                  offset=2,
              ),
              SeasonalityInferConfig(
                  seas_name="weekly",
                  col_name="tow",
                  period=7.0,
                  max_order=10,
                  adjust_trend_param=dict(
                      trend_average_col="year_woy_iso"
                  ),
                  tolerance=0.005,
                  aggregation_period=None,
                  offset=-100,
              ),
          ],
          adjust_trend_method="seasonal_average",
          fit_algorithm="linear",
          plotting=True,
          criterion="bic",
      )
      assert len(result["result"]) == 4
      assert result["result"][0]["seas_name"] == "yearly"
      assert result["result"][1]["seas_name"] == "quarterly"
      assert result["result"][2]["seas_name"] == "monthly"
      assert result["result"][3]["seas_name"] == "weekly"
      assert len(result["result"][0]["orders"]) == 50
      assert len(result["result"][1]["aics"]) == 20
      assert len(result["result"][2]["bics"]) == 20
      assert result["result"][2]["best_bic_order"] > 0
      assert (
          result["best_orders"]["weekly"] == 0
      )  # offset is truncated at 0
      assert len(result["result"][1]["fig"].data) == 8
  
file_path: greykite/greykite/tests/algo/common/test_seasonality_inferrer.py
imports: from copy import deepcopy
  import pandas
  import pytest
  from greykite.algo.common.seasonality_inferrer import SeasonalityInferConfig
  from greykite.algo.common.seasonality_inferrer import SeasonalityInferrer
  from greykite.algo.common.seasonality_inferrer import TrendAdjustMethodEnum
  from greykite.common import constants
  from greykite.common.testing_utils import assert_equal
  from greykite.common.testing_utils import generate_df_for_tests
  from greykite.common.time_properties import infer_freq
label_desc: Use image node_id 10 for calling a global function with example usage: test_infer_order(df) without return types