code: def norm_freq_str(freq_str: str) -> str:
      base_freq = freq_str.split("-")[0]
  
      # Pandas has start and end frequencies, e.g `AS` and `A` for yearly start
      # and yearly end frequencies. We don't make that difference and instead
      # rely only on the end frequencies which don't have the `S` prefix.
      # Note: Secondly ("S") frequency exists, where we don't want to remove the
      # "S"!
      if len(base_freq) >= 2 and base_freq.endswith("S"):
          return base_freq[:-1]
  
      return base_freq
  
imports: from typing import Any, Callable, Dict, List
  import numpy
  import pandas
  from pandas.tseries import offsets
  from pandas.tseries.frequencies import to_offset
  from gluonts.pydantic import BaseModel
label_desc: Use image node_id 18 for calling a global function with example usage: norm_freq_str(freq_str) and returns: base_freq, base_freq