Format label
        If value is missing, label will be colored red
195438
def get_label(self, prop, value):
        
        if value is None:
            return '{}: <FONT color="red">{}</FONT>'.format(prop, "not set")
        else:
            return "{}:{}".format(prop, value)
266946
def labeled(label, value, justification = 12)
      if value
        title = "- #{label}:"
        if value.is_a?(Enumerable)
          lines = [wrap_string(title, indentation_level)]
          lines += value.map do |v|
            wrap_string("- #{v}", indentation_level + 2)
          end
          puts lines.join("\n")
        else
          string = title.ljust(justification) + "#{value}"
          puts wrap_string(string, indentation_level)
        end
      end
    end
1276374
function get(format) {
		var ret;

		// it's NaN if gradient colors on a column chart
		if (rgba && !isNaN(rgba[0])) {
			if (format === 'rgb') {
				ret = 'rgb(' + rgba[0] + ',' + rgba[1] + ',' + rgba[2] + ')';
			} else if (format === 'a') {
				ret = rgba[3];
			} else {
				ret = 'rgba(' + rgba.join(',') + ')';
			}
		} else {
			ret = input;
		}
		return ret;
	}
1180346
def missing_labels(self):
        

        return np.array(sorted(set(range(0, self.max_label + 1)).
                               difference(np.insert(self.labels, 0, 0))))
1153095
def show_value(self, value):
        
        values = self.get_values()
        values = [x for x in values if x['label'] == value]
        if len(values) == 0:
            raise Exception("Unknown value")
        else:
            return values[0]
1257200
def displayformat(codes=[], fg=None, bg=None):
        """"""
        if isinstance(codes, basestring):
            codes = [codes]
        else:
            codes = list(codes)
        for code in codes:
            if code not in Magic.DISPLAY.keys():
                raise ValueError("'%s' not a valid display value" % code)
        for color in (fg, bg):
            if color != None:
                if color not in Magic.COLORS.keys():
                    raise ValueError("'%s' not a valid color" % color)
        return [codes, fg, bg]
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)
847468
def _missing_(cls, value):
        """"""
        if not (isinstance(value, int) and 0x0000 <= value <= 0xFFFF):
            raise ValueError('%r is not a valid %s' % (value, cls.__name__))
        if 0x0001 <= value <= 0x0BB8:
            extend_enum(cls, 'Registered by Xerox [0x%s]' % hex(value)[2:].upper().zfill(4), value)
            return cls(value)
        if 0x0020 <= value <= 0x003F:
            extend_enum(cls, 'Experimental [0x%s]' % hex(value)[2:].upper().zfill(4), value)
            return cls(value)
        if 0x0BB9 <= value <= 0xFFFF:
            extend_enum(cls, 'Dynamically Assigned [0x%s]' % hex(value)[2:].upper().zfill(4), value)
            return cls(value)
        if 0x4000 <= value <= 0x4FFF:
            extend_enum(cls, 'Dynamically Assigned Socket Numbers [0x%s]' % hex(value)[2:].upper().zfill(4), value)
            return cls(value)
        if 0x8000 <= value <= 0xFFFF:
            extend_enum(cls, 'Statically Assigned Socket Numbers [0x%s]' % hex(value)[2:].upper().zfill(4), value)
            return cls(value)
        super()._missing_(value)
1095248
private function formatLabel($label, $id = NULL, $attrs = array())
    {
        if($id)
            $attrs['for'] = $id;
        $ret = self::tag('label', $label, NULL, NULL, $attrs);
        return $ret;
    }
820305
def format_column(self, label, column):
        """"""
        if len(column) == 0:
            val_width = 0
        else:
            val_width = max(len(self.format_value(v)) for v in column)
        val_width = min(val_width, self.max_width)
        width = max(val_width, len(str(label)), self.min_width, len(self.etc))
        def pad(value, label=False):
            if label:
                raw = value
            else:
                raw = self.format_value(value)
            if len(raw) > width:
                prefix = raw[:width-len(self.etc)] + self.etc
            else:
                prefix = raw
            return prefix.ljust(width)
        return pad
