/*
@param label - A string value that is the "gold standard" label for this training instance
@param features - A list of strings that correspond to the names of the features present for this training instance
504256
public void addTrainingInstance(String label, List<String> features) {
    maxent.addInstance(label,features);
  }
1218788
public List<Label> getFeatureLabels() {
        if (!isAnnotationPresent(Features.class)) {
            return Collections.emptyList();
        }

        List<Label> result = new ArrayList<>();
        for (String feature : getAnnotation(Features.class).value()) {
            result.add(createFeatureLabel(feature));
        }
        return result;
    }
474329
public void setLabel(String label) {
		final boolean entryExitLogging = log.isLoggable(Level.FINER);
		final String methodName = "setLabel"; //$NON-NLS-1$
		if (entryExitLogging) {
			log.entering(DependencyList.class.getName(), methodName, new Object[]{label});
		}
		this.label = label;
		if (entryExitLogging) {
			log.exiting(DependencyList.class.getName(), methodName);
		}
	}
1049616
public static Label buildLabel(final String label) {
        return addLabel(Label.newBuilder(), Locale.getDefault(), label).build();
    }
765336
def __set_labels(self, labels):
        
        with self.fs.open(self.fs.join(self.path, self.LABEL_FILE), 'w') \
                as file_desc:
            for label in labels:
                file_desc.write("%s,%s\n" % (label.name,
                                             label.get_color_str()))
6702
public Counter<L> scoresOf(int[] features) {
    Counter<L> scores = new ClassicCounter<L>();
    for (L label : labels())
      scores.setCount(label, scoreOf(features, label));
    return scores;
  }
1013419
public Expression labelStart(final Label label) {
    return new Expression(resultType(), features) {
      @Override
      protected void doGen(CodeBuilder adapter) {
        adapter.mark(label);
        Expression.this.gen(adapter);
      }
    };
  }
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;
  }
581490
@Override
	public void setLabelDescription(String labelDescription)
	{
		myUserInterfaceAction.setLabelDescription(labelDescription);
		putValue(Action.SHORT_DESCRIPTION, myMessageProvider.getMessage(getLabelDescription(), getLocale()));
	}
1163719
def valueByLabel(self, label):
        
        keys = self.keys()
        labels = [text.pretty(key) for key in keys]
        if label in labels:
            return self[keys[labels.index(label)]]
        return 0
203744
public void FeatureInit(String str, Map cpStr2Int, Map lbStr2Int) {
	StringTokenizer strTok = new StringTokenizer(str, " \t\r\n");
	// <label> <cp> <idx> <wgt>
	
	int len = strTok.countTokens();
	if (len != 4) {
	    return;
	}
	
	String labelStr = strTok.nextToken();
	String cpStr = strTok.nextToken();
	int idx = Integer.parseInt(strTok.nextToken());
	float val = 1;
	double wgt = Double.parseDouble(strTok.nextToken());
	
	Integer labelInt = (Integer)lbStr2Int.get(labelStr);
	Integer cpInt = (Integer)cpStr2Int.get(cpStr);
	FeatureInit(labelInt.intValue(), cpInt.intValue());
	
	this.idx = idx;
	this.val = val;
	this.wgt = wgt;
    }
373343
public void selectByLabel(String label) {
        getDispatcher().beforeSelect(this, label);
        
        new Select(getElement()).selectByVisibleText(label);
        if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
            logUIActions(UIActions.SELECTED, label);
        }
        
        getDispatcher().afterSelect(this, label);
    }
491208
def setLabel(self, value, label):
        
        if label:
            self._labels[value] = label
        else:
            self._labels.pop(value, None)
666616
protected void processLabels(List<MonolingualTextValue> labels) {
        for(MonolingualTextValue label : labels) {
        	String lang = label.getLanguageCode();
        	NameWithUpdate currentValue = newLabels.get(lang);
        	if (currentValue == null || !currentValue.value.equals(label)) {
	            newLabels.put(lang,
	                    new NameWithUpdate(label, true));
	            
	            // Delete any alias that matches the new label
	            AliasesWithUpdate currentAliases = newAliases.get(lang);
	            if (currentAliases != null && currentAliases.aliases.contains(label)) {
	            	deleteAlias(label);
	            }
        	}
        }
        
    }
1145021
public static Label.Builder generateLabelBuilder(final String label) {
        return addLabel(Label.newBuilder(), Locale.getDefault(), label);
    }
1010481
def set_label(self, label, lineno, local=False):
        
        ex_label, namespace = Memory.id_name(label)

        if ex_label in self.local_labels[-1].keys():
            result = self.local_labels[-1][ex_label]
            result.lineno = lineno
        else:
            result = self.local_labels[-1][ex_label] = Label(ex_label, lineno, namespace=NAMESPACE)

        if result.local == local:
            warning(lineno, "label '%s' already declared as LOCAL" % label)

        result.local = local

        return result
58983
public static Label createNameValueLabel(final String label, final String... values) {
        final String valueStr = StringUtils.arrayToDelimitedString(values, " ");
        final Label nameValueLabel = new Label(getBoldHTMLText(label) + valueStr, ContentMode.HTML);
        nameValueLabel.setSizeFull();
        nameValueLabel.addStyleName(SPUIDefinitions.TEXT_STYLE);
        nameValueLabel.addStyleName("label-style");
        return nameValueLabel;
    }