def METHOD_NAME(self, stats_start, stats_end, interval):
    if stats_end is None:
        self.stats_end = datetime.datetime.now()
    else:
        self.stats_end = convert_datetime(stats_end)
    if stats_start is None:
        self.stats_start = self.stats_end - datetime.timedelta(minutes=interval)
    else:
        self.stats_start = convert_datetime(stats_start)
        delta = self.stats_end - self.stats_start
        interval = delta.days * 1440 + delta.seconds // 60
    # discard seconds
    self.stats_start -= datetime.timedelta(seconds=self.stats_start.second)
    self.stats_end += datetime.timedelta(seconds=60 - self.stats_end.second)