Display dropdown labels.
963875
public function getLabelForValue($value) {
    $settings = $this->getFieldSettings();
    $allowed_values = $settings['allowed_values'];

    foreach ($allowed_values as $allowed_value) {
      if (isset($allowed_value['value']) && $allowed_value['value'] === $value) {
        $label = $allowed_value['label'];
        return Html::escape($label);
      }
    }
  }
862451
def label(self):
        """"""
        if not self.desc:
            return "%.3fs" % self.timestamp
        return "%s (%.3fs)" % (self.desc, self.timestamp)
1140312
function(opts) {
			var i, n, options, label, self = this;
			opts = opts || {};
	
			if (self.tagType === TAG_SELECT) {
				options = [];
				for (i = 0, n = self.items.length; i < n; i++) {
					label = self.options[self.items[i]][self.settings.labelField] || '';
					options.push('<option value="' + escape_html(self.items[i]) + '" selected="selected">' + escape_html(label) + '</option>');
				}
				if (!options.length && !this.$input.attr('multiple')) {
					options.push('<option value="" selected="selected"></option>');
				}
				self.$input.html(options.join(''));
			} else {
				self.$input.val(self.getValue());
				self.$input.attr('value',self.$input.val());
			}
	
			if (self.isSetup) {
				if (!opts.silent) {
					self.trigger('change', self.$input.val());
				}
			}
		}
235646
def _display_value_vertical(self, value):
        """"""
        if self._showvalue:
            self.label.configure(text=self._formatter.format(float(value)))
            if self._labelpos in ['e', 'w']:
                y = self.convert_to_pixels(float(value))
                self.label.place_configure(y=y)
860856
def _display(node, indent, expandattrs, expandvals, output):
    """"""
    attrs = _displayattrs(node.attrib, expandattrs)
    if node.text is None or not expandvals:
        val = ''
    elif isinstance(node.text, str):
        val = ' %s' % repr(node.text.strip())
    else:
        val = ' %s' % repr(node.text)  # node.text can be a tuple
    output.write(encode(indent + striptag(node.tag) + attrs + val + '\n'))
    for sub_node in node:
        _display(sub_node, indent + '  ', expandattrs, expandvals, output)
1203623
function labels (configName, callback) {

    if (callback) {
        return get(configName).schema.statics.getLabels(callback);
    }

    return get(configName).schema.statics.getLabels();
}
421037
private function setLabels()
    {
        $this->labels = [
            'name'               => ucwords($this->plural),
            'singular_name'      => ucwords($this->singular),
            'menu_name'          => ucwords($this->plural),
            'name_admin_bar'     => ucwords($this->singular),
            'add_new'            => 'Add New',
            'add_new_item'       => 'Add New ' . ucwords($this->singular),
            'new_item'           => 'New ' . $this->singular,
            'edit_item'          => 'Edit ' . $this->singular . ' details',
            'view_item'          => 'View ' . $this->singular,
            'all_items'          => 'All ' . $this->plural,
            'search_items'       => 'Search ' . $this->plural,
            'parent_item_colon'  => 'Parent ' . $this->plural . ':',
            'not_found'          => 'No ' . $this->plural . ' found.',
            'not_found_in_trash' => 'No ' . $this->plural . ' found in Trash.'
        ];
    }
1318813
public function displayVal()
    {
        $selectedChoices = [];

        foreach ($this->choices() as $choice) {
            if ($this->isChoiceSelected($choice)) {
                $selectedChoices[] = $choice['label'];
                // break;
            }
        }

        return implode(', ', $selectedChoices);
    }
637323
def labels(self, values):
        """"""
        if isinstance(values, dict):
            if self.__data is not None and len(self.__data) != len(values):
                raise ValueError(
                    'number of samples do not match the previously assigned data')
            elif set(self.keys) != set(list(values)):
                raise ValueError('sample ids do not match the previously assigned ids.')
            else:
                self.__labels = values
        else:
            raise ValueError('labels input must be a dictionary!')
