def update_start_end(self, start, end):
        """update start and end time of this event

        calling this an a recurring event will lead to the proto instance
        be set to the new start and end times

        beware, this methods performs some open heart surgerly
        """
        if type(start) != type(end):  # flake8: noqa
            raise ValueError('DTSTART and DTEND should be of the same type (datetime or date)')
        self.__class__ = self._get_type_from_date(start)

        self._vevents[self.ref].pop('DTSTART')
        self._vevents[self.ref].add('DTSTART', start)
        self._start = start
        if not isinstance(end, datetime):
            end = end + timedelta(days=1)
        self._end = end
        if 'DTEND' in self._vevents[self.ref]:
            self._vevents[self.ref].pop('DTEND')
            self._vevents[self.ref].add('DTEND', end)
        else:
            self._vevents[self.ref].pop('DURATION')
            self._vevents[self.ref].add('DURATION', end - start)
dataset/ETHPy150Open pimutils/khal/khal/khalendar/event.py/Event.update_start_end/original