<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_offset_and_sequence_number(self, event_data):
 """ Updates offset based on event. :param event_data: A received EventData with valid offset and sequenceNumber. :type event_data: ~azure.eventhub.common.EventData """

        if not event_data:
            raise Exception(event_data)
        self.offset = event_data.offset.value
        self.sequence_number = event_data.sequence_number