docstr: Parse freq into a unified format
  
  Parameters
  ----------
  freq : str
      Raw freq, supported freq should match the re '^([0-9]*)(month|mon|week|w|day|d|minute|min)$'
  
  Returns
  -------
  freq: Tuple[int, str]
      Unified freq, including freq count and unified freq unit. The freq unit should be '[month|week|day|minute]'.
          Example:
  
          .. code-block::
  
              print(Freq.parse("day"))
              (1, "day" )
              print(Freq.parse("2mon"))
              (2, "month")
              print(Freq.parse("10w"))
              (10, "week")
docstr_tok: ["Parse","freq","into","a","unified","format","Parameters","--","--","--","--","--","freq",":","str","Raw","freq",",","supported","freq","should","match","the","re","'^","(","[","0-9","]","*",")","(","month|mon|week|w|day|d|minute|min",")","$","'","Returns","--","--","--","-","freq",":","Tuple","[","int",",","str","]","Unified","freq",",","including","freq","count","and","unified","freq","unit",".","The","freq","unit","should","be","'","[","month|week|day|minute","]","'",".","Example",":","..","code-block",":",":","print","(","Freq.parse","(","``","day","''",")",")","(","1",",","``","day","''",")","print","(","Freq.parse","(","``","2mon","''",")",")","(","2",",","``","month","''",")","print","(","Freq.parse","(","``","10w","''",")",")","(","10",",","``","week","''",")"]
code: def parse(freq: str) -> Tuple[int, str]:
      """
      Parse freq into a unified format
  
      Parameters
      ----------
      freq : str
          Raw freq, supported freq should match the re '^([0-9]*)(month|mon|week|w|day|d|minute|min)$'
  
      Returns
      -------
      freq: Tuple[int, str]
          Unified freq, including freq count and unified freq unit. The freq unit should be '[month|week|day|minute]'.
              Example:
  
              .. code-block::
  
                  print(Freq.parse("day"))
                  (1, "day" )
                  print(Freq.parse("2mon"))
                  (2, "month")
                  print(Freq.parse("10w"))
                  (10, "week")
  
      """
      freq = freq.lower()
      match_obj = re.match(
          "^([0-9]*)(month|mon|week|w|day|d|minute|min)$", freq
      )
      if match_obj is None:
          raise ValueError(
              "freq format is not supported, the freq should be like (n)month/mon, (n)week/w, (n)day/d, (n)minute/min"
          )
      _count = int(match_obj.group(1)) if match_obj.group(1) else 1
      _freq = match_obj.group(2)
      _freq_format_dict = {
          "month": Freq.NORM_FREQ_MONTH,
          "mon": Freq.NORM_FREQ_MONTH,
          "week": Freq.NORM_FREQ_WEEK,
          "w": Freq.NORM_FREQ_WEEK,
          "day": Freq.NORM_FREQ_DAY,
          "d": Freq.NORM_FREQ_DAY,
          "minute": Freq.NORM_FREQ_MINUTE,
          "min": Freq.NORM_FREQ_MINUTE,
      }
      return _count, _freq_format_dict[_freq]
  
imports: import bisect
  from datetime import datetime, time, date, timedelta
  from typing import List, Optional, Tuple, Union
  import functools
  import re
  import pandas
  from qlib.config import C
  from qlib.constant import REG_CN, REG_TW, REG_US
label_desc: Use image node_id 5 for calling the Freq obj's underlying member method code with example usage: obj.parse(freq) and returns: _count,  _freq_format_dict