import re


def get_seasonality(freq: str) -> int:
    """
    Returns the default seasonality for a given freq str. E.g. for

      2H -> 12

    """
    match = re.match(r"(\d*)(\w+)", freq)
    assert match, "Cannot match freq regex"
    mult, base_freq = match.groups()
    multiple = int(mult) if mult else 1

    seasonalities = {"H": 24, "D": 1, "W": 1, "M": 12, "B": 5}
    if base_freq in seasonalities:
        seasonality = seasonalities[base_freq]
    else:
        seasonality = 1
    if seasonality % multiple != 0:
        # logging.warning(
        #     f"multiple {multiple} does not divide base "
        #     f"seasonality {seasonality}."
        #     f"Falling back to seasonality 1"
        # )
        return 1
    return seasonality // multiple