code: def change_event_type(self, new_name=None, name=None, time=None, 
                            chan=None):
          
          if new_name is None:
              event_types = self.annot.event_types
              
              if name is None:
                  event = self.annot.get_events(time=time, chan=chan)[0]
                  name = event['name']
                  
              idx_name = event_types.index(name)
              if idx_name == len(event_types) - 1:
                  new_name = event_types[0]
              else:
                  new_name = event_types[idx_name + 1]
                      
          self.annot.add_event(new_name, time, chan=chan)
          self.annot.remove_event(name=name, time=time, chan=chan)
          self.update_annotations()
          
          return new_name
docs: Action: change an event's type.