code: def _addappt(self, iden, appt):
          '''
          Updates the data structures to add an appointment
          '''
          if appt.nexttime:
              heapq.heappush(self.apptheap, appt)
          self.appts[iden] = appt
          if self.apptheap and self.apptheap[0] is appt:
              self._wake_event.set(f _addappt(self, iden, appt):
          '''
          Updates the data structures to add an appointment
          '''
          if appt.nexttime:
              heapq.heappush(self.apptheap, appt)
          self.appts[iden] = appt
          if self.apptheap and self.apptheap[0] is appt:
              self._wake_event.set()
docs: Updates the data structures to add an appointment