Label boxes can only be inside association, codestream headers, or
        compositing layer header boxes.
497571
def _validate_label(self, boxes):
        
        for box in boxes:
            if box.box_id != 'asoc':
                if hasattr(box, 'box'):
                    for boxi in box.box:
                        if boxi.box_id == 'lbl ':
                            msg = ("A label box cannot be nested inside a "
                                   "{0} box.")
                            msg = msg.format(box.box_id)
                            raise IOError(msg)
                    # Same set of checks on any child boxes.
                    self._validate_label(box.box)
1147078
public static Object[] boxAll(Class<?> type, Object src, int srcPos, int len) {
        switch (tId(type)) {
            case I_BOOLEAN:     return boxBooleans(src, srcPos, len);
            case I_BYTE:        return boxBytes(src, srcPos, len);
            case I_CHARACTER:   return boxCharacters(src, srcPos, len);
            case I_DOUBLE:      return boxDoubles(src, srcPos, len);
            case I_FLOAT:       return boxFloats(src, srcPos, len);
            case I_INTEGER:     return boxIntegers(src, srcPos, len);
            case I_LONG:        return boxLongs(src, srcPos, len);
            case I_SHORT:       return boxShorts(src, srcPos, len);
        }
        throw new IllegalArgumentException("No primitive/box: " + type);
    }
684552
@Override
    protected void DecodeFromCBORObject(CBORObject messageObject) throws CoseException {
        if (messageObject.size() != 4) throw new CoseException("Invalid Sign1 structure");
        
        if (messageObject.get(0).getType() == CBORType.ByteString) {
            rgbProtected = messageObject.get(0).GetByteString();
            if (messageObject.get(0).GetByteString().length == 0) objProtected = CBORObject.NewMap();
            else {
                objProtected = CBORObject.DecodeFromBytes(rgbProtected);
                if (objProtected.size() == 0) rgbProtected = new byte[0];
            }
        }
        else throw new CoseException("Invalid Sign1 structure");
        
        if (messageObject.get(1).getType() == CBORType.Map) {
            objUnprotected = messageObject.get(1);
        }
        else throw new CoseException("Invalid Sign1 structure");
        
        if (messageObject.get(2).getType() == CBORType.ByteString) rgbContent = messageObject.get(2).GetByteString();
        else if (!messageObject.get(2).isNull()) throw new CoseException("Invalid Sign1 structure");
        
        if (messageObject.get(3).getType() == CBORType.ByteString) rgbSignature = messageObject.get(3).GetByteString();
        else throw new CoseException("Invalid Sign1 structure");
    }
1152086
private Set<LabelId> convertLabelsToIds(Set<Label> labelSet) {
        return labelSet.stream()
                .map(tx::convertToId)
                .filter(LabelId::isValid)
                .collect(toSet());
    }
234775
@Override
    public void revertLabels(@NonNull INDArray[] labels, INDArray[] maskArrays) {
        for (int i = 0; i < labels.length; i++) {
            revertLabels(labels, maskArrays, i);
        }
    }
1339780
@Deprecated
    public static JavaRDD<DataSet> fromLabeledPoint(JavaSparkContext sc, JavaRDD<LabeledPoint> data,
                    final long numPossibleLabels) {
        return data.map(new Function<LabeledPoint, DataSet>() {
            @Override
            public DataSet call(LabeledPoint lp) {
                return fromLabeledPoint(lp, numPossibleLabels);
            }
        });
    }
898333
private void addNullLabelExample() {
		add(new WHeading(HeadingLevel.H2, "How to use accessible null WLabels"));
		add(new ExplanatoryText("These examples shows how sometime a null WLabel is the right thing to do."
				+ "\n This example uses a WFieldSet as the labelled component and it has its own \"label\"."));

		// We want to add a WFieldSet to a WFieldLayout but without an extra label.
		WFieldLayout fieldsFlat = new WFieldLayout();
		fieldsFlat.setMargin(new Margin(null, null, Size.XL, null));
		add(fieldsFlat);
		WFieldSet fs = new WFieldSet("Do you like Bananas?");
		fieldsFlat.addField((WLabel) null, fs);
		// now add the WRadioButtons to the WFieldSet using an inner WFieldLayout
		WFieldLayout innerLayout = new WFieldLayout(WFieldLayout.LAYOUT_STACKED);

		// The content will be a group of WRadioButtons
		RadioButtonGroup group1 = new RadioButtonGroup();
		WRadioButton rb1 = group1.addRadioButton(1);
		WRadioButton rb2 = group1.addRadioButton(2);
		//make the labels for the radio buttons
		WLabel rb1Label = new WLabel("", rb1);
		WImage labelImage = new WImage("/image/success.png", "I still like bananas");
		labelImage.setHtmlClass("wc-valign-bottom");
		rb1Label.add(labelImage);
		WLabel rb2Label = new WLabel("", rb2);
		labelImage = new WImage("/image/error.png", "I still dislike bananas");
		labelImage.setHtmlClass("wc-valign-bottom");
		rb2Label.add(labelImage);
		innerLayout.addField(rb1Label, rb1);
		innerLayout.addField(rb2Label, rb2);
		// add the content to the WFieldLayout - the order really doesn't matter.
		fs.add(group1);
		fs.add(innerLayout);
	}
