Return a label to display for a field
601
def get_field_label(self, field_name, field=None):
        
        label = None
        if field is not None:
            label = getattr(field, 'verbose_name', None)
            if label is None:
                label = getattr(field, 'name', None)
        if label is None:
            label = field_name
        return label.capitalize()
369821
def get_field_info(self, field):
        """"""
        field_info = OrderedDict()
        for attr in ('required', 'read_only', 'default', 'label'):
            field_info[attr] = getattr(field, attr)
        if field_info['default'] is empty:
            field_info['default'] = None
        if hasattr(field, 'immutable'):
            field_info['immutable'] = field.immutable
        field_info['nullable'] = field.allow_null
        if hasattr(field, 'choices'):
            field_info['choices'] = [
                {
                    'value': choice_value,
                    'display_name': force_text(choice_name, strings_only=True)
                }
                for choice_value, choice_name in field.choices.items()
            ]
        many = False
        if isinstance(field, DynamicRelationField):
            field = field.serializer
        if isinstance(field, ListSerializer):
            field = field.child
            many = True
        if isinstance(field, ModelSerializer):
            type = 'many' if many else 'one'
            field_info['related_to'] = field.get_plural_name()
        else:
            type = self.label_lookup[field]

        field_info['type'] = type
        return field_info
871975
def get_labels(self, field):
        """"""
        return {c: self.cluster_meta.get(field, c)
                for c in self.clustering.cluster_ids}
426245
function getLabel(opts) {

  var className = mixin({
    'control-label': true
  }, opts.className);

  if (opts.align) {
    className['text-' + opts.align] = true;
  }

  return {
    tag: 'label',
    attrs: {
      htmlFor: opts.htmlFor,
      id: opts.id,
      className: className
    },
    children: opts.label
  };
}
1293862
def label(self, value):
        
        return self._labels.get(value) or text.pretty(self(value))
291458
def set_label(self):
		
		if not self.field.label or self.attrs.get("_no_label"):
			return

		self.values["label"] = format_html(
			LABEL_TEMPLATE, self.field.html_name, mark_safe(self.field.label)
		)
444643
public static function generateLabel($field)
    {
        $label = Str::title(str_replace('_', ' ', $field['fieldName']));
        $template = "{!! Form::label('\$FIELD_NAME\$', '\$FIELD_NAME_TITLE\$:', ['class' => 'form-control-label $FIELD_NAME_TITLE$']) !!}";
        $template = str_replace('$FIELD_NAME_TITLE$', $label, $template);
        $template = str_replace('$FIELD_NAME$', $field['fieldName'], $template);
        return $template;
    }
611619
def format_value(obj, field_name):
    
    display_func = getattr(obj, 'get_%s_display' % field_name, None)
    if display_func:
        return display_func()
    value = getattr(obj, field_name)

    if isinstance(value, models.fields.files.FieldFile):
        if value:
            return mark_safe('<a href="%s">%s</a>' % (
                value.url,
                os.path.basename(value.name),
            ))
        else:
            return ''

    if isinstance(value, models.Model):
        return format_value_instance(value)

    if isinstance(value, models.Manager):
        return mark_safe(', '.join(
            [format_value_instance(instance) for instance in value.all()]
        ))
    if value is None:
        value = ""
    return value
1180739
def as_crispy_field(field, template_pack=TEMPLATE_PACK, label_class="", field_class=""):
    
    if not isinstance(field, forms.BoundField) and settings.DEBUG:
        raise CrispyError('|as_crispy_field got passed an invalid or inexistent field')

    attributes = {
        'field': field,
        'form_show_errors': True,
        'form_show_labels': True,
        'label_class': label_class,
        'field_class': field_class,
    }
    helper = getattr(field.form, 'helper', None)

    template_path = None
    if helper is not None:
        attributes.update(helper.get_attributes(template_pack))
        template_path = helper.field_template
    if not template_path:
        template_path = '%s/field.html' % template_pack
    template = get_template(template_path)

    c = Context(attributes).flatten()
    return template.render(c)
638764
def lookup(self, label):
        ''' '''
        if self.is_child:
            try:
                return self._children[label]
            except KeyError:
                self._children[label] = ChildFieldPicklist(self.parent, 
                                                           label, 
                                                           self.field_name) 
                return self._children[label]
        else:
            return get_label_value(label, self._picklist)
907598
def _value(self):
        """"""
        if self.data is not None:
            value = self.data._data.get(self.field.to_field.name)
            return str(value)
        return ''
1328647
def label(self, value):
        
        # Fixed width label formatting
        value = value[:self.pad_size] if self.pad_size else value
        try:
            padding = ' ' * (self.pad_size - len(value)) if self.pad_size else ''
        except TypeError:
            padding = ''

        self._formatted = ' {v}{p} '.format(v=value, p=padding)
471164
def label(self, name):
        
        json = None
        if name:
            url = self._build_url('labels', name, base_url=self._api)
            json = self._json(self._get(url), 200)
        return Label(json, self) if json else None
45846
def _type_string(label, case=None):
    """"""
    return label, abstractSearch.in_string, lambda s: abstractRender.default(s, case=case), ""
229119
public WField addField(final String label, final WComponent field) {
		if (null == label) {
			return addField((WLabel) null, field);
		}
		return addField(new WLabel(label), field);
	}
528836
def y_label(self, y_label=None):
        """"""

        if y_label is None:
            return self._y_label
        else:
            if not isinstance(y_label, str):
                raise TypeError("y_label must be str, not '%s'" % str(y_label))
            self._y_label = y_label
820830
def find_field_by_label(browser, field, label):
    

    return XPathSelector(browser,
                         field_xpath(field, 'id', escape=False) %
                         u'//label[contains(., "{0}")]/@for'.format(label))