code: def first_day(self):
          
          day_iter = self
          while (day_iter.previous_day.is_yom_tov or
                 day_iter.previous_day.is_shabbat):
              day_iter = day_iter.previous_day
          return day_iter
docs: Return the first day of Yom Tov or Shabbat.
  
          This is useful for three-day holidays, for example: it will return the
          first in a string of Yom Tov + Shabbat.
          If this HDate is Shabbat followed by no Yom Tov, returns the Saturday.
          If this HDate is neither Yom Tov, nor Shabbat, this just returns
          itself.