code: def _get_intervals_count_and_unit(freq: str) -> Tuple[int, str]:
      """Extract interval count and unit from frequency string.
  
      Supports eg: W, 3W, W-SUN, BQS, (B)Q(S)-MAR patterns, from which we
      extract the count and the unit. See
      https://pandas.pydata.org/docs/user_guide/timeseries.html#timeseries-offset-aliases
      """
      if freq is None:
          raise ValueError("frequency is missing")
      else:
          offset = pd.tseries.frequencies.to_offset(freq)
          count, unit = offset.n, offset.base.freqstr
          return count, unit
  
file_path: sktime/sktime/utils/datetime.py
imports: import warnings
  from functools import singledispatch
  from typing import Optional, Tuple, Union
  import numpy
  import pandas
  from sktime.datatypes import VectorizedDF
  from sktime.datatypes._utilities import get_time_index
  from sktime.utils.validation.series import check_time_index, is_integer_index
label_desc: Use image node_id 2 for calling a global function with example usage: _get_intervals_count_and_unit(freq) and returns: count,  unit