code: def get_day_min_idx_range(
      start: str, end: str, freq: str, region: str
  ) -> Tuple[int, int]:
      """
      get the min-bar index in a day for a time range (both left and right is closed) given a fixed frequency
      Parameters
      ----------
      start : str
          e.g. "9:30"
      end : str
          e.g. "14:30"
      freq : str
          "1min"
  
      Returns
      -------
      Tuple[int, int]:
          The index of start and end in the calendar. Both left and right are **closed**
      """
      start = pd.Timestamp(start).time()
      end = pd.Timestamp(end).time()
      freq = Freq(freq)
      in_day_cal = get_min_cal(region=region)[:: freq.count]
      left_idx = bisect.bisect_left(in_day_cal, start)
      right_idx = bisect.bisect_right(in_day_cal, end) - 1
      return left_idx, right_idx
  
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 4 for calling a global function with example usage: get_day_min_idx_range(start, end, freq, region) and returns: left_idx,  right_idx