code: def previous(self, day_of_week=None):
          
          if day_of_week is None:
              day_of_week = self.day_of_week
  
          if day_of_week < SUNDAY or day_of_week > SATURDAY:
              raise ValueError("Invalid day of week")
  
          dt = self.subtract(days=1)
          while dt.day_of_week != day_of_week:
              dt = dt.subtract(days=1)
  
          return dt
docs: Modify to the previous occurrence of a given day of the week.
          If no day_of_week is provided, modify to the previous occurrence
          of the current day of the week.  Use the supplied consts
          to indicate the desired day_of_week, ex. pendulum.MONDAY.
  
          :param day_of_week: The previous day of week to reset to.
          :type day_of_week: int or None
  
          :rtype: Date