code: def occurrences_after(self, after=None):
          
          from schedule.models import Occurrence
  
          if after is None:
              after = timezone.now()
          occ_replacer = OccurrenceReplacer(
              Occurrence.objects.filter(event__in=self.events))
          generators = [event._occurrences_after_generator(after) for event in self.events]
          occurrences = []
  
          for generator in generators:
              try:
                  heapq.heappush(occurrences, (next(generator), generator))
              except StopIteration:
                  pass
  
          while occurrences:
              generator = occurrences[0][1]
  
              try:
                  next_occurrence = heapq.heapreplace(occurrences, (next(generator), generator))[0]
              except StopIteration:
                  next_occurrence = heapq.heappop(occurrences)[0]
              yield occ_replacer.get_occurrence(next_occurrence)
docs: It is often useful to know what the next occurrence is given a list of
          events.  This function produces a generator that yields the
          the most recent occurrence after the date ``after`` from any of the
          events in ``self.events``