// LeftStrings get all Left Identity fields.
199711
func (m IdentityNodes) LeftStrings() []string {
	s := make([]string, len(m))
	for i, in := range m {
		l, r, hasLr := in.LeftRight()
		if hasLr {
			s[i] = l
		} else {
			s[i] = r
		}
	}
	return s
}
1242963
func ReverseString(s string) string {
	r := []rune(s)
	for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
		r[i], r[j] = r[j], r[i]
	}
	return string(r)
}
721566
func ExtractString(s, left, right string) string {
	return strings.Split(strings.Split(s, left)[1], right)[0]
}
464845
func SubjectsStrings(currentNamespace string, subjects []kapi.ObjectReference) ([]string, []string, []string, []string) {
	users := []string{}
	groups := []string{}
	sas := []string{}
	others := []string{}

	for _, subject := range subjects {
		switch subject.Kind {
		case ServiceAccountKind:
			if len(subject.Namespace) > 0 && currentNamespace != subject.Namespace {
				sas = append(sas, subject.Namespace+"/"+subject.Name)
			} else {
				sas = append(sas, subject.Name)
			}

		case UserKind, SystemUserKind:
			users = append(users, subject.Name)

		case GroupKind, SystemGroupKind:
			groups = append(groups, subject.Name)

		default:
			others = append(others, fmt.Sprintf("%s/%s/%s", subject.Kind, subject.Namespace, subject.Name))

		}
	}

	return users, groups, sas, others
}
1230208
func Substring(left Expression, right Expression) Expression {
	return reparent(&SubstringExpression{binaryExpression{expression{}, left, right}})
}
1179288
func uniqueMergeSortedStrings(ls, rs []string) []string {
	varSet := make([]string, len(ls)+len(rs))
	for i := 0; ; i++ {
		if len(ls) == 0 {
			rs, ls = ls, rs
		}
		if len(rs) == 0 {
			i += copy(varSet[i:], ls)
			return varSet[:i]
		}
		assert(i < len(varSet))
		assert(len(rs) > 0 && len(ls) > 0)
		if ls[0] > rs[0] {
			ls, rs = rs, ls
		}
		if ls[0] < rs[0] {
			varSet[i] = ls[0]
			ls = ls[1:]
		} else {
			varSet[i] = ls[0]
			ls, rs = ls[1:], rs[1:]
		}
	}
}
290708
func (n Namespace) Strings() []string {
	var ns []string
	for _, namespaceElement := range n {
		ns = append(ns, namespaceElement.Value)
	}
	return ns
}
619413
func shuffleStrings(list []string) {
	for i := range list {
		j := rand.Intn(i + 1)
		list[i], list[j] = list[j], list[i]
	}
}
1229908
func leftPad(input []byte, size int) (out []byte) {
	n := len(input)
	if n > size {
		n = size
	}
	out = make([]byte, size)
	copy(out[len(out)-n:], input)
	return
}
891893
func (u *UI) BoldString(s string) string {
	if !u.EnableColors {
		return s
	}

	ctx := ansiterm.Context{
		Styles: []ansiterm.Style{ansiterm.Bold},
	}

	return createStyledString(ctx, s)
}
786122
func (f Flags) Strings() []string {
	s := support()
	r := make([]string, 0, 20)
	for i := uint(0); i < 64; i++ {
		key := Flags(1 << i)
		val := flagNames[key]
		if s&key != 0 {
			r = append(r, val)
		}
	}
	return r
}
250621
func (q Queue) PushStrings(bodies ...string) (ids []string, err error) {
	msgs := make([]*Message, 0, len(bodies))
	for _, body := range bodies {
		msgs = append(msgs, &Message{Body: body})
	}

	return q.PushMessages(msgs...)
}
975332
func LeftRight(val string) (string, string, bool) {
	if len(val) < 2 {
		return "", val, false
	}
	switch by := val[0]; by {
	case '`':
		vals := strings.Split(val, "`.`")
		if len(vals) == 1 {
			return "", IdentityTrim(val), false
		} else if len(vals) == 2 {
			return IdentityTrim(vals[0]), IdentityTrim(vals[1]), true
		}
		// wat, no idea what this is
		return "", val, false
	case '[':
		vals := strings.Split(val, "].[")
		if len(vals) == 1 {
			return "", IdentityTrim(val), false
		} else if len(vals) == 2 {
			return IdentityTrim(vals[0]), IdentityTrim(vals[1]), true
		}
		// wat, no idea what this is
		return "", val, false
	default:
		vals := strings.SplitN(val, ".", 2)
		if len(vals) == 1 {
			return "", val, false
		} else if len(vals) == 2 {
			return IdentityTrim(vals[0]), IdentityTrim(vals[1]), true
		}
	}

	return "", val, false
}
1266322
func MapToSortedStrings(m map[string]struct{}) []string {
	ss := []string{}
	for k := range m {
		ss = append(ss, k)
	}
	sort.Strings(ss)
	return ss
}
1280960
func (me *Dataset) LeftJoin(table Expression, condition joinExpression) *Dataset {
	return me.joinTable(LEFT_JOIN, table, condition)
}
1227240
func (t *Token) SignedString(key interface{}) (string, error) {
	var sig, sstr string
	var err error
	if sstr, err = t.SigningString(); err != nil {
		return "", err
	}
	if sig, err = t.Method.Sign(sstr, key); err != nil {
		return "", err
	}
	return strings.Join([]string{sstr, sig}, "."), nil
}
275026
func (s *ServerV2) LabelsString() string {
	labels := []string{}
	for key, val := range s.Metadata.Labels {
		labels = append(labels, fmt.Sprintf("%s=%s", key, val))
	}
	for key, val := range s.Spec.CmdLabels {
		labels = append(labels, fmt.Sprintf("%s=%s", key, val.Result))
	}
	sort.Strings(labels)
	return strings.Join(labels, ",")
}