code: def get_auto_seasonality(
      df: pd.DataFrame,
      time_col: str,
      value_col: str,
      yearly_seasonality: bool = True,
      quarterly_seasonality: bool = True,
      monthly_seasonality: bool = True,
      weekly_seasonality: bool = True,
      daily_seasonality: bool = True,
  ):
      """Automatically infers the following seasonality Fourier series orders:
  
          - yearly seasonality
          - quarterly seasonality
          - monthly seasonality
          - weekly seasonality
          - daily seasonality
  
      The inferring is done with `~greykite.algo.common.seasonality_inferrer.SeasonalityInferrer`.
  
      Parameters
      ----------
      df : `pandas.DataFrame`
          The input time series.
      time_col : `str`
          The column name for timestamps in ``df``.
      value_col : `str`
          The column name for values in ``df``.
      yearly_seasonality : `bool`, default True
          If False, the yearly seasonality order will be forced to be zero
          regardless of the inferring result.
      quarterly_seasonality : `bool`, default True
          If False, the quarterly seasonality order will be forced to be zero
          regardless of the inferring result.
      monthly_seasonality : `bool`, default True
          If False, the monthly seasonality order will be forced to be zero
          regardless of the inferring result.
      weekly_seasonality : `bool`, default True
          If False, the weekly seasonality order will be forced to be zero
          regardless of the inferring result.
      daily_seasonality : `bool`, default True
          If False, the daily seasonality order will be forced to be zero
          regardless of the inferring result.
  
      Returns
      -------
      result : `dict`
          A dictionary with the keys being:
  
              - "yearly_seasonality"
              - "quarterly_seasonality"
              - "monthly_seasonality"
              - "weekly_seasonality"
              - "daily_seasonality"
  
          and values being the corresponding inferred Fourier series orders.
      """
      result = dict()
      seasonalities = [
          "yearly_seasonality",
          "quarterly_seasonality",
          "monthly_seasonality",
          "weekly_seasonality",
          "daily_seasonality",
      ]
      seasonality_defaults = [
          yearly_seasonality,
          quarterly_seasonality,
          monthly_seasonality,
          weekly_seasonality,
          daily_seasonality,
      ]
      # Iterate through the five seasonality frequencies.
      # Frequencies that are less than or equal to the data frequency will have order 0.
      df = df.copy()
      df[time_col] = pd.to_datetime(df[time_col])
      min_increment = min(
          (df[time_col] - df[time_col].shift(1)).dropna()
      )
      # Yearly seasonality/quarterly seasonality is activated when data is at most weekly.
      # For monthly data, it will not return yearly seasonality but will try to use "C(month)".
      configs = []
      if min_increment <= timedelta(days=7):
          yearly_config = SeasonalityInferConfig(
              seas_name="yearly",
              col_name=TimeFeaturesEnum.toy.name,
              period=1.0,
              max_order=30,
              adjust_trend_param=dict(
                  trend_average_col=TimeFeaturesEnum.year.name
              ),
              aggregation_period="W",
          )
          quarterly_config = SeasonalityInferConfig(
              seas_name="quarterly",
              col_name=TimeFeaturesEnum.toq.name,
              period=1.0,
              max_order=10,
              adjust_trend_param=dict(
                  trend_average_col=TimeFeaturesEnum.year_quarter.name
              ),
              aggregation_period="W",
          )
          configs += [yearly_config, quarterly_config]
      # Monthly/weekly seasonality is activated when data is at most daily.
      if min_increment <= timedelta(days=1):
          monthly_config = SeasonalityInferConfig(
              seas_name="monthly",
              col_name=TimeFeaturesEnum.tom.name,
              period=1.0,
              max_order=10,
              adjust_trend_param=dict(
                  trend_average_col=TimeFeaturesEnum.year_month.name
              ),
              aggregation_period="D",
          )
          weekly_config = SeasonalityInferConfig(
              seas_name="weekly",
              col_name=TimeFeaturesEnum.tow.name,
              period=7.0,
              max_order=5,
              adjust_trend_param=dict(
                  trend_average_col=TimeFeaturesEnum.year_woy_iso.name
              ),
              aggregation_period=None,
          )
          configs += [monthly_config, weekly_config]
      # Daily seasonality is activated when data is at most hourly.
      if min_increment <= timedelta(hours=1):
          daily_config = SeasonalityInferConfig(
              seas_name="daily",
              col_name=TimeFeaturesEnum.tod.name,
              period=24.0,
              max_order=15,
              adjust_trend_param=dict(
                  trend_average_col=TimeFeaturesEnum.year_woy_dow_iso.name
              ),
              aggregation_period=None,
          )
          configs += [daily_config]
  
      # Infers seasonality orders.
      seasonality_inferrer = SeasonalityInferrer()
      seasonality_result = seasonality_inferrer.infer_fourier_series_order(
          df=df,
          time_col=time_col,
          value_col=value_col,
          configs=configs,
          adjust_trend_method=TrendAdjustMethodEnum.seasonal_average.name,
          fit_algorithm="ridge",
          tolerance=0.0,
          plotting=False,
          offset=0,
          criterion="bic",
      )
  
      # Transforms seasonality infer results to dictionary.
      for seasonality, default in zip(
          seasonalities, seasonality_defaults
      ):
          # Seasonalities are named like "yearly_seasonality" while the keys in the result are like "yearly".
          # If a seasonality is not found in the result, the default is 0.
          if default is not False:
              result[seasonality] = seasonality_result[
                  "best_orders"
              ].get(seasonality.split("_")[0], 0)
          else:
              result[seasonality] = 0
  
      return result
  
imports: import inspect
  from datetime import timedelta
  from typing import Dict
  from typing import List
  from typing import Optional
  import numpy
  import pandas
  from greykite.algo.changepoint.adalasso.auto_changepoint_params import generate_trend_changepoint_detection_params
  from greykite.algo.common.holiday_grouper import HolidayGrouper
  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.algo.forecast.silverkite.forecast_simple_silverkite_helper import split_events_into_dictionaries
  from greykite.common import constants
  from greykite.common.constants import GrowthColEnum
  from greykite.common.constants import TimeFeaturesEnum
  from greykite.common.features.timeseries_features import add_event_window_multi
  from greykite.common.features.timeseries_features import get_holidays
  from greykite.common.logging import LoggingLevelEnum
  from greykite.common.logging import log_message
  from greykite.common.python_utils import update_dictionary
  from greykite.common.time_properties import describe_timeseries
label_desc: Use image node_id 1 for calling a global function with example usage: get_auto_seasonality(df, time_col, value_col, yearly_seasonality, quarterly_seasonality, monthly_seasonality, weekly_seasonality, daily_seasonality) and returns: result