// Labels will return the names of the files in the slice, sorted by modification time
484106
func (p FileInfoSlice) Labels() []string {
	// This would probably be very slightly more efficient with a heap, but the
	// API would be more complicated
	sort.Sort(p)
	labels := make([]string, p.Len())
	for i, label := range p {
		labels[i] = label.Name()
	}
	return labels
}
206454
func (c *LicenseV3) SetLabels(labels map[string]string) {
	c.Metadata.Labels = labels
}
316142
func WithLabels(labels map[string]string) Opt {
	return func(info *Info) error {
		info.Labels = labels
		return nil
	}
}
588087
func (s *FolderMetadata) SetLabels(v []*string) *FolderMetadata {
	s.Labels = v
	return s
}
1234678
func (n *PodNetwork) Label(key, value string) *PodNetwork {
	n.Labels[key] = value
	return n
}
405699
func makeLabels(labels, annotations map[string]string) map[string]string {
	merged := make(map[string]string)
	for k, v := range labels {
		merged[k] = v
	}
	for k, v := range annotations {
		// Assume there won't be conflict.
		merged[fmt.Sprintf("%s%s", annotationPrefix, k)] = v
	}
	return merged
}
1129491
func (r *Reader) LabelValues(names ...string) (StringTuples, error) {

	key := strings.Join(names, labelNameSeperator)
	off, ok := r.labels[key]
	if !ok {
		// XXX(fabxc): hot fix. Should return a partial data error and handle cases
		// where the entire block has no data gracefully.
		return emptyStringTuples{}, nil
		//return nil, fmt.Errorf("label index doesn't exist")
	}

	d := encoding.NewDecbufAt(r.b, int(off), castagnoliTable)

	nc := d.Be32int()
	d.Be32() // consume unused value entry count.

	if d.Err() != nil {
		return nil, errors.Wrap(d.Err(), "read label value index")
	}
	st := &serializedStringTuples{
		idsCount: nc,
		idsBytes: d.Get(),
		lookup:   r.lookupSymbol,
	}
	return st, nil
}
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
}
921695
func label(b *Builder, args []string, attributes map[string]bool, flagArgs []string, original string) error {
	if len(args) == 0 {
		return errAtLeastOneArgument("LABEL")
	}
	if len(args)%2 != 0 {
		// should never get here, but just in case
		return errTooManyArguments("LABEL")
	}

	if b.RunConfig.Labels == nil {
		b.RunConfig.Labels = map[string]string{}
	}

	for j := 0; j < len(args); j++ {
		// name  ==> args[j]
		// value ==> args[j+1]
		b.RunConfig.Labels[args[j]] = args[j+1]
		j++
	}
	return nil
}
799487
func Label(k, v string) selector.Option {
	return func(o *selector.Options) {
		l, ok := o.Context.Value(labelKey{}).([]label)
		if !ok {
			l = []label{}
		}
		l = append(l, label{k, v})
		o.Context = context.WithValue(o.Context, labelKey{}, l)
	}
}
321450
func makeLabels(labelNames []string, labelValsCombined string) map[string]string {
	tags := make(map[string]string)
	labelVals := strings.Split(labelValsCombined, ".")
	for i, v := range labelVals {
		tags[labelNames[i]] = v
	}
	return tags
}
1004788
func (s *CreateApplicationOutput) SetLabels(v []*string) *CreateApplicationOutput {
	s.Labels = v
	return s
}
1268320
func (s *SearchService) Labels(ctx context.Context, repoID int64, query string, opt *SearchOptions) (*LabelsSearchResult, *Response, error) {
	result := new(LabelsSearchResult)
	resp, err := s.search(ctx, "labels", &searchParameters{RepositoryID: &repoID, Query: query}, opt, result)
	return result, resp, err
}
580952
func (s *UpdateApplicationRequest) SetLabels(v []*string) *UpdateApplicationRequest {
	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))
}
1140327
func LabelFilter(key, value string) map[string][]string {
	return map[string][]string{
		"label": {fmt.Sprintf("%s=%s", key, value)},
	}
}
593202
func Labels(app *Manifest, process *Process) map[string]string {
	return merge(app.Labels, process.Labels)
}