<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_event(self, num):
 """Extract event from dataset."""

        if num < 0 or num >= self.params["events_num"]:
            raise IndexError("Index out of range [0:%s]" %
                             (self.params["events_num"]))

        ch_num = self.params['channel_number']
        ev_size = self.params['b_size']

        event = {}

        self.file.seek(7168 + num * (96 + 2 * ch_num * ev_size))

        event["text_hdr"] = self.file.read(64)
        event["ev_num"] = struct.unpack('I', self.file.read(4))[0]
        self.file.read(4)

        start_time = struct.unpack('Q', self.file.read(8))[0]
        event["start_time"] = datetime.fromtimestamp(start_time)
        ns_since_epoch = struct.unpack('Q', self.file.read(8))[0]
        if ns_since_epoch:
            event['ns_since_epoch'] = ns_since_epoch
        self.file.read(8)

        event_data = self.file.read(2 * ev_size * ch_num)

        event["data"] = np.fromstring(event_data, np.short)

        return event