<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def size_in_months(self):
 """Return the size of the period in months. 4 12 """

        if (self[0] == MONTH):
            return self[2]
        if(self[0] == YEAR):
            return self[2] * 12
        raise ValueError("Cannot calculate number of months in {0}".format(self[0]))