// Labels returns all metadata keys stored in the context. These label names should be named
// as: plugin/NAME, where NAME is something descriptive.
183054
func Labels(ctx context.Context) []string {
	if metadata := ctx.Value(key{}); metadata != nil {
		if m, ok := metadata.(md); ok {
			return keys(m)
		}
	}
	return nil
}
205335
func (k *Apk) Label(resConfig *androidbinary.ResTableConfig) (s string, err error) {
	s = k.getResource(k.manifest.App.Label, resConfig)
	if androidbinary.IsResID(s) {
		err = errors.New("unable to convert label-id to string")
	}
	return
}
715050
func labels(key string) func(*Status) []string {
	return func(s *Status) []string {
		vs := make([]string, 0, len(s.Labels))
		for _, l := range s.Labels {
			if l.Key == key {
				vs = append(vs, l.Value)
			}
		}
		return vs
	}
}
826311
func ValidateLabels(labels map[string]string, fldPath *validation.FieldPath) validation.ErrorList {
	allErrs := validation.ErrorList{}
	for k, v := range labels {
		allErrs = append(allErrs, ValidateLabelName(k, fldPath)...)
		if !validation.IsValidLabelValue(v) {
			allErrs = append(allErrs, validation.NewInvalidError(fldPath, v, labelValueErrorMsg))
		}
	}
	return allErrs
}
884788
func (e *Endpoint) GetLabels() []string {
	if e.SecurityIdentity == nil {
		return []string{}
	}

	return e.SecurityIdentity.Labels.GetModel()
}
30475
func (s *DocumentMetadata) SetLabels(v []*string) *DocumentMetadata {
	s.Labels = v
	return s
}
24692
func getPodLabels(build *buildv1.Build) map[string]string {
	return map[string]string{buildutil.BuildLabel: buildapihelpers.LabelValue(build.Name)}
}
946941
func (m Metadata) Keys() []string {
	keys := make([]string, len(m))
	var i int
	for key, _ := range m {
		keys[i] = key
		i += 1
	}
	return keys
}
386093
func (s *CreateApplicationRequest) SetLabels(v []*string) *CreateApplicationRequest {
	s.Labels = v
	return s
}
1249993
func (h *headIndexReader) LabelValues(names ...string) (index.StringTuples, error) {
	if len(names) != 1 {
		return nil, encoding.ErrInvalidSize
	}

	h.head.symMtx.RLock()
	sl := make([]string, 0, len(h.head.values[names[0]]))
	for s := range h.head.values[names[0]] {
		sl = append(sl, s)
	}
	h.head.symMtx.RUnlock()
	sort.Strings(sl)

	return index.NewStringTuples(sl, len(names))
}
982026
func (s *CreateLabelsInput) SetLabels(v []*string) *CreateLabelsInput {
	s.Labels = v
	return s
}
445414
func getLabelNames(datapointsLabels []datapointLabels) []string {
	// Collect all label names used among datapointsLabels.
	nameMap := map[string]bool{}
	for _, kv := range datapointsLabels {
		for k := range kv.labels {
			nameMap[k] = true
		}
	}

	// Return a slice of nameMap keys.
	names := []string{}
	for n := range nameMap {
		names = append(names, n)
	}
	return names
}
232473
func OptionLabels(labels []string) Option {
	return func(c *Config) {
		for _, label := range labels {
			if strings.HasPrefix(label, netlabel.Prefix) {
				c.Daemon.Labels = append(c.Daemon.Labels, label)
			}
		}
	}
}
891824
func (s *DockerVolumeConfiguration) SetLabels(v map[string]*string) *DockerVolumeConfiguration {
	s.Labels = v
	return s
}
1133329
func (b *Board) GetLabels(args Arguments) (labels []*Label, err error) {
	path := fmt.Sprintf("boards/%s/labels", b.ID)
	err = b.client.Get(path, args, &labels)
	return
}
1341204
func AddLabel(labels map[string]string, labelKey, labelValue string) map[string]string {
	if labelKey == "" {
		// Don't need to add a label.
		return labels
	}
	if labels == nil {
		labels = make(map[string]string)
	}
	labels[labelKey] = labelValue
	return labels
}
1049022
func (e *PodEndpoint) Label(key, value string) *PodEndpoint {
	e.Labels[key] = value
	return e
}