Paint checkbox and text
         _
        |_|  My label
761721
def paint(self, painter, option, index):
        

        body_rect = QtCore.QRectF(option.rect)

        check_rect = QtCore.QRectF(body_rect)
        check_rect.setWidth(check_rect.height())
        check_rect.adjust(6, 6, -6, -6)

        check_color = colors["idle"]

        if index.data(model.IsProcessing) is True:
            check_color = colors["active"]

        elif index.data(model.HasFailed) is True:
            check_color = colors["warning"]

        elif index.data(model.HasSucceeded) is True:
            check_color = colors["ok"]

        elif index.data(model.HasProcessed) is True:
            check_color = colors["ok"]

        metrics = painter.fontMetrics()

        label_rect = QtCore.QRectF(option.rect.adjusted(
            check_rect.width() + 12, 2, 0, -2))

        assert label_rect.width() > 0

        label = index.data(model.Label)
        label = metrics.elidedText(label,
                                   QtCore.Qt.ElideRight,
                                   label_rect.width() - 20)

        font_color = colors["idle"]
        if not index.data(model.IsChecked):
            font_color = colors["inactive"]

        # Maintain reference to state, so we can restore it once we're done
        painter.save()

        # Draw label
        painter.setFont(fonts["h4"])
        painter.setPen(QtGui.QPen(font_color))
        painter.drawText(label_rect, label)

        # Draw action icon
        if index.data(model.ActionIconVisible):
            painter.save()

            if index.data(model.ActionIdle):
                color = colors["idle"]
            elif index.data(model.IsProcessing):
                color = colors["active"]
            elif index.data(model.ActionFailed):
                color = colors["warning"]
            else:
                color = colors["ok"]

            painter.setFont(fonts["smallAwesome"])
            painter.setPen(QtGui.QPen(color))

            icon_rect = QtCore.QRectF(option.rect.adjusted(
                label_rect.width() + 1, label_rect.height() / 3, 0, 0))
            painter.drawText(icon_rect, icons["action"])

            painter.restore()

        # Draw checkbox
        pen = QtGui.QPen(check_color, 1)
        painter.setPen(pen)

        if index.data(model.IsOptional):
            painter.drawRect(check_rect)

            if index.data(model.IsChecked):
                painter.fillRect(check_rect, check_color)

        elif not index.data(model.IsIdle) and index.data(model.IsChecked):
                painter.fillRect(check_rect, check_color)

        if option.state & QtWidgets.QStyle.State_MouseOver:
            painter.fillRect(body_rect, colors["hover"])

        if option.state & QtWidgets.QStyle.State_Selected:
            painter.fillRect(body_rect, colors["selected"])

        # Ok, we're done, tidy up.
        painter.restore()
692985
function (label) {
              console.log(label, {
                constructors: constructors,
                constructor: key,
                params: args
              });
            }
374751
private Label createLabel(String label) {
        Pane pane = new Pane();
        root.addChild(pane);
        Label lbl = new Label();
        lbl.setName(label);
        pane.addChild(lbl);
        adjustPanes();
        return lbl;
    }
498489
def label(self,x,y,label,offset=[0,0]):
        """"""
        (xc,yc)=self.p2c([x,y])
        return self.create_text(xc-offset[0],yc-offset[1],text=label)
899237
def label(method, text = nil, options = {}, &block)
      text = instance_exec(&text) if text.is_a?(Proc)
      super
    end
636704
def create_menu_box_with_icon_and_label(label_text):
    
    box = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 10)
    box.set_border_width(0)
    icon_label = Gtk.Label()
    text_label = Gtk.AccelLabel.new(label_text)
    text_label.set_xalign(0)

    box.pack_start(icon_label, False, False, 0)
    box.pack_start(text_label, True, True, 0)
    return box, icon_label, text_label
573010
synchronized public void addLabel(String label) {
        if (!labelMap.contains(label)) {
            labelMap.add(labelCounter++, label);
        }
    }
955896
protected void renderInputTagEnd(ResponseWriter rw, SelectBooleanCheckbox selectBooleanCheckbox)
			throws IOException {
		rw.endElement("input");
		String caption = selectBooleanCheckbox.getCaption();
		if (null != caption) {
			if (selectBooleanCheckbox.isEscape()) {
				rw.writeText(" " + caption, null);
			} else {
				rw.append(" " + caption);
			}
		}
		rw.endElement("label");
		rw.endElement("div");
	}
979272
public synchronized CheckBox setLabel(String label) {
        if(label == null) {
            throw new IllegalArgumentException("Cannot set CheckBox label to null");
        }
        this.label = label;
        invalidate();
        return this;
    }