1028678
public function display()
    {
        if (!$this->visible) {
            return;
        }

        parent::display();

        $wrapper_classes = array_merge(
            array_diff($this->getCSSClassNames(), array('swat-flydown')),
            array('swat-flydown-wrapper')
        );
        $wrapper = new SwatHtmlTag('span');
        $wrapper->class = implode(' ', $wrapper_classes);
        $wrapper->open();

        $options = $this->getOptions();
        $selected = false;

        if ($this->show_blank) {
            $options = array_merge(array($this->getBlankOption()), $options);
        }

        // only show a select if there is more than one option
        if (count($options) > 1) {
            $flydown_value = $this->serialize_values
                ? $this->value
                : (string) $this->value;

            if ($this->serialize_values) {
                $salt = $this->getForm()->getSalt();
            }

            $select_tag = new SwatHtmlTag('select');
            $select_tag->name = $this->id;
            $select_tag->id = $this->id;
            $select_tag->class = $this->getCSSClassString();

            if (!$this->isSensitive()) {
                $select_tag->disabled = 'disabled';
            }

            $option_tag = new SwatHtmlTag('option');

            $select_tag->open();

            foreach ($options as $flydown_option) {
                if ($this->serialize_values) {
                    $option_tag->value = SwatString::signedSerialize(
                        $flydown_option->value,
                        $salt
                    );
                } else {
                    $option_tag->value = (string) $flydown_option->value;
                }

                if ($flydown_option instanceof SwatFlydownDivider) {
                    $option_tag->disabled = 'disabled';
                    $option_tag->class = 'swat-flydown-option-divider';
                } elseif ($flydown_option instanceof SwatFlydownBlankOption) {
                    $option_tag->removeAttribute('disabled');
                    $option_tag->class = 'swat-blank-option';
                } else {
                    $option_tag->removeAttribute('disabled');
                    $option_tag->removeAttribute('class');

                    // add option-specific CSS classes from option metadata
                    $classes = $this->getOptionMetadata(
                        $flydown_option,
                        'classes'
                    );

                    if (is_array($classes)) {
                        $option_tag->class = implode(' ', $classes);
                    } elseif ($classes) {
                        $option_tag->class = strval($classes);
                    }
                }

                $value = $this->serialize_values
                    ? $flydown_option->value
                    : (string) $flydown_option->value;

                if (
                    $flydown_value === $value &&
                    !$selected &&
                    !($flydown_option instanceof SwatFlydownDivider)
                ) {
                    $option_tag->selected = 'selected';
                    $selected = true;
                } else {
                    $option_tag->removeAttribute('selected');
                }

                $option_tag->setContent(
                    $flydown_option->title,
                    $flydown_option->content_type
                );

                $option_tag->display();
            }

            $select_tag->close();
        } elseif (count($options) === 1) {
            // get first and only element
            $this->displaySingle(current($options));
        }

        $wrapper->close();
    }
183149
private function AddLabelField()
    {
        $name = 'Label';
        $field = Input::Text($name, $this->select->GetLabel());
        $this->AddField($field);
    }
903295
def _latex_labels(self, labels):
        

        config = self._configuration.get("latex_labels", {})
        return [config.get(label, label) for label in labels]
1315543
def display(self):
        """"""
        country = self.country if self.state else self.country_full
        state = self.state if self.city else self.state_full
        vals = (self.street, self.city, state, country)
        disp = u', '.join(filter(None, vals))
        if self.street and (self.house or self.apartment):
            prefix = u'-'.join([val for val in (self.house, self.apartment) 
                                if val])
            disp = prefix + u' ' + (disp or u'')
        if self.po_box and not self.street:
            disp = u' '.join([u'P.O. Box', self.po_box, (disp or u'')])
        return disp
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
459534
public function display()
    {
        $options = $this->getOptions();

        if (!$this->visible || count($options) === 0) {
            return;
        }

        SwatWidget::display();

        $this->getForm()->addHiddenField($this->id . '_submitted', 1);

        $div_tag = new SwatHtmlTag('div');
        $div_tag->id = $this->id;
        $div_tag->class = $this->getCSSClassString();
        $div_tag->open();

        $input_tag = new SwatHtmlTag('input');
        $input_tag->type = 'checkbox';

        $label_tag = new SwatHtmlTag('label');
        $label_tag->class = 'swat-control';

        echo '<table>';

        if ($this->entry_column_title !== null) {
            echo '<thead><tr><th>&nbsp;</th><th>';
            echo $this->entry_column_title;
            echo '</th></tr></thead>';
        }

        // Only show the check all control if more than one checkable item is
        // displayed.
        if ($this->show_check_all && count($options) > 1) {
            echo '<tfoot><tr><td colspan="2">';
            $this->getCompositeWidget('check_all')->display();
            echo '</td></tr></tfoot>';
        }

        echo '<tbody>';
        foreach ($options as $key => $option) {
            echo '<tr><td>';

            $checkbox_id = $key . '_' . $option->value;

            $input_tag->value = (string) $option->value;
            $input_tag->removeAttribute('checked');
            $input_tag->name = $this->id . '[' . $key . ']';

            if (in_array($option->value, $this->values)) {
                $input_tag->checked = 'checked';
            }

            $input_tag->id = $this->id . '_' . $checkbox_id;
            echo '<span class="swat-checkbox-wrapper">';
            $input_tag->display();
            echo '<span class="swat-checkbox-shim"></span>';
            echo '</span>';

            $label_tag->for = $this->id . '_' . $checkbox_id;
            $label_tag->setContent($option->title, $option->content_type);
            $label_tag->display();

            echo '</td><td>';

            $this->getEntryWidget($option->value)->display();

            echo '</td></tr>';
        }
        echo '</tbody>';

        echo '</table>';

        $div_tag->close();

        Swat::displayInlineJavaScript($this->getInlineJavaScript());
    }
787168
def nice_display(item):
    """"""
    if hasattr(item, 'all'):  # RelatedManager: display a list
        return ', '.join(map(text_type, item.all()))
    return item
450748
def labels(self):
        
        return [self._labels.get(value) or text.pretty(key)
                for key, value in sorted(self.items(), key=lambda x: x[1])]