code: def size_in_months(self):
          
          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]))
docs: Return the size of the period in months.
  
          >>> period('month', '2012-2-29', 4).size_in_months
          4
          >>> period('year', '2012', 1).size_in_months
          12