code: def display_annotations(self):
          
          for rect in self.idx_annot:
              self.scene.removeItem(rect)
          self.idx_annot = []
  
          if self.parent.notes.annot is None:
              return
  
          bookmarks = []
          events = []
          if self.parent.value('annot_show'):
              bookmarks = self.parent.notes.annot.get_bookmarks()
              events = self.parent.notes.get_selected_events()
  
          annotations = bookmarks + events
  
          for annot in annotations:
              rect = QGraphicsRectItem(annot['start'],
                                       BARS['annot']['pos0'],
                                       annot['end'] - annot['start'],
                                       BARS['annot']['pos1'])
              self.scene.addItem(rect)
  
              if annot in bookmarks:
                  color = self.parent.value('annot_bookmark_color')
              if annot in events:
                  color = convert_name_to_color(annot['name'])
  
              rect.setPen(QPen(QColor(color), LINE_WIDTH))
              rect.setBrush(QBrush(QColor(color)))
              rect.setZValue(-5)
              self.idx_annot.append(rect)
  
          for epoch in self.parent.notes.annot.epochs:
              self.mark_stages(epoch['start'],
                               epoch['end'] - epoch['start'],
                               epoch['stage'])
              self.mark_quality(epoch['start'],
                                epoch['end'] - epoch['start'],
                                epoch['quality'])
  
          cycles = self.parent.notes.annot.rater.find('cycles')
          cyc_starts = [float(mrkr.text) for mrkr in cycles.findall('cyc_start')]
          cyc_ends = [float(mrkr.text) for mrkr in cycles.findall('cyc_end')]
  
          for mrkr in cyc_starts:
              self.mark_cycles(mrkr, 30) # TODO: better width solution
          for mrkr in cyc_ends:
              self.mark_cycles(mrkr, 30, end=True)
docs: Mark all the bookmarks/events, from annotations.
  
          This function is similar to display_markers, but they are called at
          different stages (f.e. when loading annotations file), so we keep them
          separate