def parse_size(self, size):
    size = text_value(size).lower().strip()
    if (size in ('sm', 'small')):
        return 'small'
    if (size in ('lg', 'large')):
        return 'large'
    if (size in ('md', 'medium', '')):
        return 'medium'
    raise BootstrapError(('Invalid value "%s" for parameter "size" (expected "sm", "md", "lg" or "").' % size))
def parse_size(self, size):
    size = text_value(size).lower().strip()
    if (size in ('sm', 'small')):
        return 'small'
    if (size in ('lg', 'large')):
        return 'large'
    if (size in ('md', 'medium', )):
        return 'medium'
    raise BootstrapError(('Invalid value "%s" for parameter "size" (expected "sm", "md", "lg" or ).' % size))