Find first widget with given label among parents of the given widget (including widget itself)

@param {Lava.widget.Standard} widget Starting widget
@param {string} label
@returns {?Lava.widget.Standard}
424122
function(widget, label) {

		if (Lava.schema.DEBUG && !label) Lava.t();

		// Targets are different from view locators, there must be no hardcoded '@widget' label, like in views
		// ('@widget' label may be very harmful in this case. Use widget names instead!)

		if (label == 'root') {

			while (widget.getParentWidget()) {

				widget = widget.getParentWidget();

			}

		} else {

			while (widget && widget.label != label) {

				widget = widget.getParentWidget();

			}

		}

		return widget;

	}
1101392
function getOptionLabel(option, labelKey) {
  let optionLabel;

  if (typeof option === 'string') {
    optionLabel = option;
  }

  if (isPlainObject(option)) {
    if (typeof labelKey === 'string') {
      optionLabel = option[labelKey];
    } else if (isFunction(labelKey)) {
      optionLabel = labelKey(option);
    }
  }

  invariant(
    typeof optionLabel === 'string',
    'One or more options does not have a valid label string. Check the ' +
    '`labelKey` prop to ensure that it matches the correct option key and ' +
    'provides a string for filtering and display.'
  );

  return optionLabel;
}
1029132
public Label createLabel(BaseComponent parent, Object value, String prefix) {
        return createLabel(parent, value, prefix, null);
    }
1049616
public static Label buildLabel(final String label) {
        return addLabel(Label.newBuilder(), Locale.getDefault(), label).build();
    }
1118025
function(label) {
			var forkContext = this.forkContext;

			if (!forkContext.reachable) {
				return;
			}

			var context = getContinueContext(this, label);

			/* istanbul ignore else: foolproof (syntax error) */
			if (context) {
				if (context.continueDestSegments) {
					makeLooped(this, forkContext.head, context.continueDestSegments);

					// If the context is a for-in/of loop, this effects a break also.
					if (context.type === "ForInStatement" ||
						context.type === "ForOfStatement"
					) {
						context.brokenForkContext.add(forkContext.head);
					}
				} else {
					context.continueForkContext.add(forkContext.head);
				}
			}
			forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
		}
1048689
public InstructionHandle getLabeledInstruction(String label) {
        PatternElementMatch first = getFirstLabeledMatch(label);
        return first != null ? first.getMatchedInstructionInstructionHandle() : null;
    }
615634
public static Label newLabel(final String id, final String label)
	{
		return ComponentFactory.newLabel(id, Model.of(label));
	}
708335
private void labelIndicatorSetColorsToDefaultState(JLabel label) {
        if (label == null || settings == null) {
            return;
        }
        if (label == labelMonth || label == labelYear) {
            label.setBackground(settings.getColor(DateArea.BackgroundMonthAndYearMenuLabels));
            monthAndYearInnerPanel.setBackground(settings.getColor(DateArea.BackgroundMonthAndYearMenuLabels));
        }
        if (label == labelSetDateToToday) {
            label.setBackground(settings.getColor(DateArea.BackgroundTodayLabel));
        }
        if (label == labelClearDate) {
            label.setBackground(settings.getColor(DateArea.BackgroundClearLabel));
        }
        label.setBorder(new CompoundBorder(
            new EmptyBorder(1, 1, 1, 1), labelIndicatorEmptyBorder));
    }
692985
function (label) {
              console.log(label, {
                constructors: constructors,
                constructor: key,
                params: args
              });
            }
1250323
function() {

        var defaultLabel = this.get('defaultLabel') || this.defaultLabel || {};

        var label = {};
        label.markup = defaultLabel.markup || this.get('labelMarkup') || this.labelMarkup;
        label.position = defaultLabel.position;
        label.attrs = defaultLabel.attrs;
        label.size = defaultLabel.size;

        return label;
    }
683528
function (label) {
            var report = this.controller.removeValue(label);
            var removedSuggestion = report.removedSuggestion;
            var removedSuggestionIndex = report.removedSuggestionIndex;
            this._reactToControllerReport(report);
            this._textInputField.style.width = "0px";
            this.__resizeInput();
            return {
                removedSuggestion : removedSuggestion,
                removedSuggestionIndex : removedSuggestionIndex
            };
        }
159321
def parent_widget(self):
        
        parent = self.parent()
        if parent is not None and isinstance(parent, QtGraphicsItem):
            return parent.widget
75813
function(label) {
		var me = this;
		var ticksOpts = me.options.ticks;
		var tickLabelWidth = me.ctx.measureText(label).width;
		var angle = helpers$1.toRadians(ticksOpts.maxRotation);
		var cosRotation = Math.cos(angle);
		var sinRotation = Math.sin(angle);
		var tickFontSize = valueOrDefault$c(ticksOpts.fontSize, core_defaults.global.defaultFontSize);

		return (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation);
	}
397552
public CBORObject findAttribute(HeaderKeys label) {
        return findAttribute(label.AsCBOR(), PROTECTED | UNPROTECTED | DO_NOT_SEND);
    }
754658
private static boolean matchLabel(Node target, String label) {
    if (label == null) {
      return true;
    }
    while (target.isLabel()) {
      if (target.getFirstChild().getString().equals(label)) {
        return true;
      }
      target = target.getParent();
    }
    return false;
  }
910825
function Label(props) {
  const { getLabelProps } = useFieldContext();
  const checkboxCtx = useCheckboxContext();
  const radioCtx = useRadioContext();
  const toggleCtx = useToggleContext();

  let LabelComponent = StyledTextLabel;
  const sharedProps = {
    'data-garden-version': PACKAGE_VERSION
  };

  if (checkboxCtx) {
    LabelComponent = StyledCheckLabel;
    sharedProps['data-garden-id'] = 'forms.checkbox_label';
    sharedProps.focused = checkboxCtx.isFocused;
  } else if (radioCtx) {
    LabelComponent = StyledRadioLabel;
    sharedProps['data-garden-id'] = 'forms.radio_label';
    sharedProps.focused = radioCtx.isFocused;
  } else if (toggleCtx) {
    LabelComponent = StyledToggleLabel;
    sharedProps['data-garden-id'] = 'forms.toggle_label';
    sharedProps.focused = toggleCtx.isFocused;
  } else {
    sharedProps['data-garden-id'] = 'forms.text_label';
  }

  return React.createElement(
    LabelComponent,
    getLabelProps({
      ...sharedProps,
      ...props
    })
  );
}
759069
function(hasCustomMarkup, labelAttrs, defaultLabelAttrs, builtinDefaultLabelAttrs) {

        if (labelAttrs === null) return null;
        if (labelAttrs === undefined) {

            if (defaultLabelAttrs === null) return null;
            if (defaultLabelAttrs === undefined) {

                if (hasCustomMarkup) return undefined;
                return builtinDefaultLabelAttrs;
            }

            if (hasCustomMarkup) return defaultLabelAttrs;
            return joint.util.merge({}, builtinDefaultLabelAttrs, defaultLabelAttrs);
        }

        if (hasCustomMarkup) return joint.util.merge({}, defaultLabelAttrs, labelAttrs);
        return joint.util.merge({}, builtinDefaultLabelAttrs, defaultLabelAttrs, labelAttrs);
    }