def __init__(self, start_date, end_date, retention_periods,
                 period_class=Period):
        if hasattr(start_date, 'date'):
            start_date = start_date.date() # Convert to a datetime.date
        if hasattr(end_date, 'date'):
            end_date = end_date.date()  # Convert to a datetime.date
        self.start_date = start_date
        self.end_date = end_date
        if self.start_date > self.end_date:
            raise ValueError("start date '%s' cannot be after end date '%s'" %
                             (self.start_date, self.end_date))
        self.retention_periods = sort_retention_periods(retention_periods)
        self._Period = Period
        self._periods = None
        self._users = None
dataset/ETHPy150Open MontmereLimited/django-lean/django_lean/lean_retention/reports.py/Cohort.__init__/original