/* entertains each and every field in CSV as element of list */
179782
func CSVToList(csvalues string) []string {
	var list []string

	csvalues = strings.TrimSpace(csvalues)
	csvio := bytes.NewBufferString(csvalues)
	csvReader := csv.NewReader(csvio)

	for {
		fields, err := csvReader.Read()
		if err == io.EOF {
			break
		} else if err != nil {
			fmt.Printf("Error converting CSV values to List:\n%s\n", csvalues)
			fmt.Println(err)
		}

		for _, val := range fields {
			list = append(list, val)
		}
	}
	return list
}
498674
func (c *keyValueChanger) List() ([]KeyValue, error) {
	if c.err != nil {
		return nil, c.err
	}
	var list []KeyValue
	err := c.node.doChildren(func(cn *node) error {
		list = append(list, KeyValue{cn.content.key().(string), cn.content.value()})
		return nil
	})
	if err != nil {
		return nil, err
	}
	return list, nil
}
630561
func (ListEventTypes) Each(resp interface{}, callback IterateItemFunc) {
	items, ok := resp.(*ListEventTypesResponse)
	if !ok {
		callback(nil, fmt.Errorf("wrong type, ListEventTypesResponse was expected, got %T", resp))
		return
	}

	for i := range items.EventType {
		if !callback(&items.EventType[i], nil) {
			break
		}
	}
}
55845
func list_insert(fnname string, recv_ Value, args Tuple, kwargs []Tuple) (Value, error) {
	recv := recv_.(*List)
	var index int
	var object Value
	if err := UnpackPositionalArgs(fnname, args, kwargs, 2, &index, &object); err != nil {
		return nil, err
	}
	if err := recv.checkMutable("insert into", true); err != nil {
		return nil, err
	}

	if index < 0 {
		index += recv.Len()
	}

	if index >= recv.Len() {
		// end
		recv.elems = append(recv.elems, object)
	} else {
		if index < 0 {
			index = 0 // start
		}
		recv.elems = append(recv.elems, nil)
		copy(recv.elems[index+1:], recv.elems[index:]) // slide up one
		recv.elems[index] = object
	}
	return None, nil
}
824374
func (s *stringStack) All() []string {
	sl := len(s.values)
	all := make([]string, sl)
	copy(all, s.values)
	return all
}
455389
func ToListing(each EachListing) func(io.ReadCloser, error) error {
	return func(body io.ReadCloser, err error) error {
		if err != nil {
			return err
		}
		listing := Listing{}
		err = xml.NewDecoder(body).Decode(&listing)
		return each(listing, err)
	}
}
554731
func (r *Reply) ListBytes() ([][]byte, error) {
	if r.Type == ErrorReply {
		return nil, r.Err
	}
	if r.Type != MultiReply {
		return nil, errors.New("reply type is not MultiReply")
	}

	bufs := make([][]byte, len(r.Elems))
	for i, v := range r.Elems {
		if v.Type == BulkReply {
			bufs[i] = v.buf
		} else if v.Type == NilReply {
			bufs[i] = nil
		} else {
			return nil, errors.New("element type is not BulkReply or NilReply")
		}
	}

	return bufs, nil
}
678966
func includeElement(list interface{}, element interface{}) (ok, found bool) {

	listValue := reflect.ValueOf(list)
	listKind := reflect.TypeOf(list).Kind()
	defer func() {
		if e := recover(); e != nil {
			ok = false
			found = false
		}
	}()

	if listKind == reflect.String {
		elementValue := reflect.ValueOf(element)
		return true, strings.Contains(listValue.String(), elementValue.String())
	}

	if listKind == reflect.Map {
		mapKeys := listValue.MapKeys()
		for i := 0; i < len(mapKeys); i++ {
			if ObjectsAreEqual(mapKeys[i].Interface(), element) {
				return true, true
			}
		}
		return true, false
	}

	for i := 0; i < listValue.Len(); i++ {
		if ObjectsAreEqual(listValue.Index(i).Interface(), element) {
			return true, true
		}
	}
	return true, false

}
1133170
func (c *stringChanger) List() ([]string, error) {
	if c.err != nil {
		return nil, c.err
	}
	var list []string
	err := c.node.doChildren(func(cn *node) error {
		list = append(list, cn.content.value().(string))
		return nil
	})
	if err != nil {
		return nil, err
	}
	return list, nil
}
1118811
func (bf BitField) All(val bool) bool {
	targ := bf.size
	if !val {
		targ = 0
	}
	return bf.CountSet() == targ
}
176142
func (c *IterateChain) All() ([]Value, error) {
	c.start()
	defer c.end()
	done := c.ctx.Done()
	var out []Value
iteration:
	for c.next() {
		select {
		case <-done:
			break iteration
		default:
		}
		out = append(out, c.it.Result())
		for c.nextPath() {
			select {
			case <-done:
				break iteration
			default:
			}
			out = append(out, c.it.Result())
		}
	}
	return out, c.it.Err()
}
928343
func (r *Reply) List() ([]string, error) {
	// Doing all this in two places instead of just calling ListBytes() so we don't have
	// to iterate twice
	if r.Type == ErrorReply {
		return nil, r.Err
	}
	if r.Type != MultiReply {
		return nil, errors.New("reply type is not MultiReply")
	}

	strings := make([]string, len(r.Elems))
	for i, v := range r.Elems {
		if v.Type == BulkReply {
			strings[i] = string(v.buf)
		} else if v.Type == NilReply {
			strings[i] = ""
		} else {
			return nil, errors.New("element type is not BulkReply or NilReply")
		}
	}

	return strings, nil
}
217315
func (c *keyStringValueChanger) List() ([]KeyStringValue, error) {
	if c.err != nil {
		return nil, c.err
	}
	var list []KeyStringValue
	err := c.node.doChildren(func(cn *node) error {
		list = append(list, KeyStringValue{cn.content.key().(string), cn.content.value().(string)})
		return nil
	})
	if err != nil {
		return nil, err
	}
	return list, nil
}
1284894
func (l *List) Add(values ...interface{}) {
	l.values = append(l.values, values...)
}
225695
func (mem *memNamedMapping) ListFields(name string) map[string][]string {
	mem.access.RLock()
	defer mem.access.RUnlock()

	fields := make(map[string][]string)

	item, found := mem.nameToIdx[name]
	if found {
		for field := range item.indexed {
			fields[field] = []string{}
			for _, value := range item.indexed[field] {
				fields[field] = append(fields[field], value)
			}
		}
	}

	return fields
}
789288
func ConcatLists(a *SexpPair, bs []Sexp) (Sexp, error) {
	result := a
	for _, b := range bs {
		res, err := ConcatTwoLists(result, b)
		if err != nil {
			return SexpNull, err
		}
		x, ok := res.(*SexpPair)
		if !ok {
			return SexpNull, NotAList
		}
		result = x
	}
	return result, nil
}
204746
func (s Int32) List() []int32 {
	res := make(sortableSliceOfInt32, 0, len(s))
	for key := range s {
		res = append(res, key)
	}
	sort.Sort(res)
	return []int32(res)
}