// SetChildrenLabels is a handler wrapper which sets labels for the content on
// the children returned by the handler and passes through the children.
// Must follow a handler that returns the children to be labeled.
431864
func SetChildrenLabels(manager content.Manager, f HandlerFunc) HandlerFunc {
	return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
		children, err := f(ctx, desc)
		if err != nil {
			return children, err
		}

		if len(children) > 0 {
			info := content.Info{
				Digest: desc.Digest,
				Labels: map[string]string{},
			}
			fields := []string{}
			for i, ch := range children {
				info.Labels[fmt.Sprintf("containerd.io/gc.ref.content.%d", i)] = ch.Digest.String()
				fields = append(fields, fmt.Sprintf("labels.containerd.io/gc.ref.content.%d", i))
			}

			_, err := manager.Update(ctx, info, fields...)
			if err != nil {
				return nil, err
			}
		}

		return children, err
	}
}
151125
func (s *AttachObjectInput) SetChildReference(v *ObjectReference) *AttachObjectInput {
	s.ChildReference = v
	return s
}
432178
func (s *ColumnInfo) SetLabel(v string) *ColumnInfo {
	s.Label = &v
	return s
}
846420
func NetworkOptionLabels(labels map[string]string) NetworkOption {
	return func(n *network) {
		n.labels = labels
	}
}
1190008
func (s *Stream) SetStreamLabel(v string) *Stream {
	s.StreamLabel = &v
	return s
}
588087
func (s *FolderMetadata) SetLabels(v []*string) *FolderMetadata {
	s.Labels = v
	return s
}
125481
func (e *Element) addChildren(childNodes []*gcdapi.DOMNode) {
	for _, child := range childNodes {
		if child != nil {
			e.addChild(child)
		}
	}
}
890030
func (b *Button) SetLabel(label string) *Button {
	b.label = label
	return b
}
6498
func (s *DescribeLabelingJobOutput) SetLabelAttributeName(v string) *DescribeLabelingJobOutput {
	s.LabelAttributeName = &v
	return s
}
1207901
func (i *InputField) SetLabel(label string) *InputField {
	i.label = label
	return i
}
39820
func (i *InmemSignal) flattenLabels(name string, labels []Label) string {
	buf := bytes.NewBufferString(name)
	replacer := strings.NewReplacer(" ", "_", ":", "_")

	for _, label := range labels {
		replacer.WriteString(buf, ".")
		replacer.WriteString(buf, label.Value)
	}

	return buf.String()
}
1131554
func (s *LabelingJobSummary) SetLabelCounters(v *LabelCounters) *LabelingJobSummary {
	s.LabelCounters = v
	return s
}
664488
func (s *InstanceTarget) SetInstanceLabel(v string) *InstanceTarget {
	s.InstanceLabel = &v
	return s
}
206454
func (c *LicenseV3) SetLabels(labels map[string]string) {
	c.Metadata.Labels = labels
}
815459
func (s *LabelDetection) SetLabel(v *Label) *LabelDetection {
	s.Label = v
	return s
}
1103182
func setLabel(labels map[appctypes.ACIdentifier]string, key, val string) {
	if key != "" && val != "" {
		labels[*appctypes.MustACIdentifier(key)] = val
	}
}
153688
func GenLabels(options string) (string, string, error) {
	return InitLabels(strings.Fields(options))
}