// returns a standard deck, all values of all four suits, unshuffled.
435766
func New() *StandardDeck {
	ans := new(StandardDeck)

	// add all cards from all suits
	for _, sv := range card.AllSuits {
		for _, vv := range card.AllValues {
			c := card.Card{Suit: sv, Value: vv}
			ans.cards = append(ans.cards, &c)
		}
	}

	return ans
}
979925
func (client *Client) Cards() (cards []Card, err error) {
	req, err := http.NewRequest(
		"GET",
		client.BaseURL+"/user/card/preference/list",
		nil,
	)
	if err != nil {
		return cards, err
	}
	resp, err := client.Do(req)
	if err != nil {
		return cards, err
	}
	defer resp.Body.Close()
	if resp.StatusCode != 200 {
		// this should never happen
		return cards, ErrDumbass
	}
	var preferences preferencesJSON
	err = json.NewDecoder(resp.Body).Decode(&preferences)
	return preferences.List, err
}
1041265
func (b *Board) GetLists(args Arguments) (lists []*List, err error) {
	path := fmt.Sprintf("boards/%s/lists", b.ID)
	err = b.client.Get(path, args, &lists)
	for i := range lists {
		lists[i].client = b.client
		for j := range lists[i].Cards {
			lists[i].Cards[j].client = b.client
		}
	}
	return
}
1274507
func (ung UniformGenerator) ShuffleRange(arr []interface{}, low, high int) {
	if low < 0 || low > high || high >= len(arr) {
		panic(fmt.Sprintf("Illegal subarray range %d ~ %d", low, high))
	}
	for i := low; i <= high; i++ {
		r := int32(i) + ung.Int32n(int32(high-i+1))
		arr[i], arr[r] = arr[r], arr[i]
	}
}
822103
func (arguments Arguments) UnpackValues(data []byte) ([]interface{}, error) {
	retval := make([]interface{}, 0, arguments.LengthNonIndexed())
	virtualArgs := 0
	for index, arg := range arguments.NonIndexed() {
		marshalledValue, err := toGoType((index+virtualArgs)*32, arg.Type, data)
		if arg.Type.T == ArrayTy && !isDynamicType(arg.Type) {
			// If we have a static array, like [3]uint256, these are coded as
			// just like uint256,uint256,uint256.
			// This means that we need to add two 'virtual' arguments when
			// we count the index from now on.
			//
			// Array values nested multiple levels deep are also encoded inline:
			// [2][3]uint256: uint256,uint256,uint256,uint256,uint256,uint256
			//
			// Calculate the full array size to get the correct offset for the next argument.
			// Decrement it by 1, as the normal index increment is still applied.
			virtualArgs += getTypeSize(arg.Type)/32 - 1
		} else if arg.Type.T == TupleTy && !isDynamicType(arg.Type) {
			// If we have a static tuple, like (uint256, bool, uint256), these are
			// coded as just like uint256,bool,uint256
			virtualArgs += getTypeSize(arg.Type)/32 - 1
		}
		if err != nil {
			return nil, err
		}
		retval = append(retval, marshalledValue)
	}
	return retval, nil
}
865849
func (b *Board) GetCards(args Arguments) (cards []*Card, err error) {
	path := fmt.Sprintf("boards/%s/cards", b.ID)

	err = b.client.Get(path, args, &cards)

	// Naive implementation would return here. To make sure we get all
	// cards, we begin
	if len(cards) > 0 {
		moreCards := true
		for moreCards == true {
			nextCardBatch := make([]*Card, 0)
			args["before"] = earliestCardID(cards)
			err = b.client.Get(path, args, &nextCardBatch)
			if len(nextCardBatch) > 0 {
				cards = append(cards, nextCardBatch...)
			} else {
				moreCards = false
			}
		}
	}

	for i := range cards {
		cards[i].client = b.client
	}

	return
}
560526
func (_class PCIClass) GetAll(sessionID SessionRef) (_retval []PCIRef, _err error) {
	_method := "PCI.get_all"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg)
	if _err != nil {
		return
	}
	_retval, _err = convertPCIRefSetToGo(_method + " -> ", _result.Value)
	return
}
555710
func ListStacks(session *session.Session,
	maxReturned int,
	stackFilters ...string) ([]*cloudformation.StackSummary, error) {

	listStackInput := &cloudformation.ListStacksInput{
		StackStatusFilter: []*string{},
	}
	for _, eachFilter := range stackFilters {
		listStackInput.StackStatusFilter = append(listStackInput.StackStatusFilter, aws.String(eachFilter))
	}
	cloudformationSvc := cloudformation.New(session)
	accumulator := []*cloudformation.StackSummary{}
	for {
		listResult, listResultErr := cloudformationSvc.ListStacks(listStackInput)
		if listResultErr != nil {
			return nil, listResultErr
		}
		accumulator = append(accumulator, listResult.StackSummaries...)
		if len(accumulator) >= maxReturned || listResult.NextToken == nil {
			return accumulator, nil
		}
		listStackInput.NextToken = listResult.NextToken
	}
}
1323903
func (s Int32) UnsortedList() []int32 {
	res := make([]int32, 0, len(s))
	for key := range s {
		res = append(res, key)
	}
	return res
}
1148655
func (r *EchoResponse) StandardCard(title string, content string, smallImg string, largeImg string) *EchoResponse {
	r.Response.Card = &EchoRespPayload{
		Type:    "Standard",
		Title:   title,
		Content: content,
	}

	if smallImg != "" {
		r.Response.Card.Image.SmallImageURL = smallImg
	}

	if largeImg != "" {
		r.Response.Card.Image.LargeImageURL = largeImg
	}

	return r
}
618389
func DetachSimpleCondAndBuildRangeForIndex(sctx sessionctx.Context, conditions []expression.Expression,
	cols []*expression.Column, lengths []int) ([]*Range, []expression.Expression, error) {
	newTpSlice := make([]*types.FieldType, 0, len(cols))
	for _, col := range cols {
		newTpSlice = append(newTpSlice, newFieldType(col.RetType))
	}
	res, err := detachCNFCondAndBuildRangeForIndex(sctx, conditions, cols, newTpSlice, lengths, false)
	return res.Ranges, res.AccessConds, err
}
713764
func (buildRes BuildRunResultsModel) OrderedResults() []StepRunResultsModel {
	results := make([]StepRunResultsModel, buildRes.ResultsCount())
	unorderedResults := buildRes.unorderedResults()
	for _, result := range unorderedResults {
		results[result.Idx] = result
	}
	return results
}
1157817
func Shuffle(ref interface{}) {
	switch ref.(type) {
	case []bool:
		ary := ref.([]bool)
		t := Shuffler(ary).(reflect.Value)
		for i := 0; i < t.Len(); i++ {
			ary[i] = bool(t.Index(i).Bool())
		}
	case []float32:
		ary := ref.([]float32)
		t := Shuffler(ary).(reflect.Value)
		for i := 0; i < t.Len(); i++ {
			ary[i] = float32(t.Index(i).Float())
		}
	case []float64:
		ary := ref.([]float64)
		t := Shuffler(ary).(reflect.Value)
		for i := 0; i < t.Len(); i++ {
			ary[i] = float64(t.Index(i).Float())
		}
	case []int:
		ary := ref.([]int)
		t := Shuffler(ary).(reflect.Value)
		for i := 0; i < t.Len(); i++ {
			ary[i] = int(t.Index(i).Int())
		}
	case []int8:
		ary := ref.([]int8)
		t := Shuffler(ary).(reflect.Value)
		for i := 0; i < t.Len(); i++ {
			ary[i] = int8(t.Index(i).Int())
		}
	case []int16:
		ary := ref.([]int16)
		t := Shuffler(ary).(reflect.Value)
		for i := 0; i < t.Len(); i++ {
			ary[i] = int16(t.Index(i).Int())
		}
	case []int32:
		ary := ref.([]int32)
		t := Shuffler(ary).(reflect.Value)
		for i := 0; i < t.Len(); i++ {
			ary[i] = int32(t.Index(i).Int())
		}
	case []int64:
		ary := ref.([]int64)
		t := Shuffler(ary).(reflect.Value)
		for i := 0; i < t.Len(); i++ {
			ary[i] = int64(t.Index(i).Int())
		}
	case []uint:
		ary := ref.([]uint)
		t := Shuffler(ary).(reflect.Value)
		for i := 0; i < t.Len(); i++ {
			ary[i] = uint(t.Index(i).Uint())
		}
	case []uint8:
		ary := ref.([]uint8)
		t := Shuffler(ary).(reflect.Value)
		for i := 0; i < t.Len(); i++ {
			ary[i] = uint8(t.Index(i).Uint())
		}
	case []uint16:
		ary := ref.([]uint16)
		t := Shuffler(ary).(reflect.Value)
		for i := 0; i < t.Len(); i++ {
			ary[i] = uint16(t.Index(i).Uint())
		}
	case []uint32:
		ary := ref.([]uint32)
		t := Shuffler(ary).(reflect.Value)
		for i := 0; i < t.Len(); i++ {
			ary[i] = uint32(t.Index(i).Uint())
		}
	case []uint64:
		ary := ref.([]uint64)
		t := Shuffler(ary).(reflect.Value)
		for i := 0; i < t.Len(); i++ {
			ary[i] = uint64(t.Index(i).Uint())
		}
	case []string:
		ary := ref.([]string)
		t := Shuffler(ary).(reflect.Value)
		for i := 0; i < t.Len(); i++ {
			ary[i] = string(t.Index(i).String())
		}
	}
}
256935
func (_class PoolPatchClass) GetAllRecords(sessionID SessionRef) (_retval map[PoolPatchRef]PoolPatchRecord, _err error) {
	_method := "pool_patch.get_all_records"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg)
	if _err != nil {
		return
	}
	_retval, _err = convertPoolPatchRefToPoolPatchRecordMapToGo(_method + " -> ", _result.Value)
	return
}
184157
func LazyShuffle(from FixedDataGrid) FixedDataGrid {
	_, rows := from.Size()
	rowMap := make(map[int]int)
	for i := 0; i < rows; i++ {
		j := rand.Intn(i + 1)
		rowMap[i] = j
		rowMap[j] = i
	}
	return NewInstancesViewFromRows(from, rowMap)
}
412519
func UniqString(a []string) []string {
	length := len(a)

	seen := make(map[string]struct{}, length)
	j := 0

	for i := 0; i < length; i++ {
		v := a[i]

		if _, ok := seen[v]; ok {
			continue
		}

		seen[v] = struct{}{}
		a[j] = v
		j++
	}

	return a[0:j]
}
628682
func (s Int64) UnsortedList() []int64 {
	res := make([]int64, 0, len(s))
	for key := range s {
		res = append(res, key)
	}
	return res
}