// SortByName 名称でのソート
761376
func (api *MobileGatewayAPI) SortByName(reverse bool) *MobileGatewayAPI {
	api.sortByName(reverse)
	return api
}
894309
func (listings Listings) lessByName(i, j int) bool {
	a := listings[i]
	b := listings[j]
	aNameLower := strings.ToLower(a.name)
	bNameLower := strings.ToLower(b.name)

	if aNameLower != bNameLower {
		return aNameLower < bNameLower
	}
	// If capitalization is the only thing different between the
	// words, put lower-case first.
	return a.name >= b.name
}
376764
func filterClustersByName(clusterNames []string, clusters []*api.Cluster) ([]*api.Cluster, error) {
	if len(clusterNames) != 0 {
		// Build a map as we want to return them in the same order as args
		m := make(map[string]*api.Cluster)
		for _, c := range clusters {
			m[c.ObjectMeta.Name] = c
		}
		var filtered []*api.Cluster
		for _, clusterName := range clusterNames {
			c := m[clusterName]
			if c == nil {
				return nil, fmt.Errorf("cluster not found %q", clusterName)
			}

			filtered = append(filtered, c)
		}
		return filtered, nil
	}

	return clusters, nil
}
506257
func (b *HogeJSONBuilder) RemoveByNames(names ...string) *HogeJSONBuilder {
	for _, name := range names {
		info := b._structPropertyMap[name]
		if info == nil {
			continue
		}
		delete(b._properties, info.fieldName)
	}
	return b
}
607683
func CloudByName(cloudName string) (*jujucloud.Cloud, error) {
	cloud, err := jujucloud.CloudByName(cloudName)
	if err != nil {
		if errors.IsNotFound(err) {
			// Check built in clouds like localhost (lxd).
			builtinClouds, err := BuiltInClouds()
			if err != nil {
				return nil, errors.Trace(err)
			}
			aCloud, found := builtinClouds[cloudName]
			if !found {
				return nil, errors.NotFoundf("cloud %s", cloudName)
			}
			return &aCloud, nil
		}
		return nil, errors.Trace(err)
	}
	return cloud, nil
}
623434
func (fg FieldGroup) FindByName(name string) (*FieldSpec, error) {
	for _, field := range fg {
		if field.Name == name {
			return field, nil
		}
	}
	return nil, fmt.Errorf("unknown field %v", name)
}
358311
func (api *AutoBackupAPI) SortByName(reverse bool) *AutoBackupAPI {
	api.sortByName(reverse)
	return api
}
604428
func FilterByName(name string) func(db *gorm.DB) *gorm.DB {
	return func(db *gorm.DB) *gorm.DB {
		return db.Where("name = ?", name).Limit(1)
	}
}
480538
func (api *LoadBalancerAPI) SortByName(reverse bool) *LoadBalancerAPI {
	api.sortByName(reverse)
	return api
}
194961
func (api *PacketFilterAPI) SortByName(reverse bool) *PacketFilterAPI {
	api.sortByName(reverse)
	return api
}
1169015
func (t *PackageList) LookupByName(name string) *build.Package {
	t.ensureInit()
	return t.namepool[name]
}
975169
func (q *QueryString) SortOrder(name string) (os []*SortOrder, err error) {
	defer func() {
		if rec := recover(); rec != nil {
			err = rec.(error)
		}
	}()

	raw, ok := q.fields[name]
	if !ok {
		return nil, fmt.Errorf("field not found: %q", name)
	}

	os, raw = parseSortOrders(raw)
	if len(raw) != 0 {
		os = nil
		err = UnexpectedEndOfSortOrders
	}

	return
}
1158983
func (d *Dir) RemoveNodeByName(name string) error {
	for i := 0; i < len(d.nodes); i++ {
		if d.nodes[i].Name() == name {
			d.nodes = append(d.nodes[:i], d.nodes[i+1:]...)
			return nil
		}
	}
	return fmt.Errorf("Con not find node to remove (by name " + name + ")")
}
864621
func (api *PublicPriceAPI) SortByName(reverse bool) *PublicPriceAPI {
	api.sortBy("DisplayName", reverse)
	return api
}
320733
func (api *ArchiveAPI) SortByName(reverse bool) *ArchiveAPI {
	api.sortByName(reverse)
	return api
}
1260585
func (c *Client) BucketByName(name string, createIfNotExists bool) (*BucketInfo, error) {
	bs, err := c.Buckets()
	if err != nil {
		return nil, err
	}
	for _, b := range bs {
		if b.Name == name {
			return b, nil
		}
	}
	if !createIfNotExists {
		return nil, errors.New("bucket not found: " + name)
	}
	return c.CreateBucket(name, false)
}
610983
func (api *ProductServerAPI) SortByName(reverse bool) *ProductServerAPI {
	api.sortByName(reverse)
	return api
}