code: def _nth_of_quarter(self, nth, day_of_week):
          
          if nth == 1:
              return self.first_of("quarter", day_of_week)
  
          dt = self.replace(self.year, self.quarter * 3, 1)
          last_month = dt.month
          year = dt.year
          dt = dt.first_of("quarter")
          for i in range(nth - (1 if dt.day_of_week == day_of_week else 0)):
              dt = dt.next(day_of_week)
  
          if last_month < dt.month or year != dt.year:
              return False
  
          return self.set(self.year, dt.month, dt.day)
docs: Modify to the given occurrence of a given day of the week
          in the current quarter. If the calculated occurrence is outside,
          the scope of the current quarter, then return False and no
          modifications are made. Use the supplied consts
          to indicate the desired day_of_week, ex. pendulum.MONDAY.
  
          :type nth: int
  
          :type day_of_week: int or None
  
          :rtype: Date