code: def set_auto_seasonalities(df, config_seasonality: ConfigSeasonality):
      """Set seasonalities that were left on auto or set by user.
  
      Note
      ----
      Turns on yearly seasonality if there is >=2 years of history.
  
      Turns on weekly seasonality if there is >=2 weeks of history, and the
      spacing between dates in the history is <7 days.
  
      Turns on daily seasonality if there is >=2 days of history, and the
      spacing between dates in the history is <1 day.
  
      Parameters
      ----------
          df : pd.Dataframe
              Dataframe from which datestamps will be retrieved from
          config_seasonality : configure.ConfigSeasonality
              NeuralProphet seasonal model configuration, as after __init__
      Returns
      -------
          configure.ConfigSeasonality
              Processed NeuralProphet seasonal model configuration
  
      """
      dates = df["ds"].copy(deep=True)
  
      log.debug(f"seasonality config received: {config_seasonality}")
      first = dates.min()
      last = dates.max()
      dt = dates.diff()
      min_dt = dt.iloc[dt.values.nonzero()[0]].min()
      auto_disable = {
          "yearly": last - first < pd.Timedelta(days=730),
          "weekly": (
              (last - first < pd.Timedelta(weeks=2))
              or (min_dt >= pd.Timedelta(weeks=1))
          ),
          "daily": (
              (last - first < pd.Timedelta(days=2))
              or (min_dt >= pd.Timedelta(days=1))
          ),
      }
      for name, period in config_seasonality.periods.items():
          arg = period.arg
          default_resolution = period.resolution
          if arg == "custom":
              continue
          elif arg == "auto":
              resolution = 0
              if auto_disable[name]:
                  log.info(
                      f"Disabling {name} seasonality. Run NeuralProphet with "
                      f"{name}_seasonality=True to override this."
                  )
              else:
                  resolution = default_resolution
          elif arg is True:
              resolution = default_resolution
          elif arg is False:
              resolution = 0
          else:
              resolution = int(arg)
          config_seasonality.periods[name].resolution = resolution
  
      new_periods = OrderedDict({})
      for name, period in config_seasonality.periods.items():
          if period.resolution > 0:
              new_periods[name] = period
      config_seasonality.periods = new_periods
      config_seasonality = (
          config_seasonality
          if len(config_seasonality.periods) > 0
          else None
      )
      log.debug(f"seasonality config: {config_seasonality}")
      return config_seasonality
  
imports: from __future__ import annotations
  import logging
  import math
  import os
  import sys
  from collections import OrderedDict
  from typing import TYPE_CHECKING, Iterable, Optional, Union
  import numpy
  import pandas
  import pytorch_lightning
  import torch
  from neuralprophet import utils_torch
  from neuralprophet.hdays_utils import get_country_holidays
  from neuralprophet.logger import ProgressBar
label_desc: Use image node_id 17 for calling a global function with example usage: set_auto_seasonalities(df, config_seasonality) and returns: config_seasonality