code: def get_yearly_seasonality_order(
      df: pd.DataFrame,
      time_col: str,
      value_col: str,
      resample_freq: str,
  ) -> int:
      """Infers the yearly seasonality order for changepoint detection.
  
      Parameters
      ----------
      df : `pandas.DataFrame`
          The input timeseris.
      time_col : `str`
          The column name for timestamps in ``df``.
      value_col : `str`
          The column name for values in ``df``.
      resample_freq : `str`
          The aggregation frequency string in changepoint detection configuration.
  
      Returns
      -------
      yearly_seasonality_order : `int`
          The inferred yearly seasonality with the best BIC score.
      """
      model = SeasonalityInferrer()
      result = model.infer_fourier_series_order(
          df=df,
          time_col=time_col,
          value_col=value_col,
          configs=[
              SeasonalityInferConfig(
                  seas_name="yearly",
                  col_name="toy",
                  period=1.0,
                  max_order=30,
                  adjust_trend_method=TrendAdjustMethodEnum.seasonal_average.name,
                  adjust_trend_param=dict(trend_average_col="year"),
                  fit_algorithm="ridge",
                  offset=0,
                  tolerance=0.0,
                  aggregation_period=resample_freq,
                  criterion="bic",
                  plotting=False,
              )
          ],
      )
      return result["best_orders"]["yearly"]
  
file_path: greykite/greykite/algo/changepoint/adalasso/auto_changepoint_params.py
imports: from datetime import timedelta
  from typing import Optional
  import numpy
  import pandas
  from pandas.tseries.frequencies import to_offset
  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.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
label_desc: Use image node_id 2 for calling a global function with example usage: get_yearly_seasonality_order(df, time_col, value_col, resample_freq) and returns: result