:param timeperiod: optional parameter, applicable for QUALIFIER_DAILY qualifier only
        :return: upper boundary for dictionary's time_qualifier

def _get_stem_upper_boundary(self, timeperiod=None):
        """
        :param timeperiod: optional parameter, applicable for QUALIFIER_DAILY qualifier only
        :return: upper boundary for dictionary's time_qualifier
        """

        if self.time_qualifier == QUALIFIER_HOURLY:
            upper_boundary = 23
        elif self.time_qualifier == QUALIFIER_DAILY:
            if timeperiod:
                # DAILY upper boundary is month-dependent
                # i.e. it is 28 for Feb 2015; and 31 for Mar 2015
                year, month, day, hour = time_helper.tokenize_timeperiod(timeperiod)
                monthrange_tuple = calendar.monthrange(int(year), int(month))
                upper_boundary = monthrange_tuple[1]
            else:
                upper_boundary = 28
        elif self.time_qualifier == QUALIFIER_MONTHLY:
            upper_boundary = 12
        elif self.time_qualifier == QUALIFIER_YEARLY:
            upper_boundary = 1
        else:
            raise ValueError('unknown time qualifier: {0}'.format(self.time_qualifier))
        return upper_boundary