// By can also take a non-existent key, which causes SORT to skip the sorting operation.
559958
func (s *SortCommand) By(pattern string) *SortCommand {
	s.by = pattern
	return s
}
356764
func (api *IconAPI) SortBy(key string, reverse bool) *IconAPI {
	api.sortBy(key, reverse)
	return api
}
1313815
func (self Object) KeysByParent() [][]string {
	var a [][]string

	for o := self.object; o != nil; o = o.prototype {
		var l []string

		o.enumerate(false, func(name string) bool {
			l = append(l, name)
			return true
		})

		a = append(a, l)
	}

	return a
}
1146479
func (l MetricList) ByKey() map[int32][]*types.PerfMetricId {
	ids := make(map[int32][]*types.PerfMetricId, len(l))

	for i := range l {
		id := &l[i]
		ids[id.CounterId] = append(ids[id.CounterId], id)
	}

	return ids
}
246312
func (api *NoteAPI) SortBy(key string, reverse bool) *NoteAPI {
	api.sortBy(key, reverse)
	return api
}
808711
func SearchBy(query string, by By) ([]Pkg, error) {
	return searchBy(query, by.String())
}
1225948
func (api *ServerAPI) SortByName(reverse bool) *ServerAPI {
	api.sortByName(reverse)
	return api
}
1062982
func ByValue(m interface{}) Items {
	ls := getLess(reflect.ValueOf(m).Type().Elem())
	return ByFunc(m, func(x, y Item) bool { return ls(x.Value, y.Value) })
}
474094
func (q *Query) SortBy(fields ...string) *Query {
	for i := range fields {
		if fields[i] == Key {
			panic("Cannot sort by Key.")
		}
		found := false
		for k := range q.sort {
			if q.sort[k] == fields[i] {
				found = true
				break
			}
		}
		if !found {
			q.sort = append(q.sort, fields[i])
		}
	}
	return q
}
721299
func (api *DatabaseAPI) SortByName(reverse bool) *DatabaseAPI {
	api.sortByName(reverse)
	return api
}
1007755
func (p Pages) ByLastmod() Pages {

	const key = "pageSort.ByLastmod"

	date := func(p1, p2 Page) bool {
		return p1.Lastmod().Unix() < p2.Lastmod().Unix()
	}

	pages, _ := spc.get(key, pageBy(date).Sort, p)

	return pages
}
1361214
func (b *DeleteBuilder) OrderBy(exprs ...interface{}) *DeleteBuilder {
	b.Delete.OrderBy = makeOrderBy(exprs...)
	return b
}
358311
func (api *AutoBackupAPI) SortByName(reverse bool) *AutoBackupAPI {
	api.sortByName(reverse)
	return api
}
1190928
func SortedKeys(m interface{}, t reflect.Type) interface{} {
	v := reflect.ValueOf(m)
	if v.Kind() != reflect.Map {
		panic("wrong type")
	}

	s := reflect.MakeSlice(reflect.SliceOf(v.Type().Key()), v.Len(), v.Len())
	for i, k := range v.MapKeys() {
		s.Index(i).Set(k)
	}

	s = s.Convert(t)
	sort.Sort(s.Interface().(sort.Interface))

	return s.Interface()
}
980907
func (d *Dataset) Sort(column string) *Dataset {
	return d.internalSort(column, false)
}
808539
func Sort(infos []Info, newer func(a, b *Info) bool) {
	if newer == nil {
		newer = NewerByCreated
	}
	sort.Sort(&infoSort{infos: infos, newer: newer})
}
167692
func (api *NoteAPI) SortByName(reverse bool) *NoteAPI {
	api.sortByName(reverse)
	return api
}