//GetSlot returns the slot number for given team, class strings and the
//lobby format
438662
func GetSlot(lobbytype Format, teamStr string, classStr string) (int, error) {
	team, ok := teamMap[teamStr]
	if !ok {
		return -1, ErrorInvalidTeam(teamStr)
	}

	class, ok := typeClassMap[lobbytype][classStr]
	if !ok {
		return -1, ErrorInvalidClass(classStr)
	}

	return team*NumberOfClassesMap[lobbytype] + class, nil
}
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
}
564443
func FindSlotByLabel(p *pkcs11.Ctx, slotLabel string) (slot uint, index int, err error) {

	var slotFound bool

	// Get list of slots
	slots, err := p.GetSlotList(true)
	if err == nil {

		// Look for matching slot label
		for i, s := range slots {
			tInfo, errGt := p.GetTokenInfo(s)
			if errGt != nil {
				err = errGt
				return
			}
			if slotLabel == tInfo.Label {
				slotFound = true
				slot = s
				index = i
				fmt.Printf("PKCS11 provider found specified slot label: %s (slot: %d, index: %d)\n", slotLabel, slot, i)
				break
			}
		}
	}

	// set error if slot not found
	if !slotFound {
		err = errors.New(fmt.Sprintf("Could not find slot with label: %s", slotLabel))
	}

	return
}
147622
func (r *Repository) GetTeamsURL() string {
	if r == nil || r.TeamsURL == nil {
		return ""
	}
	return *r.TeamsURL
}
851881
func (s *TeamsService) GetTeamMembership(ctx context.Context, team int64, user string) (*Membership, *Response, error) {
	u := fmt.Sprintf("teams/%v/memberships/%v", team, user)
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	req.Header.Set("Accept", mediaTypeNestedTeamsPreview)

	t := new(Membership)
	resp, err := s.client.Do(ctx, req, t)
	if err != nil {
		return nil, resp, err
	}

	return t, resp, nil
}
427214
func (t *TeamDiscussion) GetTeamURL() string {
	if t == nil || t.TeamURL == nil {
		return ""
	}
	return *t.TeamURL
}
26539
func GetTeamOfOrgByName(orgID int64, name string) (*Team, error) {
	return getTeamOfOrgByName(x, orgID, name)
}
616794
func (t *Team) GetName() string {
	if t == nil || t.Name == nil {
		return ""
	}
	return *t.Name
}
1315397
func (r *Redis) GetSet(key, value string) ([]byte, error) {
	rp, err := r.ExecuteCommand("GETSET", key, value)
	if err != nil {
		return nil, err
	}
	return rp.BytesValue()
}
489532
func (t *TeamService) GetTeams() (*TeamsResponse, error) {
	var teamsRes TeamsResponse
	_, err := t.client.get(TeamURL, url.Values{}, &teamsRes)
	if err != nil {
		return nil, err
	}

	return &teamsRes, nil
}
630884
func (js *Js) GetTicket() (ticketStr string, err error) {
	js.GetJsAPITicketLock().Lock()
	defer js.GetJsAPITicketLock().Unlock()

	//先从cache中取
	jsAPITicketCacheKey := fmt.Sprintf("jsapi_ticket_%s", js.AppID)
	val := js.Cache.Get(jsAPITicketCacheKey)
	if val != nil {
		ticketStr = val.(string)
		return
	}
	var ticket resTicket
	ticket, err = js.getTicketFromServer()
	if err != nil {
		return
	}
	ticketStr = ticket.Ticket
	return
}
499704
func (t *Team) GetURL() string {
	if t == nil || t.URL == nil {
		return ""
	}
	return *t.URL
}
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 ""
}
159745
func (o *InsideBoundingBoxOption) Get() ([][4]float64, string) {
	if o == nil {
		return nil, ""
	}
	return o.boxes, o.coordinates
}
1016746
func (lobby *Lobby) IsSlotOccupied(slot int) bool {
	var count int
	db.DB.Model(&LobbySlot{}).Where("lobby_id = ? AND slot = ?", lobby.ID, slot).Count(&count)
	return count != 0
}
17830
func (i *Invitation) GetTeamCount() int {
	if i == nil || i.TeamCount == nil {
		return 0
	}
	return *i.TeamCount
}
1286812
func getSlotNums(lobbytype Format, slot int) (int, int, error) {
	classList := typeClassList[lobbytype]

	if slot < len(classList) {
		return 0, slot, nil
	} else if slot < 2*len(classList) {
		return 1, slot - len(classList), nil
	} else {
		return 0, 0, ErrorInvalidSlot(slot)
	}
}