code: func MembersForSpeculativeQuery() (map[int32][]Node, error) {
  	thisNode := Manager.ThisNode()
  	allNodes := Manager.MemberList(true, true)
  	membersMap := make(map[int32][]Node)
  
  	// If we are running in dev mode, just return thisNode
  	if Mode == ModeDev {
  		membersMap[0] = []Node{thisNode}
  		return membersMap, nil
  	}
  
  	peerPartitions := 0
  
  	// store the available nodes for each partition group
  	for _, member := range allNodes {
  		partitions := member.GetPartitions()
  		memberStartPartition := partitions[0]
  
  		if _, ok := membersMap[memberStartPartition]; !ok {
  			peerPartitions += len(partitions)
  		}
  
  		membersMap[memberStartPartition] = append(membersMap[memberStartPartition], member)
  	}
  
  	if peerPartitions < minAvailableShards {
  		return nil, InsufficientShardsAvailable
  	}
  
  	for _, shard := range membersMap {
  		// Shuffle to avoid always choosing the same peer first
  		for i := len(shard) - 1; i > 0; i-- {
  			j := rand.Intn(i + 1)
  			shard[i], shard[j] = shard[j], shard[i]
  		}
  		sort.Slice(shard, func(i, j int) bool {
  			return shard[i].GetPriority() < shard[j].GetPriority()
  		})
  	}
  
  	return membersMap, nil
  }
docs: // MembersForSpeculativeQuery returns a prioritized list of nodes for each shard group
  // keyed by the first (lowest) partition of their shard group