def _repeat_chunk(self):
        start_day = self.event.l_start_date.day
        last_day_last_mo = date(self.year, self.month, 1) - timedelta(days=1)

        self.day = start_day
        self.num = 1
        if self.event.end_repeat is not None:
            self.end_repeat = self.event.end_repeat

        if not self.event.starts_same_year_month_as(self.year, self.month):
            if not self.event.starts_ends_same_month():
                    self.repeat()  # fill out the end of the month
                    # fill out the beginning of the month, if nec.
                    if start_day <= last_day_last_mo.day:
                        self.repeat_reverse(
                            self.event.l_end_date.day, 1
                        )
            else:
                self.repeat_reverse(
                    self.event.l_end_date.day, start_day + 1
                )
dataset/ETHPy150Open wreckage/django-happenings/happenings/utils/handlers.py/MonthlyRepeater._repeat_chunk/original