code: def time_features_from_frequency_str(
      freq_str: str,
  ) -> List[TimeFeature]:
      """
      :param freq_str: Frequency string of the form [multiple][granularity] such as "12H", "5min", "1D" etc.
  
      :return: a list of time features that will be appropriate for the given frequency string.
      """
  
      features_by_offsets = {
          offsets.YearEnd: [],
          offsets.QuarterEnd: [MonthOfYear],
          offsets.MonthEnd: [MonthOfYear],
          offsets.Week: [DayOfMonth, WeekOfYear],
          offsets.Day: [DayOfWeek, DayOfMonth, DayOfYear],
          offsets.BusinessDay: [DayOfWeek, DayOfMonth, DayOfYear],
          offsets.Hour: [HourOfDay, DayOfWeek, DayOfMonth, DayOfYear],
          offsets.Minute: [
              MinuteOfHour,
              HourOfDay,
              DayOfWeek,
              DayOfMonth,
              DayOfYear,
          ],
          offsets.Second: [
              SecondOfMinute,
              MinuteOfHour,
              HourOfDay,
              DayOfWeek,
              DayOfMonth,
              DayOfYear,
          ],
      }
  
      offset = to_offset(freq_str)
  
      for offset_type, feature_classes in features_by_offsets.items():
          if isinstance(offset, offset_type):
              return [cls() for cls in feature_classes]
  
      supported_freq_msg = f"""
      Unsupported frequency {freq_str}
      The following frequencies are supported:
          Y   - yearly
              alias: A
          M   - monthly
          W   - weekly
          D   - daily
          B   - business days
          H   - hourly
          T   - minutely
              alias: min
          S   - secondly
      """
      raise RuntimeError(supported_freq_msg)
  
imports: from typing import List
  import numpy
  import pandas
  from pandas.tseries import offsets
  from pandas.tseries.frequencies import to_offset
label_desc: Use image node_id 1 for calling a global function with example usage: time_features_from_frequency_str(freq_str) and returns: unknown