code: def mark_cycles(self, start_time, length, end=False):
          
          y_pos = STAGES['cycle']['pos0']
          height = STAGES['cycle']['pos1']
          color = STAGES['cycle']['color']
  
          # the -1 is really important, otherwise we stay on the edge of the rect
          old_rect = self.scene.itemAt(start_time + length / 2,
                                       y_pos + height - 1,
                                       self.transform())
  
          # check we are not removing the black border
          if old_rect is not None and old_rect.pen() == NoPen:
              lg.debug('Removing old score at {}'.format(start_time))
              self.scene.removeItem(old_rect)
              self.idx_annot.remove(old_rect)
  
          rect = QGraphicsRectItem(start_time, y_pos, 30, height)
          rect.setPen(NoPen)
          rect.setBrush(color)
          self.scene.addItem(rect)
          self.idx_annot.append(rect)
  
          if end:
              start_time -= 120
  
          kink_hi = QGraphicsRectItem(start_time, y_pos, 150, 1)
          kink_hi.setPen(NoPen)
          kink_hi.setBrush(color)
          self.scene.addItem(kink_hi)
          self.idx_annot.append(kink_hi)
  
          kink_lo = QGraphicsRectItem(start_time, y_pos + height, 150, 1)
          kink_lo.setPen(NoPen)
          kink_lo.setBrush(color)
          self.scene.addItem(kink_lo)
          self.idx_annot.append(kink_lo)
docs: Mark cycle bound, only add the new one.
  
          Parameters
          ----------
          start_time: int
              start time in s of the bounding epoch
          length : int
             duration in s of the epoch being scored.
          end: bool
              If True, marker will be a cycle end marker; otherwise, it's start.