185224
function formatBufferUncolored(err, options) {
    // istanbul ignore else
    if (!hex) {
        return err.buffer.toString('hex');
    }

    options = options || {};

    var hasOffset = !(err.offset === undefined || err.offset === null);
    var hasEnd = !(err.endOffset === undefined || err.endOffset === null);
    var markStart = options.markStart || '>';
    var markEnd = options.markEnd || '<';
    var accum = 0;

    var opts = options.hexerOptions ? Object.create(options.hexerOptions) : {};
    if (hasOffset) {
        opts.groupSeparator = '';
        if (hasEnd) {
            opts.decorateHexen = decorateRangedError;
        } else {
            opts.decorateHexen = decorateError;
        }
    }
    return hex(err.buffer, opts);

    // TODO: suspected broken across lines, should either test and complete or
    // use some sort of alternate notation such as interstitial lines
    function decorateRangedError(totalOffset, screenOffset, hexen) {
        var s;
        if (totalOffset === err.offset) {
            accum = 1;
            s = markStart + hexen;
            if (totalOffset === err.endOffset-1) {
                s += markEnd;
                accum = 0;
            } else {
                s = ' ' + s;
            }
            return s;
        } else if (totalOffset === err.endOffset-1) {
            s = hexen + markEnd;
            while (accum-- > 0) s += ' ';
            accum = 0;
            return s;
        } else if (accum) {
            accum += 2;
            return hexen;
        } else {
            return ' ' + hexen + ' ';
        }
    }

    function decorateError(totalOffset, screenOffset, hexen) {
        if (totalOffset === err.offset) {
            return markStart + hexen + markEnd;
        } else {
            return ' ' + hexen + ' ';
        }
    }
}
839172
function formatLabelView(str)
			{
				var formatLabel = formatbar.closest("."+vars.css+"_tool").find("."+vars.css+"_tool_label").find("."+vars.css+"_tool_text");
				
				if(str.length > 10)
						str = str.substr(0,7) + "...";
				
				//  of button
				formatLabel.html(str);
			}
904946
def label_wrap(self, label):
        """"""
        wrapped_label = r"%s\n%s" % (label,
                                     self[label].name.replace(",", r"\n"))
        return wrapped_label
220511
def as_colr(
            self, label_args=None, type_args=None, type_val_args=None,
            value_args=None, spec_args=None):
        
        label_args = label_args or {'fore': 'red'}
        type_args = type_args or {'fore': 'yellow'}
        type_val_args = type_val_args or {'fore': 'grey'}
        value_args = value_args or {'fore': 'blue', 'style': 'bright'}
        spec_args = spec_args or {'fore': 'blue'}
        spec_repr = repr(self.spec)
        spec_quote = spec_repr[0]
        val_repr = repr(self.value)
        val_quote = val_repr[0]
        return Colr(self.default_format.format(
            label=Colr(':\n    ').join(
                Colr('Bad format spec. color name/value', **label_args),
                ',\n    '.join(
                    '{lbl:<5} ({val})'.format(
                        lbl=Colr(l, **type_args),
                        val=Colr(v, **type_val_args),
                    )
                    for l, v in self.accepted_values
                )
            ),
            spec=Colr('=').join(
                Colr(v, **spec_args)
                for v in spec_repr[1:-1].split('=')
            ).join((spec_quote, spec_quote)),
            value=Colr(
                val_repr[1:-1],
                **value_args
            ).join((val_quote, val_quote)),
        ))
890475
public static String format(String label) {
        if (label.isEmpty()) {
            return label;
        }
        if(Character.isDigit(label.charAt(label.length()-1))) {
            for (int i = label.length(); i > 0; i--) {
                if(!Character.isDigit(label.charAt(i-1))) {
                    if(!Character.isLowerCase(label.charAt(i-1))) {
                        break;
                    }
                    label = label.substring(0, i) + " " + label.substring(i);
                    break;
                }
            }
        }
        return StringProcessor.formatHumanReadable(label);
    }
115276
def get_color(self, value):
        
        if value in COLOR_SET:
            value = COLOR_MAP[value]
        else:
            try:
                value = int(value)
                if value >= 8:
                    raise ValueError()
            except ValueError as exc:
                raise ValueError(
                    'Colors should either a member of: {} or a positive '
                    'integer below 8'.format(', '.join(COLOR_NAMES))
                )
        return '{}{}'.format(self.PREFIX, value)
601622
function validateFormatColor(obj) {
	return COLORS.indexOf(obj) !== -1 || obj.match(colorsReHex3) || obj.match(colorsReHex6)
		|| obj.match(colorsReRgbNum) || obj.match(colorsReRgbPerc);
}