def ValidateServiceRangeAndExceptions(self, problems, today,
                                        service_gap_interval):
    if today is None:
      today = datetime.date.today()
    (start_date, end_date,
     start_date_origin, end_date_origin) = self.GetDateRangeWithOrigins()
    if not end_date or not start_date:
      problems.OtherProblem('This feed has no effective service dates!',
                            type=problems_module.TYPE_WARNING)
    else:
        try:
          last_service_day = datetime.datetime(
              *(time.strptime(end_date, "%Y%m%d")[0:6])).date()
          first_service_day = datetime.datetime(
              *(time.strptime(start_date, "%Y%m%d")[0:6])).date()

        except ValueError:
          # Format of start_date and end_date checked in class ServicePeriod
          pass

        else:
          self.ValidateServiceExceptions(problems,
                                         first_service_day,
                                         last_service_day)
          self.ValidateFeedStartAndExpirationDates(problems,
                                                   first_service_day,
                                                   last_service_day,
                                                   start_date_origin,
                                                   end_date_origin,
                                                   today)

          # We start checking for service gaps a bit in the past if the
          # feed was active then. See
          # https://github.com/google/transitfeed/issues/188
          #
          # We subtract 1 from service_gap_interval so that if today has
          # service no warning is issued.
          #
          # Service gaps are searched for only up to one year from today
          if service_gap_interval is not None:
            service_gap_timedelta = datetime.timedelta(
                                        days=service_gap_interval - 1)
            one_year = datetime.timedelta(days=365)
            self.ValidateServiceGaps(
                problems,
                max(first_service_day,
                    today - service_gap_timedelta),
                min(last_service_day,
                    today + one_year),
                service_gap_interval)
dataset/ETHPy150Open google/transitfeed/transitfeed/schedule.py/Schedule.ValidateServiceRangeAndExceptions/original