def _monthly(self):
        num = self.num
        start = self.event.l_start_date
        year = self.now.year
        month = self.now.month
        day = self.event.l_start_date.day
        if self.event.l_start_date > self.now:  # event starts in the future
            year = self.event.l_start_date.year
            month = self.event.l_start_date.month
        while num:
            try:
                start = start.replace(year=year, month=month)
                if self.now > start:  # if event already happened
                    month, year = inc_month(month, year)
                    continue
                # change to date() so we can compare to event.end_repeat
                start_ = date(year, month, day)
            # value error most likely means that the event's start date doesn't
            # appear this calendar month
            except ValueError:
                month, year = inc_month(month, year)
                continue
            if self.we_should_stop(start, start_):
                return
            self.events.append((start, self.event))
            month, year = inc_month(month, year)
            num -= 1
dataset/ETHPy150Open wreckage/django-happenings/happenings/utils/upcoming.py/UpcomingEvents._monthly/original