code: def GetDateRange(self):
      
      start = self.start_date
      end = self.end_date
  
      for date, (exception_type, _) in self.date_exceptions.items():
        if exception_type == self._EXCEPTION_TYPE_REMOVE:
          continue
        if not start or (date < start):
          start = date
        if not end or (date > end):
          end = date
      if start is None:
        start = end
      elif end is None:
        end = start
      # If start and end are None we did a little harmless shuffling
      return (start, end)
docs: Return the range over which this ServicePeriod is valid.
  
      The range includes exception dates that add service outside of
      (start_date, end_date), but doesn't shrink the range if exception
      dates take away service at the edges of the range.
  
      Returns:
        A tuple of "YYYYMMDD" strings, (start date, end date) or (None, None) if
        no dates have been given.