docs: def cumulative_time_to(self,
                             when: datetime.datetime) -> datetime.timedelta:
          """
          Returns the cumulative time contained in our intervals up to the
          specified time point.
          """
          assert self.no_overlap, self._ONLY_FOR_NO_INTERVAL
          cumulative = datetime.timedelta()
          for interval in self.intervals:
              if interval.start >= when:
                  break
              elif interval.end <= when:
                  # complete interval precedes "when"
                  cumulative += interval.duration()
              else:  # start < when < end
                  cumulative += when - interval.start
          return cumulative