code: def add_events(self, event_list, name=None, chan=None, parent=None):
          
          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)
          
          if parent is not None:
              progress = QProgressDialog('Saving events', 'Abort',
                                 0, len(events) - 1, parent)
              progress.setWindowModality(Qt.ApplicationModal)
  
          for i, evt in enumerate(event_list):
              new_event = SubElement(event_type, 'event')
              event_start = SubElement(new_event, 'event_start')
              event_start.text = str(evt['start'])
              event_end = SubElement(new_event, 'event_end')
              event_end.text = str(evt['end'])
      
              one_chan = chan
              if chan is None:
                  one_chan = evt['chan']
              if isinstance(one_chan, (tuple, list)):
                  one_chan = ', '.join(chan)
              event_chan = SubElement(new_event, 'event_chan')
              event_chan.text = one_chan
      
              event_qual = SubElement(new_event, 'event_qual')
              event_qual.text = 'Good' 
              
              if parent is not None:
                  progress.setValue(i)                    
                  if progress.wasCanceled():
                      return
  
          self.save()
          
          if parent is not None:
              progress.close()
docs: Add series of events. Faster than calling add_event in a loop.
          Parameters
          ----------
          event_list : list of dict
              each dict is an event with 'start' and 'end' times
          name : str, optional
              save events to this event type. If None, channel will be
              read from the event list dict under 'name' 
          chan : str or list of str, optional
              save events to this or these channel(s). If None, channel will be
              read from the event list dict under 'chan'