Set the label names, for printing via {@link #stats()}
544555
public void setLabelNames(List<String> labels) {
        if (labels == null) {
            this.labels = null;
            return;
        }
        this.labels = new ArrayList<>(labels);
    }
116572
private void setupLabel(Key key) {
        int i = 0;
        Key k = new Key();
        for (ValueWritable vw : key.getGrouping()) {
            vw.getLabel().set(inputLabels[i++]);
            k.getGrouping().add(new ValueWritable(vw.getLabel().toString(), vw.getValue()));
        }
        defaultGroupRecord.setKey(k);

        valuesLabels = new String[inputLabels.length - i];
        for (int j = 0; j < valuesLabels.length; j++) {
            valuesLabels[j] = inputLabels[i++];
        }
    }
565906
private void initGridLabels() {
        int dim = base.getDimension();
        double[] offset = new double[dim];
        for (int j = 0; j < dim; j++) {
            if (j != index) {
                offset[j] = -(base.getUpperBounds()[j] - base.getLowerBounds()[j]) / 100;
            }
        }

        int decimal = 0;
        String label;

        gridLabels = new Label[labelsSlicing.length];

        for (int i = 0; i < gridLabels.length; i++) {

            double[] labelCoord = new double[base.getDimension()];
            System.arraycopy(base.getCoordinateSpace()[index + 1], 0, labelCoord, 0, base.getDimension());
            labelCoord[index] = labelsSlicing[i];

            if (dim == 3) {
                if (index == 0) {
                    labelCoord[2] = base.getUpperBounds()[2] - 2 * offset[2];
                } else if (index == 1) {
                    labelCoord[0] = base.getUpperBounds()[0] - 2 * offset[0];
                } else if (index == 2) {
                    labelCoord[1] = base.getUpperBounds()[1] - 2 * offset[1];
                }
            }

            decimal = base.getPrecisionDigits()[index];

            if (gridLabelStrings != null) {
                label = gridLabelStrings[i % gridLabelStrings.length];
            } else {
                String format = "%.0f";
                if (decimal < 0) {
                    format = String.format("%%.%df", -decimal);
                }
                label = String.format(format, labelsSlicing[i]);
            }

            for (int j = 0; j < dim; j++) {
                labelCoord[j] += offset[j];
            }

            if (base.getDimension() == 2) {
                if (index == 0) {
                    if (rotation == 0.0) {
                        gridLabels[i] = new Label(label, 0.5, 1.0, labelCoord);
                    } else {
                        gridLabels[i] = new Label(label, 1.0, 0.5, rotation, labelCoord);
                    }
                } else {
                    gridLabels[i] = new Label(label, 1.0, 0.5, labelCoord);
                }
            } else {
                if (index == 0) {
                    gridLabels[i] = new Label(label, 0.5, -0.5, labelCoord);
                } else if (index == 1) {
                    gridLabels[i] = new Label(label, 0.5, 1.0, labelCoord);
                } else if (index == 2) {
                    gridLabels[i] = new Label(label, 0.0, 0.5, labelCoord);
                }
            }

            gridLabels[i].setFont(gridLabelFont);
        }

        gridLabelStrings = null;
    }
1081577
@Override
    public void sortByLabel() {
        Map<Integer, Queue<DataSet>> map = new HashMap<>();
        List<DataSet> data = asList();
        int numLabels = numOutcomes();
        int examples = numExamples();
        for (DataSet d : data) {
            int label = d.outcome();
            Queue<DataSet> q = map.get(label);
            if (q == null) {
                q = new ArrayDeque<>();
                map.put(label, q);
            }
            q.add(d);
        }

        for (Map.Entry<Integer, Queue<DataSet>> label : map.entrySet()) {
            log.info("Label " + label + " has " + label.getValue().size() + " elements");
        }

        //ideal input splits: 1 of each label in each batch
        //after we run out of ideal batches: fall back to a new strategy
        boolean optimal = true;
        for (int i = 0; i < examples; i++) {
            if (optimal) {
                for (int j = 0; j < numLabels; j++) {
                    Queue<DataSet> q = map.get(j);
                    if (q == null) {
                        optimal = false;
                        break;
                    }
                    DataSet next = q.poll();
                    //add a row; go to next
                    if (next != null) {
                        addRow(next, i);
                        i++;
                    } else {
                        optimal = false;
                        break;
                    }
                }
            } else {
                DataSet add = null;
                for (Queue<DataSet> q : map.values()) {
                    if (!q.isEmpty()) {
                        add = q.poll();
                        break;
                    }
                }

                addRow(add, i);

            }


        }


    }
723761
def names_labels(self, do_print=False):
        
        if do_print:
            for name, label in zip(self.field_names, self.field_labels):
                print('%s --> %s' % (str(name), str(label)))
        return self.field_names, self.field_labels
607915
private void updateSetsLabeled(int i1, final double a1, final double C)
    {
        final double y_i = label[i1];
        I1[i1] = a1 == 0 && y_i == 1;
        I2[i1] = a1 == C && y_i == -1;
        I3[i1] = a1 == C && y_i == 1;
        I4[i1] = a1 == 0 && y_i == -1;
    }
122989
private void writeTermStatisticsToFile(UsageStatistics usageStatistics,
			String fileName) {

		// Make sure all keys are present in label count map:
		for (String key : usageStatistics.aliasCounts.keySet()) {
			countKey(usageStatistics.labelCounts, key, 0);
		}
		for (String key : usageStatistics.descriptionCounts.keySet()) {
			countKey(usageStatistics.labelCounts, key, 0);
		}

		try (PrintStream out = new PrintStream(
				ExampleHelpers.openExampleFileOuputStream(fileName))) {

			out.println("Language,Labels,Descriptions,Aliases");
			for (Entry<String, Integer> entry : usageStatistics.labelCounts
					.entrySet()) {
				countKey(usageStatistics.aliasCounts, entry.getKey(), 0);
				int aCount = usageStatistics.aliasCounts.get(entry.getKey());
				countKey(usageStatistics.descriptionCounts, entry.getKey(), 0);
				int dCount = usageStatistics.descriptionCounts.get(entry
						.getKey());
				out.println(entry.getKey() + "," + entry.getValue() + ","
						+ dCount + "," + aCount);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
790323
private void setupLabel() {
		// To retain compatibility with the WText API, create a WText for this component,
		// which gets added to the label body.
		WText textBody = new WText() {
			@Override
			public boolean isEncodeText() {
				return WHeading.this.isEncodeText();
			}

			@Override
			public String getText() {
				return WHeading.this.getText();
			}
		};

		if (label.getBody() == null) {
			label.setBody(textBody);
		} else {
			WComponent oldBody = label.getBody();

			WContainer newBody = new WContainer();
			label.setBody(newBody);

			newBody.add(textBody);
			newBody.add(oldBody);
		}
	}
203178
public String[] getLabel(InstanceSet set) {
		String[] pred= new String[set.size()];
		for(int i=0;i<set.size();i++){
			pred[i]=  getStringLabel(set.getInstance(i));			
		}
		return pred;
	}
698959
def label_set(self):
        """"""
        label_set = list()
        for class_ in self.class_set:
            samples_in_class = self.sample_ids_in_class(class_)
            label_set.append(self.labels[samples_in_class[0]])

        return label_set
1129386
protected function setLabels()
    {
        if ($this->data['labels.overrides']) {
            $this->labels = array_replace($this->labels, $this->data['labels.overrides']);
        }
    }
803459
private LabeledStatement matchJumpLabelName()
        throws IOException
    {
        LabeledStatement label = null;

        if (peekTokenOrEOL() == Token.NAME) {
            consumeToken();
            if (labelSet != null) {
                label = labelSet.get(ts.getString());
            }
            if (label == null) {
                reportError("msg.undef.label");
            }
        }

        return label;
    }
340334
public void setLabel(java.lang.String label) {
        getStateHelper().put(PropertyKeys.label, label);
    }
893568
public Child labels(String... labelValues) {
    if (labelValues.length != labelNames.size()) {
      throw new IllegalArgumentException("Incorrect number of labels.");
    }
    for (String label: labelValues) {
      if (label == null) {
        throw new IllegalArgumentException("Label cannot be null.");
      }
    }
    List<String> key = Arrays.asList(labelValues);
    Child c = children.get(key);
    if (c != null) {
      return c;
    }
    Child c2 = newChild();
    Child tmp = children.putIfAbsent(key, c2);
    return tmp == null ? c2 : tmp;
  }
102342
static Set<String> labels(final ResultSet results) throws SQLException {
        final ResultSetMetaData metadata = results.getMetaData();
        final int count = metadata.getColumnCount();
        final Set<String> labels = new HashSet<>(count);
        for (int i = 1; i <= count; i++) {
            labels.add(metadata.getColumnLabel(i).toUpperCase());
        }
        return labels;
    }
175470
private static void printData()
   {
      Map<String, StatisticsContext> tmpContexts = CONTEXTS;
      for (StatisticsContext context : tmpContexts.values())
      {
         printData(context);
      }
   }
934122
public void setLabels(Collection<LabelType> labels) {
    this.labels.clear();
    if (labels != null) {
      this.labels.addAll(labels);
    }
  }