Display the badge label for a given kind
762588
def badge_label(self, badge):
        ''''''
        kind = badge.kind if isinstance(badge, Badge) else badge
        return self.__badges__[kind]
271649
def build_label(self, ident, cls):
        
        ident_w_label = ident + ':' + cls.__label__
        self._ast['match'].append('({0})'.format(ident_w_label))
        self._ast['return'] = ident
        self._ast['result_class'] = cls
        return ident
709771
public static function badge($label, $htmlOptions = array())
    {
        self::addCssClass('badge', $htmlOptions);
        $color = TbArray::popValue('color', $htmlOptions);
        if (!empty($color)) {
            self::addCssClass('badge-' . $color, $htmlOptions);
        }
        return self::tag('span', $htmlOptions, $label);
    }
740266
def labels(self, value):
        
        if value is not None:
            assert type(value) is tuple, "'{0}' attribute: '{1}' type is not 'tuple'!".format("labels", value)
            assert len(value) == 2, "'{0}' attribute: '{1}' length should be '2'!".format("labels", value)
            for index in range(len(value)):
                assert type(value[index]) is unicode, \
                    "'{0}' attribute element '{1}': '{2}' type is not 'unicode'!".format("labels", index, value)
        self.__labels = value
953369
def labels(self):
        """"""
        if not self.is_tagged(LABEL):
            self.tag_labels()
        return [word[LABEL] for word in self.words]
919370
def node_labels(node_labels, node_indices):
    """"""
    if len(node_labels) != len(node_indices):
        raise ValueError("Labels {0} must label every node {1}.".format(
            node_labels, node_indices))

    if len(node_labels) != len(set(node_labels)):
        raise ValueError("Labels {0} must be unique.".format(node_labels))
23957
def label(self):
        ""
        if self._label:
            return self._label
        else:
            if len(self):
                label = get_ndmapping_label(self, 'label')
                return '' if label is None else label
            else:
                return ''
1142049
def general_node_label(self, node):
        """"""
        G = self.G
        if G.node[node]['is_event']:
            return 'event type=' + G.node[node]['type']
        else:
            return 'entity text=' + G.node[node]['text']
103557
def format_label(self, field, counter):
        
        return '<label for="id_formfield_%s" %s>%s</label>' % (
            counter, field.field.required and 'class="required"', field.label)
447064
def label_from_instance(self, obj):
        
        level = getattr(obj, obj._mptt_meta.level_attr)
        level_indicator = mark_safe(conditional_escape(self.level_indicator) * level)
        return mark_safe(u'%s %s' % (level_indicator, conditional_escape(smart_unicode(obj))))
255348
def show_type(self, call_id, payload):
        """"""
        if self.full_types_enabled:
            tpe = payload['fullName']
        else:
            tpe = payload['name']

        self.log.info('Displayed type %s', tpe)
        self.editor.raw_message(tpe)
424939
def badge_form(model):
    ''''''
    class BadgeForm(ModelForm):
        model_class = Badge

        kind = fields.RadioField(
            _('Kind'), [validators.DataRequired()],
            choices=model.__badges__.items(),
            description=_('Kind of badge (certified, etc)'))

    return BadgeForm
314989
def get_label(self, code):
        

        for style in self.styles:
            if style[1] == code:
                return style[0]

        msg = _("Code {code} is invalid.").format(code=code)
        raise ValueError(msg)
88441
def labels(indices, node_labels=None):
    """"""
    if node_labels is None:
        return tuple(map(str, indices))
    return node_labels.indices2labels(indices)
1212164
def labels(self, labels):
        
        allowed_values = ["raw data", "documentation", "visualization", "clean data", "script", "report"]
        if not set(labels).issubset(set(allowed_values)):
            raise ValueError(
                "Invalid values for `labels` [{0}], must be a subset of [{1}]"
                .format(", ".join(map(str, set(labels)-set(allowed_values))),
                        ", ".join(map(str, allowed_values)))
            )

        self._labels = labels
45600
def check_labels(self):
        
        for entry in self.labels:
            self.check_is_declared(entry.name, entry.lineno, CLASS.label)
123444
def get_color_label(self):
        
        if self.args.norm:
            return 'Normalized to {}'.format(self.args.norm)
        if len(self.units) == 1 and self.usetex:
            return r'ASD $\left({0}\right)$'.format(
                self.units[0].to_string('latex').strip('$'))
        elif len(self.units) == 1:
            return 'ASD ({0})'.format(self.units[0].to_string('generic'))
        return super(Spectrogram, self).get_color_label()