// Used for args and labels
184587
func handleBuildOptionMap(m map[interface{}]interface{}) (map[string]*string, error) {
	args := map[string]*string{}
	for mapKey, mapValue := range m {
		var argValue string
		name, ok := mapKey.(string)
		if !ok {
			return args, fmt.Errorf("Cannot unmarshal '%v' to type %T into a string value", name, name)
		}
		switch a := mapValue.(type) {
		case string:
			argValue = a
		case int:
			argValue = strconv.Itoa(a)
		case int64:
			argValue = strconv.Itoa(int(a))
		default:
			return args, fmt.Errorf("Cannot unmarshal '%v' to type %T into a string value", mapValue, mapValue)
		}
		args[name] = &argValue
	}
	return args, nil
}
1155328
func makeLabels(m *dto.Metric) map[string]string {
	result := map[string]string{}
	for _, lp := range m.Label {
		result[lp.GetName()] = lp.GetValue()
	}
	return result
}
985471
func chunkLabels(labels map[string]string, chunkSize int) [][]string {
	// First sort labels so they always occur in the same order.
	sorted := make([]string, 0, len(labels))
	for k, v := range labels {
		sorted = append(sorted, fmt.Sprintf("%v=%v", k, v))
	}
	sort.Slice(sorted, func(i, j int) bool { return sorted[i] < sorted[j] })

	// Then chunk labels into sized chunks.
	var chunks [][]string
	for chunkSize < len(sorted) {
		sorted, chunks = sorted[chunkSize:], append(chunks, sorted[0:chunkSize:chunkSize])
	}
	chunks = append(chunks, sorted)

	return chunks
}
471836
func (p *EnumParam) Args() []string {
	if p.value == nil {
		return []string{}
	}
	return []string{fmt.Sprintf("--%v", p.CLIName()), *p.value}
}
658352
func (p *StringParam) Args() []string {
	return []string{fmt.Sprintf("--%v", p.CLIName()), p.String()}
}
1268945
func label(l string, indent, width int) string {
	pad := width - indent - len(l)
	if pad < 0 {
		pad = 0
	}
	return fmt.Sprintf("%s%s%s", strings.Repeat(" ", indent), l,
		strings.Repeat(" ", pad))
}
593202
func Labels(app *Manifest, process *Process) map[string]string {
	return merge(app.Labels, process.Labels)
}
492000
func MakeCommandLineArgs(s string) []string {
	r := []string{}
	for _, part := range safeSplit(s) {
		if len(part) == 0 {
			continue
		}
		r = append(r, part)
	}
	return r
}
362079
func (l *Label) String() string {
	if len(l.Value) != 0 {
		return fmt.Sprintf("%s:%s=%s", l.Source, l.Key, l.Value)
	}
	return fmt.Sprintf("%s:%s", l.Source, l.Key)
}
195552
func escapeArgs(args []string) string {
	escapedArgs := make([]string, len(args))
	for i, a := range args {
		escapedArgs[i] = windows.EscapeArg(a)
	}
	return strings.Join(escapedArgs, " ")
}
1079396
func (s *Set) Arg(n int) string {
	if n >= 0 && n < len(s.args) {
		return s.args[n]
	}
	return ""
}
159624
func Arg(n int) string {
	if n >= 0 && n < len(CommandLine.args) {
		return CommandLine.args[n]
	}
	return ""
}
900129
func Arg(key, value string) KeyValuePair {
	return KeyValuePair{Key: key, Value: value}
}
18537
func (cmd *Cmd) Arguments(args ...string) *Cmd {
	cmd.Cmd.Args = append(cmd.Cmd.Args[0:1], args...) //we need the first argument which is the command
	return cmd
}
77181
func (cmd *CLI) Arg(index int) values.Value {
	return cmd.Args()[index]
}
1126853
func (p *ListParam) Args() []string {
	if len(p.values) == 0 {
		return []string{}
	}
	out := make([]string, 0, len(p.values))
	for _, v := range p.values {
		out = append(out, v.Args()...)
	}
	return out
}
385620
func (item *Item) Label() (string, error) {
  val, err := item.dbus.GetProperty("org.freedesktop.Secret.Item.Label")
  if err != nil {
    return "", err
  }

  return val.Value().(string), nil
}