code: def get_seasonality(freq: Union[str, None]) -> int:
      """Return the seasonality of a given frequency. Adapted from ``gluonts.time_feature.seasonality``."""
      if freq is None:
          return 1
  
      offset = pd.tseries.frequencies.to_offset(freq)
      offset_name = norm_freq_str(offset)
      base_seasonality = DEFAULT_SEASONALITIES.get(offset_name, 1)
  
      seasonality, remainder = divmod(base_seasonality, offset.n)
      return seasonality if not remainder else 1
  
imports: from typing import Union
  import pandas
  from .base import norm_freq_str
label_desc: Use image node_id 1 for calling a global function with example usage: get_seasonality(freq) and returns: unknown, int