code: def insort_event_right(self, event, lo=0, hi=None):
      if lo < 0:
        raise ValueError('lo must be non-negative')
      if hi is None:
        hi = len(self.queue)
      while lo < hi:
        mid = (lo + hi) // 2
        if event[0] < self.queue[mid][0]:
          hi = mid
        else:
          lo = mid + 1
      self.queue.insert(lo, event)