code: def _get_dt_cmpkey(self, dt):
      if self.timeframe == TimeFrame.NoTimeFrame:
          return None, None
  
      if self.timeframe == TimeFrame.Years:
          dtcmp = dt.year
          dtkey = datetime.date(dt.year, 12, 31)
  
      elif self.timeframe == TimeFrame.Months:
          dtcmp = dt.year * 100 + dt.month
          _, lastday = calendar.monthrange(dt.year, dt.month)
          dtkey = datetime.datetime(dt.year, dt.month, lastday)
  
      elif self.timeframe == TimeFrame.Weeks:
          isoyear, isoweek, isoweekday = dt.isocalendar()
          dtcmp = isoyear * 100 + isoweek
          sunday = dt + datetime.timedelta(days=7 - isoweekday)
          dtkey = datetime.datetime(
              sunday.year, sunday.month, sunday.day
          )
  
      elif self.timeframe == TimeFrame.Days:
          dtcmp = dt.year * 10000 + dt.month * 100 + dt.day
          dtkey = datetime.datetime(dt.year, dt.month, dt.day)
  
      else:
          dtcmp, dtkey = self._get_subday_cmpkey(dt)
  
      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 7 for calling the TimeFrameAnalyzerBase obj's underlying member method code with example usage: obj._get_dt_cmpkey(dt) and returns: dtcmp,  dtkey, None,  None