code: def daysInYear(date):
      
      # map from Qt information
      if type(date).__name__ in ('QDate', 'QDateTime', 'QTime'):
          date = date.toPython()
  
      if type(date) != int:
          year = date.year
      else:
          year = date
  
      if not year % 4:
          return 366
      return 365
docs: Returns the number of days in the year for the given date.
      
      :param      date | <datetime.date> || <int>
      
      :return     <int>