code: def daysInMonth(date):
      
      # map from Qt information
      if type(date).__name__ in ('QDate', 'QDateTime', 'QTime'):
          date = date.toPython()
  
      month = date.month
  
      # look for a leap year
      if month == 2 and not date.year % 4:
          return 29
  
      return DaysInMonth.get(month, -1)
docs: Returns the number of the days in the month for the given date.  This will
      take into account leap years based on the inputted date's year.
      
      :param      date | <datetime.date>
      
      :return     <int>