// RankedName compares the label names of li, lj lexically
// returning true if li.Name < lj.Name, else false.
// The names "version", "os", and "arch" always have lower ranks in that order,
// hence "version" < "os" < "arch" < [any other label name]
339709
func RankedName(li, lj types.Label) bool {
	ri := rank(li.Name)
	rj := rank(lj.Name)

	if ri != rj {
		return ri < rj
	}

	return li.Name < lj.Name
}
1306196
func (i Name) CanonicalName() CanonicalName {
	return CanonicalName{
		Name: Name{
			Domain: i.Registry(),
			Image:  i.Repository(),
		},
	}
}
981405
func (api *VPCRouterAPI) SortByName(reverse bool) *VPCRouterAPI {
	api.sortByName(reverse)
	return api
}
167692
func (api *NoteAPI) SortByName(reverse bool) *NoteAPI {
	api.sortByName(reverse)
	return api
}
877280
func IndexNameEqual(o1, o2 *IndexNameOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
10370
func (item *OrderItem) ProductName() string {
	item.loadSizeVariation()
	return item.SizeVariation.ColorVariation.Product.Name
}
1140830
func (i *Info) ObjectName() string {
	if i.Mapping != nil {
		return fmt.Sprintf("%s/%s", i.Mapping.Resource.Resource, i.Name)
	}
	gvk := i.Object.GetObjectKind().GroupVersionKind()
	if len(gvk.Group) == 0 {
		return fmt.Sprintf("%s/%s", strings.ToLower(gvk.Kind), i.Name)
	}
	return fmt.Sprintf("%s.%s/%s\n", strings.ToLower(gvk.Kind), gvk.Group, i.Name)
}
1257849
func (l *LabelResult) GetName() string {
	if l == nil || l.Name == nil {
		return ""
	}
	return *l.Name
}
1313753
func CanonicalToPreferredName(username kbname.NormalizedUsername,
	canon CanonicalName) (PreferredName, error) {
	tlfname := string(canon)
	if len(username) == 0 {
		return PreferredName(tlfname), nil
	}
	ws, rs, ext, err := SplitName(tlfname)
	if err != nil {
		return "", err
	}
	if len(ws) == 0 {
		return "", fmt.Errorf("TLF name %q with no writers", tlfname)
	}
	uname := username.String()
	ws = putUserFirst(uname, ws)
	rs = putUserFirst(uname, rs)
	tlfname = strings.Join(ws, ",")
	if len(rs) > 0 {
		tlfname += ReaderSep + strings.Join(rs, ",")
	}
	if len(ext) > 0 {
		tlfname += HandleExtensionSep + ext
	}
	return PreferredName(tlfname), nil
}
649598
func IsHugePageResourceName(name v1.ResourceName) bool {
	return strings.HasPrefix(string(name), v1.ResourceHugePagesPrefix)
}
864621
func (api *PublicPriceAPI) SortByName(reverse bool) *PublicPriceAPI {
	api.sortBy("DisplayName", reverse)
	return api
}
577721
func (d *DockerLabelNamer) ServiceName(container *docker.APIContainers) string {
	if container == nil {
		log.Warn("ServiceName() called with nil service passed!")
		return ""
	}

	for label, value := range container.Labels {
		if label == d.Label {
			return value
		}
	}

	log.Debugf(
		"Found container with no '%s' label: %s (%s), returning '%s'", d.Label,
		container.ID, container.Names[0], container.Image,
	)

	return container.Image
}
512745
func (s *LookupService) Name(ctx context.Context, resource platform.ResourceType, id platform.ID) (string, error) {
	return s.NameFn(ctx, resource, id)
}
782720
func (l *Label) GetName() string {
	if l == nil || l.Name == nil {
		return ""
	}
	return *l.Name
}
199423
func (branch *GitBranch) CanonicalName() string {
	if name := branch.BranchName; name != "" {
		return name
	} else {
		return branch.FullRemoteBranchName()
	}
}
155207
func (c *HealthCheck) IsSame(other *HealthCheck) bool {
	if c.Node != other.Node ||
		c.CheckID != other.CheckID ||
		c.Name != other.Name ||
		c.Status != other.Status ||
		c.Notes != other.Notes ||
		c.Output != other.Output ||
		c.ServiceID != other.ServiceID ||
		c.ServiceName != other.ServiceName ||
		!reflect.DeepEqual(c.ServiceTags, other.ServiceTags) ||
		!reflect.DeepEqual(c.Definition, other.Definition) {
		return false
	}

	return true
}
641354
func (api *IconAPI) SortByName(reverse bool) *IconAPI {
	api.sortByName(reverse)
	return api
}