195971
def copy_headers(self, source_databox):
        
        for k in source_databox.hkeys: self.insert_header(k, source_databox.h(k))

        return self
1369663
private Map<String, Object> convertHeaderTypes(Map<String, Object> headers) {
        Map<String, Object> convertedHeaders = new HashMap<>();

        for (Map.Entry<String, Object> header : headers.entrySet()) {
            if (header.getValue() instanceof Collection<?>) {
                Collection<?> value = (Collection<?>)header.getValue();
                convertedHeaders.put(header.getKey(), StringUtils.collectionToCommaDelimitedString(value));
            } else if (header.getValue() instanceof MediaType) {
                convertedHeaders.put(header.getKey(), header.getValue().toString());
            } else {
                convertedHeaders.put(header.getKey(), header.getValue());
            }
        }

        return convertedHeaders;
    }
989994
function LabelAtlas (opts) {
    LabelAtlas.superclass.constructor.call(this, {
        file: opts.charMapFile,
        itemWidth: opts.itemWidth,
        itemHeight: opts.itemHeight,
        itemsToRender: opts.string.length,
        size: new geo.Size(opts.itemWidth * opts.string.length, opts.itemHeight)
    })

    events.addPropertyListener(this, 'string', 'change', this.updateAtlasValue.bind(this))

    this.mapStartChar = opts.startCharMap.charCodeAt(0)
    this.string = opts.string

    this.contentSize = new geo.Size(opts.itemWidth * this.string.length, opts.itemHeight)
}
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;
  }
336103
private void setLabelSingular(LabelGetter lg, AbstractRelation ar) {
        Labels labels = lg != null ? new Labels(lg.getLabels()) : new Labels();
        labels.setFallBack(toReadableLabel(ar.getTo().getVar()));
        ar.setLabels(labels);
    }
1212164
def labels(self, labels):
        
        allowed_values = ["raw data", "documentation", "visualization", "clean data", "script", "report"]
        if not set(labels).issubset(set(allowed_values)):
            raise ValueError(
                "Invalid values for `labels` [{0}], must be a subset of [{1}]"
                .format(", ".join(map(str, set(labels)-set(allowed_values))),
                        ", ".join(map(str, allowed_values)))
            )

        self._labels = labels
647984
void setNettyHeaders(io.netty.handler.codec.http.HttpHeaders headers) {
        this.nettyHeaders = headers;
    }
391364
static boolean containsDisallowedQuantileLabelForSummary(List<String> labelNames, Type type) {
    if (!Type.SUMMARY.equals(type)) {
      return false;
    }
    for (String label : labelNames) {
      if (LABEL_NAME_QUANTILE.equals(label)) {
        return true;
      }
    }
    return false;
  }
1021248
function InternalCodec(codecOptions, iconv) {
    this.enc = codecOptions.encodingName;
    this.bomAware = codecOptions.bomAware;

    if (this.enc === "base64")
        this.encoder = InternalEncoderBase64;
    else if (this.enc === "cesu8") {
        this.enc = "utf8"; // Use utf8 for decoding.
        this.encoder = InternalEncoderCesu8;

        // Add decoder for versions of Node not supporting CESU-8
        if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') {
            this.decoder = InternalDecoderCesu8;
            this.defaultCharUnicode = iconv.defaultCharUnicode;
        }
    }
}
83248
public static <T> T boxAllAs(Object src, int srcPos, int len, Class<T> type) {
        return (T) boxAll(type, src, srcPos, len);
    }