code: def _get_subday_cmpkey(self, dt):
      # Calculate intraday position
      point = dt.hour * 60 + dt.minute
  
      if self.timeframe < TimeFrame.Minutes:
          point = point * 60 + dt.second
  
      if self.timeframe < TimeFrame.Seconds:
          point = point * 1e6 + dt.microsecond
  
      # Apply compression to update point position (comp 5 -> 200 // 5)
      point = point // self.compression
  
      # Move to next boundary
      point += 1
  
      # Restore point to the timeframe units by de-applying compression
      point *= self.compression
  
      # Get hours, minutes, seconds and microseconds
      if self.timeframe == TimeFrame.Minutes:
          ph, pm = divmod(point, 60)
          ps = 0
          pus = 0
      elif self.timeframe == TimeFrame.Seconds:
          ph, pm = divmod(point, 60 * 60)
          pm, ps = divmod(pm, 60)
          pus = 0
      elif self.timeframe == TimeFrame.MicroSeconds:
          ph, pm = divmod(point, 60 * 60 * 1e6)
          pm, psec = divmod(pm, 60 * 1e6)
          ps, pus = divmod(psec, 1e6)
  
      extradays = 0
      if ph > 23:  # went over midnight:
          extradays = ph // 24
          ph %= 24
  
      # moving 1 minor unit to the left to be in the boundary
      # pm -= self.timeframe == TimeFrame.Minutes
      # ps -= self.timeframe == TimeFrame.Seconds
      # pus -= self.timeframe == TimeFrame.MicroSeconds
  
      tadjust = datetime.timedelta(
          minutes=self.timeframe == TimeFrame.Minutes,
          seconds=self.timeframe == TimeFrame.Seconds,
          microseconds=self.timeframe == TimeFrame.MicroSeconds,
      )
  
      # Add extra day if present
      if extradays:
          dt += datetime.timedelta(days=extradays)
  
      # Replace intraday parts with the calculated ones and update it
      dtcmp = dt.replace(hour=ph, minute=pm, second=ps, microsecond=pus)
      dtcmp -= tadjust
      dtkey = dtcmp
  
      return dtcmp, dtkey
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import calendar
  from collections import OrderedDict
  import datetime
  import pprint
  import backtrader
  from backtrader import TimeFrame
  from backtrader.utils.py3 import MAXINT, with_metaclass
label_desc: Use image node_id 8 for calling the TimeFrameAnalyzerBase obj's underlying member method code with example usage: obj._get_subday_cmpkey(dt) and returns: dtcmp,  dtkey