// Map returns map[string]interface{} value and stores an error.
514006
func (d *Drain) Map(p Proxy) map[string]interface{} {
	v, err := p.Map()
	d.put(err)
	return v
}
1355892
func (*Numeric) Map(cursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) {
	out := make([]key.Destination, 0, len(ids))
	for _, id := range ids {
		num, err := sqltypes.ToUint64(id)
		if err != nil {
			out = append(out, key.DestinationNone{})
			continue
		}
		var keybytes [8]byte
		binary.BigEndian.PutUint64(keybytes[:], num)
		out = append(out, key.DestinationKeyspaceID(keybytes[:]))
	}
	return out, nil
}
922358
func (w *MapFieldWriter) Map() map[string]string {
	w.lock.Lock()
	defer w.lock.Unlock()
	if w.result == nil {
		w.result = make(map[string]string)
	}

	return w.result
}
781550
func (args Args) Map() map[string]interface{} {
	m := make(map[string]interface{})
	for _, arg := range args {
		m[arg.Name] = arg.Value
	}
	return m
}
1299039
func (mapOp *MapOperation) Map(key string) *MapOperation {
	if mapOp.removeMaps != nil {
		delete(mapOp.removeMaps, key)
	}
	if mapOp.maps == nil {
		mapOp.maps = make(map[string]*MapOperation)
	}

	innerMapOp, ok := mapOp.maps[key]
	if ok {
		return innerMapOp
	}

	innerMapOp = &MapOperation{}
	mapOp.maps[key] = innerMapOp
	return innerMapOp
}
648027
func (gr *GenericRecord) Map() map[string]interface{} {
	m := make(map[string]interface{})
	for k, v := range gr.fields {
		if r, ok := v.(*GenericRecord); ok {
			v = r.Map()
		}
		if a, ok := v.([]interface{}); ok {
			slice := make([]interface{}, len(a))
			for i, elem := range a {
				if rec, ok := elem.(*GenericRecord); ok {
					elem = rec.Map()
				}
				slice[i] = elem
			}
			v = slice
		}
		m[k] = v
	}
	return m
}
676470
func Map(array []interface{}, iterator ResultIterator) []interface{} {
	var result = make([]interface{}, len(array))
	for index, data := range array {
		result[index] = iterator(data, index)
	}
	return result
}
442242
func Map(q Q, f func(q Q) Q) Q {
	switch s := q.(type) {
	case *And:
		q = &And{Children: mapQueryList(s.Children, f)}
	case *Or:
		q = &Or{Children: mapQueryList(s.Children, f)}
	case *Not:
		q = &Not{Child: Map(s.Child, f)}
	}
	return f(q)
}
617082
func (s Shrink) Map(f interface{}) Shrink {
	mapperVal := reflect.ValueOf(f)
	mapperType := mapperVal.Type()

	if mapperVal.Kind() != reflect.Func {
		panic(fmt.Sprintf("Param of Map has to be a func, but is %v", mapperType.Kind()))
	}
	if mapperType.NumIn() != 1 {
		panic(fmt.Sprintf("Param of Map has to be a func with one param, but is %v", mapperType.NumIn()))
	}
	if mapperType.NumOut() != 1 {
		panic(fmt.Sprintf("Param of Map has to be a func with one return value, but is %v", mapperType.NumOut()))
	}

	return func() (interface{}, bool) {
		value, ok := s()
		if ok {
			return mapperVal.Call([]reflect.Value{reflect.ValueOf(value)})[0].Interface(), ok
		}
		return nil, false
	}
}
82145
func (i *ImageService) Map() map[image.ID]*image.Image {
	return i.imageStore.Map()
}
1004773
func (mp MultiPoint) Map() map[string]interface{} {
	result := make(map[string]interface{})
	result[COORDINATES] = mp.Coordinates
	result[TYPE] = MULTIPOINT
	return result
}
1287876
func (r *Request) Map(fn MapRequestFunc) *Request {
	r.Mappers = append(r.Mappers, fn)
	return r
}
1140081
func (domain *TypedDataDomain) Map() map[string]interface{} {
	dataMap := map[string]interface{}{}

	if domain.ChainId != nil {
		dataMap["chainId"] = domain.ChainId
	}

	if len(domain.Name) > 0 {
		dataMap["name"] = domain.Name
	}

	if len(domain.Version) > 0 {
		dataMap["version"] = domain.Version
	}

	if len(domain.VerifyingContract) > 0 {
		dataMap["verifyingContract"] = domain.VerifyingContract
	}

	if len(domain.Salt) > 0 {
		dataMap["salt"] = domain.Salt
	}
	return dataMap
}
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
}
1074949
func Context(err error) map[string]interface{} {
	if e, ok := err.(withContext); ok {
		return e.Context()
	}
	return nil
}
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
}
557264
func (gc GeometryCollection) Map() map[string]interface{} {
	result := make(map[string]interface{})
	geometries := make([]map[string]interface{}, len(gc.Geometries))
	for inx, geometry := range gc.Geometries {
		switch gt := geometry.(type) {
		case map[string]interface{}:
			geometries[inx] = gt
		case Mapper:
			geometries[inx] = gt.Map()
		}
	}
	result[GEOMETRIES] = geometries
	result[TYPE] = GEOMETRYCOLLECTION
	return result
}