// Map returns the members as a map, e.g. used in api to serialize as Json.
974012
func (comp FolderCompletion) Map() map[string]interface{} {
	return map[string]interface{}{
		"completion":  comp.CompletionPct,
		"needBytes":   comp.NeedBytes,
		"needItems":   comp.NeedItems,
		"globalBytes": comp.GlobalBytes,
		"needDeletes": comp.NeedDeletes,
	}
}
347386
func (ms *MapperStruct) Map(key, val sophie.SophieWriter,
	c PartCollector) error {

	if ms.MapF != nil {
		return ms.MapF(key, val, c)
	}

	return nil
}
736934
func (point Point) Map() map[string]interface{} {
	result := make(map[string]interface{})
	result[COORDINATES] = point.Coordinates
	result[TYPE] = POINT
	return result
}
813274
func (y *Yaml) Map() (map[interface{}]interface{}, error) {
	if m, ok := (y.data).(map[interface{}]interface{}); ok {
		return m, nil
	}
	return nil, errors.New("type assertion to map[interface]interface{} failed")
}
1057950
func (r *Reply) Map() (map[string]string, error) {
	if r.IsNil() {
		return nil, ErrNil
	}
	if !r.IsArray() {
		return nil, ErrType
	}
	if len(r.arrayValue)%2 != 0 {
		return nil, ErrType
	}
	m := make(map[string]string)
	for i := 0; i < len(r.arrayValue)/2; i++ {
		first, err := r.arrayValue[2*i].String()
		if err != nil {
			continue
		}
		second, err := r.arrayValue[2*i+1].String()
		if err != nil && err != ErrNil {
			continue
		}
		m[first] = second
	}
	return m, nil
}
990383
func (oms *OnlyMapperStruct) Map(key, val sophie.SophieWriter,
	c []sophie.Collector) error {
	if oms.MapF != nil {
		return oms.MapF(key, val, c)
	}
	return nil
}
229784
func (lhu *LookupHashUnique) Map(vcursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) {
	out := make([]key.Destination, 0, len(ids))
	if lhu.writeOnly {
		for range ids {
			out = append(out, key.DestinationKeyRange{KeyRange: &topodatapb.KeyRange{}})
		}
		return out, nil
	}

	results, err := lhu.lkp.Lookup(vcursor, ids)
	if err != nil {
		return nil, err
	}
	for i, result := range results {
		switch len(result.Rows) {
		case 0:
			out = append(out, key.DestinationNone{})
		case 1:
			num, err := sqltypes.ToUint64(result.Rows[0][0])
			if err != nil {
				out = append(out, key.DestinationNone{})
				continue
			}
			out = append(out, key.DestinationKeyspaceID(vhash(num)))
		default:
			return nil, fmt.Errorf("LookupHash.Map: unexpected multiple results from vindex %s: %v", lhu.lkp.Table, ids[i])
		}
	}
	return out, nil
}
736404
func (s Seq) Map(mapfn func(i int, v float64) float64) Seq {
	output := make([]float64, s.Len())
	for i := 0; i < s.Len(); i++ {
		mapfn(i, s.GetValue(i))
	}
	return Seq{Array(output)}
}
780444
func (kinds *Kinds) Map() map[string]*Kind {
	m := make(map[string]*Kind, len(kinds.GetKind()))
	for _, k := range kinds.GetKind() {
		m[k.Name] = k
	}
	return m
}
323984
func (m Mapping) Map(r rune) (replacement []rune, ok bool) {
	rs, ok := m[r]
	if !ok {
		return nil, false
	}
	return rs, true
}
933085
func Map(path string, sz int64) ([]byte, error) {
	fi, err := os.Stat(path)
	if err != nil {
		return nil, err
	}

	// Truncate file to size if too small.
	if fi.Size() < sz {
		if err := os.Truncate(path, sz); err != nil {
			return nil, err
		}
	} else {
		sz = fi.Size()
	}
	if sz == 0 {
		return nil, nil
	}

	f, err := os.Open(path)
	if err != nil {
		return nil, err
	}
	defer f.Close()

	lo, hi := uint32(sz), uint32(sz>>32)
	fmap, err := syscall.CreateFileMapping(syscall.Handle(f.Fd()), nil, syscall.PAGE_READONLY, hi, lo, nil)
	if err != nil {
		return nil, err
	}
	defer syscall.CloseHandle(fmap)

	ptr, err := syscall.MapViewOfFile(fmap, syscall.FILE_MAP_READ, 0, 0, uintptr(sz))
	if err != nil {
		return nil, err
	}
	data := (*[1 << 30]byte)(unsafe.Pointer(ptr))[:sz]

	return data, nil
}
282944
func (mapper *Mapper) Map(tbl *lua.LTable, st interface{}) error {
	opt := mapper.Option
	mp, ok := ToGoValue(tbl, opt).(map[interface{}]interface{})
	if !ok {
		return errors.New("arguments #1 must be a table, but got an array")
	}
	config := &mapstructure.DecoderConfig{
		WeaklyTypedInput: true,
		Result:           st,
		TagName:          opt.TagName,
		ErrorUnused:      opt.ErrorUnused,
	}
	decoder, err := mapstructure.NewDecoder(config)
	if err != nil {
		return err
	}
	return decoder.Decode(mp)
}
983651
func Map(ui cli.Ui) map[string]cli.CommandFactory {
	m := make(map[string]cli.CommandFactory)
	for name, fn := range registry {
		thisFn := fn
		m[name] = func() (cli.Command, error) {
			return thisFn(ui)
		}
	}
	return m
}
1374422
func MapS(f func(string) string, sl []string) (result []string) {
	result = make([]string, len(sl))
	for i := range sl {
		result[i] = f(sl[i])
	}
	return result
}
692787
func (s *Set) Map(fn func(interface{}) interface{}) *Set {
	// Create a set to return with function applied
	mapSet := New()

	// Enumerate all elements and apply the function
	for _, e := range s.Enumerate() {
		// Apply the function, capture result
		mapSet.Add(fn(e))
	}

	return mapSet
}
501803
func (p *Partial) Map() (m map[string]*Partial, err error) {
	err = p.Unmarshal(&m)
	return
}
1101215
func (ln *LookupNonUnique) Map(vcursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) {
	out := make([]key.Destination, 0, len(ids))
	if ln.writeOnly {
		for range ids {
			out = append(out, key.DestinationKeyRange{KeyRange: &topodatapb.KeyRange{}})
		}
		return out, nil
	}

	results, err := ln.lkp.Lookup(vcursor, ids)
	if err != nil {
		return nil, err
	}
	for _, result := range results {
		if len(result.Rows) == 0 {
			out = append(out, key.DestinationNone{})
			continue
		}
		ksids := make([][]byte, 0, len(result.Rows))
		for _, row := range result.Rows {
			ksids = append(ksids, row[0].ToBytes())
		}
		out = append(out, key.DestinationKeyspaceIDs(ksids))
	}
	return out, nil
}