def overlap(exc, interval):
    """
  Check whether the time interval definded in exc
  (exc.startTime to exc.endTime) has non-zero overlap
  with time interval given as the second argument.
  """
    start, end = interval
    return (start <= exc.startTime < end or start < exc.endTime <= end or 
        exc.startTime <= start and exc.endTime >= end)
