<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_subperiods(self, unit):
 """ Return the list of all the periods of unit ``unit`` contained in self. Examples: """

        if unit_weight(self.unit) < unit_weight(unit):
            raise ValueError('Cannot subdivide {0} into {1}'.format(self.unit, unit))

        if unit == YEAR:
            return [self.this_year.offset(i, YEAR) for i in range(self.size)]

        if unit == MONTH:
            return [self.first_month.offset(i, MONTH) for i in range(self.size_in_months)]

        if unit == DAY:
            return [self.first_day.offset(i, DAY) for i in range(self.size_in_days)]