code: def _days_in_month(date):
      
      if date.month == 12:
          reference = type(date)(date.year + 1, 1, 1)
      else:
          reference = type(date)(date.year, date.month + 1, 1)
      return (reference - timedelta(days=1)).day
docs: The number of days in the month of the given date