<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def IsActiveOn(self, date, date_object=None):
 """Test if this service period is active on a date. Args: date: a string of form "YYYYMMDD" date_object: a date object representing the same date as date. This parameter is optional, and present only for performance reasons. If the caller constructs the date string from a date object that date object can be passed directly, thus avoiding the costly conversion from string to date object. Returns: True iff this service is active on date. """

    if date in self.date_exceptions:
      exception_type, _ = self.date_exceptions[date]
      if exception_type == self._EXCEPTION_TYPE_ADD:
        return True
      else:
        return False
    if (self.start_date and self.end_date and self.start_date <= date and
        date <= self.end_date):
      if date_object is None:
        date_object = util.DateStringToDateObject(date)
      return self.day_of_week[date_object.weekday()]
    return False