346933
function Checkbox({ children, ...props }) {
  const { getLabelProps, ...fieldCtx } = useFieldContext();
  const { getFocusProps, keyboardFocused } = useKeyboardFocus();

  /**
   * Due to us applying keyboard-only focus events to 2 separate elements (the input and label)
   * we must apply the original `onMouseDown` event to the `onMouseUp` event of the label.
   *
   * By passing the original props within `getFocusProps` we are able to allow
   * `event.preventDefault()` to still prevent chained events as expected.
   */
  const { onMouseDown: onFocusMouseDown, ...keyboardFocusedProps } = getFocusProps(props);

  const modifiedFieldCtx = {
    getLabelProps: ({ onMouseUp, ...other }) =>
      getLabelProps({ onMouseUp: composeEventHandlers(onMouseUp, onFocusMouseDown), ...other }),
    ...fieldCtx
  };

  return (
    <FieldContext.Provider value={modifiedFieldCtx}>
      <CheckboxContext.Provider value={{ isFocused: keyboardFocused }}>
        <StyledCheck>
          <StyledCheckInput
            {...modifiedFieldCtx.getInputProps({
              'data-garden-id': 'forms.checkbox',
              'data-garden-version': PACKAGE_VERSION,
              ...keyboardFocusedProps
            })}
          />
          {children}
        </StyledCheck>
      </CheckboxContext.Provider>
    </FieldContext.Provider>
  );
}
1077333
protected void paintLabels (Graphics2D gfx, int x, int y)
    {
        _label.render(gfx, x, y);
    }
1095428
def labels(self, text=None, coordinates=None, colorlist=None, sizes=None, fonts=None, opacity=1.0):
        ''''''
        if coordinates is None:
            coordinates=self.coordinates
        l=len(coordinates)
        if text is None:
            if len(self.topology.get('atom_types'))==l:
                text=[self.topology['atom_types'][i]+str(i+1) for i in range(l)]
            else:
                text=[str(i+1) for i in range(l)]

        text_representation = self.add_representation('text', {'coordinates':   coordinates,
                                                               'text':        text,
                                                               'colors':      colorlist,
                                                               'sizes':       sizes,
                                                               'fonts':       fonts,
                                                               'opacity':     opacity})
        def update(self=self, text_representation=text_representation):
            self.update_representation(text_representation, {'coordinates': coordinates})

        self.update_callbacks.append(update)
1354709
function printLintSummary(
  label: string,
  errors: number,
  warnings: number,
): void {
  const text = ` ${label}: ${errors} errors, ${warnings} warnings `

  let coloredText

  if (errors) {
    coloredText = chalk.white(chalk.bgRed(text))
  } else if (warnings) {
    coloredText = chalk.bgYellow(text)
  } else {
    coloredText = chalk.bgGreen(text)
  }

  const boldColoredText = chalk.bold(coloredText)

  console.log(`${boldColoredText}\n`)
}
839950
function colorBox(selection, label) {
  selection
      .classed('form-row', true)
      .classed('align-items-center', true)
      .on('change', () => {
        // avoid update by mousemove on the colorpicker
        d3.event.stopPropagation();
      });
  selection.append('div')
      .classed('form-group', true)
      .classed('col-form-label', true)
      .classed('col-form-label-sm', true)
      .classed('col-4', true)
      .classed('mb-1', true)
      .text(label);
  selection.append('div')
      .classed('form-group', true)
      .classed('col-form-label', true)
      .classed('col-form-label-sm', true)
      .classed('col-4', true)
      .classed('mb-1', true)
    .append('input')
      .classed('form-control', true)
      .classed('form-control-sm', true)
      .attr('type', 'color');
}
1172861
function checklistBox(selection, label) {
  // TODO: scroll
  selection
      .classed('form-group', true)
      .classed('form-row', true)
      .classed('align-items-center', true);
  const formLabel = selection.append('label')
      .classed('col-form-label', true)
      .classed('col-form-label-sm', true)
      .classed('col-4', true)
      .text(label);
  formLabel.append('div')
      .call(badge.invalidFeedback);
  selection.append('ul')
      .classed('form-control', true)
      .classed('form-control-sm', true)
      .classed('col-8', true);
}
524854
function() {
			var me = this;
			var labels = me.getLabels();
			me.minIndex = 0;
			me.maxIndex = labels.length - 1;
			var findIndex;

			if (me.options.ticks.min !== undefined) {
				// user specified min value
				findIndex = helpers.indexOf(labels, me.options.ticks.min);
				me.minIndex = findIndex !== -1 ? findIndex : me.minIndex;
			}

			if (me.options.ticks.max !== undefined) {
				// user specified max value
				findIndex = helpers.indexOf(labels, me.options.ticks.max);
				me.maxIndex = findIndex !== -1 ? findIndex : me.maxIndex;
			}

			me.min = labels[me.minIndex];
			me.max = labels[me.maxIndex];
		}
512264
def click_on_label(self, label):
    

    elem = ElementSelector(
        world.browser,
        str('//label[normalize-space(text())=%s]' % string_literal(label)),
        filter_displayed=True,
    )
    if not elem:
        raise AssertionError(
            "Cannot find a label with text '{}'.".format(label))
    elem.click()