code: def add_event(self, name, time, chan=''):
          
          if name not in self.event_types:
              self.add_event_type(name)
  
          events = self.rater.find('events')
          pattern = "event_type[@type='" + name + "']"
          event_type = events.find(pattern)
  
          new_event = SubElement(event_type, 'event')
          event_start = SubElement(new_event, 'event_start')
          event_start.text = str(time[0])
          event_end = SubElement(new_event, 'event_end')
          event_end.text = str(time[1])
  
          if isinstance(chan, (tuple, list)):
              chan = ', '.join(chan)
          event_chan = SubElement(new_event, 'event_chan')
          event_chan.text = chan
  
          event_qual = SubElement(new_event, 'event_qual')
          event_qual.text = 'Good' 
  
          self.save()
docs: Add event to annotations file.
          Parameters
          ----------
          name : str
              Event type name.
          time : tuple/list of float
              Start and end times of event, in seconds from recording start.
          chan : str or list of str, optional
              Channel or channels associated with event.
          Raises
          ------
          IndexError
              When there is no rater / epochs at all