<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def moon_phase(self, date=None, rtype=int):
 """Calculates the moon phase for a specific date. :param date: The date to calculate the phase for. If ommitted the current date is used. :type date: :class:`datetime.date` :returns: A number designating the phase | 0 = New moon | 7 = First quarter | 14 = Full moon | 21 = Last quarter """


        if self.astral is None:
            self.astral = Astral()

        if date is None:
            date = datetime.date.today()

        return self.astral.moon_phase(date, rtype)