// GetByName retrieves the team with the specified name
169700
func (t *TeamsClient) GetByName(ctx context.Context, orgID *identity.ID, name string) ([]envelope.Team, error) {
	return t.List(ctx, orgID, name, primitive.AnyTeamType)
}
1254018
func (daemon *Daemon) GetNetworkByName(name string) (libnetwork.Network, error) {
	c := daemon.netController
	if c == nil {
		return nil, libnetwork.ErrNoSuchNetwork(name)
	}
	if name == "" {
		name = c.Config().Daemon.DefaultNetwork
	}
	return c.NetworkByName(name)
}
850514
func GetUserByName(name string) (*User, error) {
	if len(name) == 0 {
		return nil, errors.UserNotExist{0, name}
	}
	u := &User{LowerName: strings.ToLower(name)}
	has, err := x.Get(u)
	if err != nil {
		return nil, err
	} else if !has {
		return nil, errors.UserNotExist{0, name}
	}
	return u, nil
}
1238771
func (client *Client) GetRouterGroupByName(name string) (RouterGroup, error) {
	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.GetRouterGroups,
		Query:       url.Values{"name": []string{name}},
	})

	if err != nil {
		return RouterGroup{}, err
	}
	var routerGroups []RouterGroup

	var response = Response{
		Result: &routerGroups,
	}

	err = client.connection.Make(request, &response)
	if err != nil {
		return RouterGroup{}, err
	}

	for _, routerGroup := range routerGroups {
		if routerGroup.Name == name {
			return routerGroup, nil
		}
	}

	return RouterGroup{}, routererror.ResourceNotFoundError{}
}
73960
func (sl *Slack) FindGroupByName(name string) (*Group, error) {
	return sl.FindGroup(func(group *Group) bool {
		return group.Name == name
	})
}
692649
func (c *CodeResult) GetName() string {
	if c == nil || c.Name == nil {
		return ""
	}
	return *c.Name
}
299470
func (formats Formats) GetByName(name string) (f Format, found bool) {
	for _, ff := range formats {
		if strings.EqualFold(name, ff.Name) {
			f = ff
			found = true
			return
		}
	}
	return
}
170306
func (t *TeamService) GetTeam(teamName string) (*TeamResponse, error) {
	var teamRes TeamResponse
	teamURL := TeamURL + "/" + teamName
	_, err := t.client.get(teamURL, url.Values{}, &teamRes)
	if err != nil {
		return nil, err
	}

	return &teamRes, nil
}
871194
func (m *MMClient) GetTeamName(teamId string) string { //nolint:golint
	m.RLock()
	defer m.RUnlock()
	for _, t := range m.OtherTeams {
		if t.Id == teamId {
			return t.Team.Name
		}
	}
	return ""
}
719162
func (m *PluginManager) GetByName(name string) (*plugin.Plugin, error) {
	plNameVersion := strings.Split(name, ":")
	version := ""
	if len(plNameVersion) > 1 {
		version = plNameVersion[1]
	}
	return m.GetByNameVersion(plNameVersion[0], version)
}
1013137
func (p *PreReceiveHook) GetName() string {
	if p == nil || p.Name == nil {
		return ""
	}
	return *p.Name
}
84645
func SourceByName(name string) (Source, error) {
	for s, n := range sourceNames {
		if n == name {
			return s, nil
		}
	}
	return -1, fmt.Errorf("unknown source %q", name)
}
26539
func GetTeamOfOrgByName(orgID int64, name string) (*Team, error) {
	return getTeamOfOrgByName(x, orgID, name)
}
278733
func (s *SourceImportAuthor) GetName() string {
	if s == nil || s.Name == nil {
		return ""
	}
	return *s.Name
}
22354
func (p *ProjectColumn) GetName() string {
	if p == nil || p.Name == nil {
		return ""
	}
	return *p.Name
}
910035
func (c *Client) GetTeam(teamKey string) (*Team, error) {
	content, err := c.GetFantasyContent(
		fmt.Sprintf("%s/team/%s;out=stats,metadata,players,standings,roster",
			YahooBaseURL,
			teamKey))
	if err != nil {
		return nil, err
	}

	if content.Team.TeamID == 0 {
		return nil, fmt.Errorf("no team returned for key='%s'", teamKey)
	}
	return &content.Team, nil
}
809091
func (r *RepositoryLicense) GetName() string {
	if r == nil || r.Name == nil {
		return ""
	}
	return *r.Name
}