code: def moon_phase(self, date, rtype=int):
          
  
          if rtype != float and rtype != int:
              rtype = int
  
          moon = self._moon_phase_asfloat(date)
          if moon >= 28.0:
              moon -= 28.0
          moon = rtype(moon)
  
          return moon
docs: Calculates the phase of the moon on the specified date.
  
          :param date: The date to calculate the phase for.
          :type date: :class:`datetime.date`
          :param rtype: The type to return either int (default) or float.
  
          :return:
              A number designating the phase.
  
                  | 0  = New moon
                  | 7  = First quarter
                  | 14 = Full moon
                  | 21 = Last quarter