/*
GetChatAdministrators get a list of administrators in a chat
*/
343421
func (c *Client) GetChatAdministrators(chatID string) ([]*ChatMember, error) {
	req := url.Values{}
	req.Set("chat_id", chatID)
	members := []*ChatMember{}
	err := c.doRequest("getChatAdministrators", req, &members)
	return members, err
}
307793
func (pm *ProtocolManager) getHelperTrie(id uint, idx uint64) (common.Hash, string) {
	switch id {
	case htCanonical:
		sectionHead := rawdb.ReadCanonicalHash(pm.chainDb, (idx+1)*pm.iConfig.ChtSize-1)
		return light.GetChtRoot(pm.chainDb, idx, sectionHead), light.ChtTablePrefix
	case htBloomBits:
		sectionHead := rawdb.ReadCanonicalHash(pm.chainDb, (idx+1)*pm.iConfig.BloomTrieSize-1)
		return light.GetBloomTrieRoot(pm.chainDb, idx, sectionHead), light.BloomTrieTablePrefix
	}
	return common.Hash{}, ""
}
678210
func (t *terminal) GetTerminalParams() rsession.TerminalParams {
	t.mu.Lock()
	defer t.mu.Unlock()
	return t.params
}
292545
func (s *Server) getLeader() (bool, *serverParts) {
	// Check if we are the leader
	if s.IsLeader() {
		return true, nil
	}

	// Get the leader
	leader := s.raft.Leader()
	if leader == "" {
		return false, nil
	}

	// Lookup the server
	s.peerLock.RLock()
	server := s.localPeers[leader]
	s.peerLock.RUnlock()

	// Server could be nil
	return false, server
}
64938
func decodeAdministrativeCommunication(data []byte) (string, []byte) {
	if len(data) == 0 {
		return "", data
	}
	communicationLen := int(data[0])
	if communicationLen > bgp.BGP_ERROR_ADMINISTRATIVE_COMMUNICATION_MAX {
		communicationLen = bgp.BGP_ERROR_ADMINISTRATIVE_COMMUNICATION_MAX
	}
	if communicationLen > len(data)+1 {
		communicationLen = len(data) + 1
	}
	return string(data[1 : communicationLen+1]), data[communicationLen+1:]
}
91911
func (r Security_Certificate_Request) GetAdministratorEmailPrefixes() (resp []string, err error) {
	err = r.Session.DoRequest("SoftLayer_Security_Certificate_Request", "getAdministratorEmailPrefixes", nil, &r.Options, &resp)
	return
}
998132
func (tm *transactionManager) getPeers(no *node, infoHash string) {
	tm.sendQuery(no, getPeersType, map[string]interface{}{
		"id":        tm.dht.id(infoHash),
		"info_hash": infoHash,
	})
}
805444
func GetPlayerMessages(p *player.Player) ([]*ChatMessage, error) {
	var messages []*ChatMessage

	err := db.DB.Model(&ChatMessage{}).Where("player_id = ?", p.ID).Order("room, created_at").Find(&messages).Error

	return messages, err

}
154964
func (s *AccessService) GetRoles() ([]services.Role, error) {
	result, err := s.GetRange(context.TODO(), backend.Key(rolesPrefix), backend.RangeEnd(backend.Key(rolesPrefix)), backend.NoLimit)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	out := make([]services.Role, 0, len(result.Items))
	for _, item := range result.Items {
		role, err := services.GetRoleMarshaler().UnmarshalRole(item.Value,
			services.WithResourceID(item.ID), services.WithExpires(item.Expires))
		if err != nil {
			return nil, trace.Wrap(err)
		}
		out = append(out, role)
	}
	sort.Sort(services.SortedRoles(out))
	return out, nil
}
154947
func (_class HostClass) GetManagementInterface(sessionID SessionRef, host HostRef) (_retval PIFRef, _err error) {
	_method := "host.get_management_interface"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_hostArg, _err := convertHostRefToXen(fmt.Sprintf("%s(%s)", _method, "host"), host)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _hostArg)
	if _err != nil {
		return
	}
	_retval, _err = convertPIFRefToGo(_method + " -> ", _result.Value)
	return
}
1287533
func (p *RoleServiceClient) GetMembers(role string) (r []string, err error) {
	if err = p.sendGetMembers(role); err != nil {
		return
	}
	return p.recvGetMembers()
}
507516
func GetConversationStatusBehavior(s chat1.ConversationStatus) ConversationStatusBehavior {
	switch s {
	case chat1.ConversationStatus_UNFILED:
		return ConversationStatusBehavior{
			ShowInInbox:           true,
			SendingRemovesStatus:  false,
			ActivityRemovesStatus: false,
			DesktopNotifications:  true,
			PushNotifications:     true,
			ShowBadges:            true,
		}
	case chat1.ConversationStatus_FAVORITE:
		return ConversationStatusBehavior{
			ShowInInbox:           true,
			SendingRemovesStatus:  false,
			ActivityRemovesStatus: false,
			DesktopNotifications:  true,
			PushNotifications:     true,
			ShowBadges:            true,
		}
	case chat1.ConversationStatus_IGNORED:
		return ConversationStatusBehavior{
			ShowInInbox:           false,
			SendingRemovesStatus:  true,
			ActivityRemovesStatus: true,
			DesktopNotifications:  true,
			PushNotifications:     true,
			ShowBadges:            true,
		}
	case chat1.ConversationStatus_REPORTED:
		fallthrough
	case chat1.ConversationStatus_BLOCKED:
		return ConversationStatusBehavior{
			ShowInInbox:           false,
			SendingRemovesStatus:  true,
			ActivityRemovesStatus: false,
			DesktopNotifications:  false,
			PushNotifications:     false,
			ShowBadges:            false,
		}
	case chat1.ConversationStatus_MUTED:
		return ConversationStatusBehavior{
			ShowInInbox:           true,
			SendingRemovesStatus:  false,
			ActivityRemovesStatus: false,
			DesktopNotifications:  false,
			PushNotifications:     false,
			ShowBadges:            false,
		}
	default:
		return ConversationStatusBehavior{
			ShowInInbox:           true,
			SendingRemovesStatus:  false,
			ActivityRemovesStatus: false,
			DesktopNotifications:  true,
			PushNotifications:     true,
			ShowBadges:            true,
		}
	}
}
1346447
func (a *Auth) Admins() (admins []User) {
	for _, name := range a.admins {
		user, err := a.robot.Users.GetByName(name)
		if err != nil {
			continue
		}
		admins = append(admins, user)
	}

	return
}
270491
func ListAdmins(c *deis.Client, results int) ([]string, int, error) {
	body, count, reqErr := c.LimitedRequest("/v2/admin/perms/", results)

	if reqErr != nil && !deis.IsErrAPIMismatch(reqErr) {
		return []string{}, -1, reqErr
	}

	var users []api.PermsRequest
	if err := json.Unmarshal([]byte(body), &users); err != nil {
		return []string{}, -1, err
	}

	usersList := []string{}

	for _, user := range users {
		usersList = append(usersList, user.Username)
	}

	return usersList, count, reqErr
}
733827
func (a *VppAdapter) GetMsgID(msgName string, msgCrc string) (uint16, error) {
	switch msgName {
	case "control_ping":
		return 100, nil
	case "control_ping_reply":
		return 101, nil
	case "sw_interface_dump":
		return 200, nil
	case "sw_interface_details":
		return 201, nil
	}

	a.access.Lock()
	defer a.access.Unlock()

	msgID, found := a.msgNameToIds[msgName]
	if found {
		return msgID, nil
	}

	a.msgIDSeq++
	msgID = a.msgIDSeq
	a.msgNameToIds[msgName] = msgID
	a.msgIDsToName[msgID] = msgName

	return msgID, nil
}
5213
func (gitter *Gitter) GetMessages(roomID string, params *Pagination) ([]Message, error) {

	var messages []Message
	url := gitter.config.apiBaseURL + "rooms/" + roomID + "/chatMessages"
	if params != nil {
		url += "?" + params.encode()
	}
	response, err := gitter.get(url)
	if err != nil {
		gitter.log(err)
		return nil, err
	}

	err = json.Unmarshal(response, &messages)
	if err != nil {
		gitter.log(err)
		return nil, err
	}

	return messages, nil
}
118381
func (c *aclCheckerV1) getPermissions(p string, username *string) (
	permissions permissionsV1, max permissionsV1, effectivePath string) {
	// This is only called on the root aclCheckerV1, and c.ac is always
	// populated here. So even if no other path shows up in the ACLs, any path
	// will get root's *accessControlV1 as the last resort.
	ac := c.getAccessControl(nil, p)
	permissions = ac.anonymous
	if ac.whitelistAdditional == nil || username == nil {
		return permissions, ac.maxPermission, ac.p
	}
	if perms, ok := ac.whitelistAdditional[*username]; ok {
		permissions.read = perms.read || permissions.read
		permissions.list = perms.list || permissions.list
	}
	return permissions, ac.maxPermission, ac.p
}