def get_occurrences(self, start, end):
        persisted_occurrences = self.occurrence_set.all()
        occ_replacer = OccurrenceReplacer(persisted_occurrences)
        occurrences = self._get_occurrence_list(start, end)
        final_occurrences = []
        for occ in occurrences:
            # replace occurrences with their persisted counterparts
            if occ_replacer.has_occurrence(occ):
                p_occ = occ_replacer.get_occurrence(occ)
                # ...but only if they are within this period
                if p_occ.start < end and p_occ.end >= start:
                    final_occurrences.append(p_occ)
            else:
                final_occurrences.append(occ)
        # then add persisted occurrences which originated outside of this period but now
        # fall within it
        final_occurrences += occ_replacer.get_additional_occurrences(start, end)
        return final_occurrences
Returns the value of a keypath in a dictionary
dataset/ETHPy150Open llazzaro/django-scheduler/schedule/models/events.py/Event.get_occurrences--crossover with--dataset/ETHPy150Open ambitioninc/django-query-builder/querybuilder/helpers.py/value_for_keypath