// GetMap returns a map which key is the stat name and the value is the stat
160859
func (s *regenerationStatistics) GetMap() map[string]*spanstat.SpanStat {
	result := map[string]*spanstat.SpanStat{
		"waitingForLock":         &s.waitingForLock,
		"waitingForCTClean":      &s.waitingForCTClean,
		"policyCalculation":      &s.policyCalculation,
		"proxyConfiguration":     &s.proxyConfiguration,
		"proxyPolicyCalculation": &s.proxyPolicyCalculation,
		"proxyWaitForAck":        &s.proxyWaitForAck,
		"mapSync":                &s.mapSync,
		"prepareBuild":           &s.prepareBuild,
		logfields.BuildDuration:  &s.totalTime,
	}
	for k, v := range s.datapathRealization.GetMap() {
		result[k] = v
	}
	return result
}
658985
func (c *Context) GetStringMap(key string) (sm map[string]interface{}) {
	if val, ok := c.Get(key); ok && val != nil {
		sm, _ = val.(map[string]interface{})
	}
	return
}
794380
func (vs *ValueMap) Get(k Value) Value {
	if vs != nil {
		if v, ok := vs.hashMap.Get(k); ok {
			return v.(Value)
		}
	}
	return nil
}
997797
func (c *CloudPersister) GetMap(id int64) (*models.Map, error) {
	ctx := context.Background()
	k := datastore.NewKey(ctx, "Map", "", id, nil)
	Map := &models.Map{}
	if err := c.DatastoreClient().Get(ctx, k, Map); err != nil {
		return nil, fmt.Errorf("datastoredb: could not get Map: %v", err)
	}
	Map.ID = id
	return Map, nil
}
1036003
func (v *Widget) GetColormap() *gdk.Colormap {
	return gdk.ColormapFromUnsafe(unsafe.Pointer(C.gtk_widget_get_colormap(v.GWidget)))
}
411799
func (v Values) AsMap() map[string]interface{} {
	if v == nil || len(v) == 0 {
		return map[string]interface{}{}
	}
	return v
}
404005
func updateMap(stats map[string]*protoStat.ProtoStat, stat *protoStat.ProtoStat) {
	// fmt.Println("map: ", stats)
	ck := stat.GetKey() + stat.GetIndexKey()
	oldStat, ok := stats[ck]
	if !ok {
		if stat.GetRepeat() {
			stats[ck] = stat
		} else {
			fmt.Println("Stat has not been registered! ", stat)
		}
	} else {
		v := oldStat.GetValue() + stat.GetValue()
		oldStat.Value = &v
	}
}
649513
func IntMap(src map[string]int) map[string]*int {
	dst := make(map[string]*int)
	for k, val := range src {
		v := val
		dst[k] = &v
	}
	return dst
}
613279
func (l *Language) GetStringMapString(key string) map[string]string {
	return cast.ToStringMapString(l.Get(key))
}
874974
func (r Resource) GetMap() Entry {
	mapped := make(Entry)

	var mp Entry
	// Check if payload implements Mapper interface
	if mapper, ok := r.Payload.(Mapper); ok {
		mp = mapper.GetMap()
	} else {
		mp = r.getPayloadMap()
	}

	for k, v := range mp {
		mapped[k] = v
	}

	mapped["_links"] = r.Links

	if len(r.Embedded) > 0 {
		mapped["_embedded"] = r.Embedded
	}

	return mapped
}
297687
func (c ConfigAttributes) GetStringMap(attrName string, defaultValue map[string]string) (map[string]string, error) {
	if valData, ok := c[attrName]; ok {
		result := make(map[string]string)
		switch val := valData.(type) {
		case map[string]string:
			for k, v := range val {
				result[k] = v
			}
		case map[string]interface{}:
			for k, v := range val {
				result[k] = fmt.Sprintf("%v", v)
			}
		default:
			return nil, errors.NotValidf("string map value of type %T", val)
		}
		return result, nil
	}
	return defaultValue, nil
}
245804
func bindMap(params *Params, name string, typ reflect.Type) reflect.Value {
	var (
		keyType   = typ.Key()
		valueType = typ.Elem()
		resultPtr = reflect.New(reflect.MapOf(keyType, valueType))
		result    = resultPtr.Elem()
	)
	result.Set(reflect.MakeMap(typ))
	if params.JSON != nil {
		// Try to inject the response as a json into the created result
		if err := json.Unmarshal(params.JSON, resultPtr.Interface()); err != nil {
			binderLog.Warn("bindMap: Unable to unmarshal request", "name", name, "error", err)
		}
		return result
	}

	for paramName := range params.Values {
		// The paramName string must start with the value in the "name" parameter,
		// otherwise there is no way the parameter is part of the map
		if !strings.HasPrefix(paramName, name) {
			continue
		}

		suffix := paramName[len(name)+1:]
		fieldName := nextKey(suffix)
		if fieldName != "" {
			fieldName = fieldName[:len(fieldName)-1]
		}
		if !strings.HasPrefix(paramName, name+"["+fieldName+"]") {
			continue
		}

		result.SetMapIndex(BindValue(fieldName, keyType), Bind(params, name+"["+fieldName+"]", valueType))
	}
	return result
}
1151678
func getDsMorNameMap(ctx context.Context, datastores []*DatastoreInfo) map[string]string {
	dsMorNameMap := make(map[string]string)
	for _, ds := range datastores {
		dsObjectName, err := ds.ObjectName(ctx)
		if err == nil {
			dsMorNameMap[ds.Reference().Value] = dsObjectName
		} else {
			klog.Errorf("Error occurred while getting datastore object name. err: %+v", err)
		}
	}
	return dsMorNameMap
}
352836
func GetNodeMap(nodes []v1.Node, cluster *kops.Cluster) map[string]*v1.Node {
	nodeMap := make(map[string]*v1.Node)
	for i := range nodes {
		node := &nodes[i]

		providerIDs := strings.Split(node.Spec.ProviderID, "/")
		instanceID := providerIDs[len(providerIDs)-1]
		nodeMap[instanceID] = node
	}

	return nodeMap
}
549003
func (c *Config) GetStringMapString(s string) map[string]string {
	return c.config.GetStringMapString(s)
}
623223
func Get(name string, properties []string, opts *GetOpts) (map[string]map[string]*Property, error) {
	cmd := newCmd("get", "-Hp")
	if opts == nil {
		opts = &GetOpts{}
	}

	if len(properties) == 0 {
		properties = []string{"name"}
	}
	cmd = addOpt(cmd, opts.Recurse, "-r")
	cmd = addOpt(cmd, opts.Depth != -1, "-d", fmt.Sprintf("%d", opts.Depth))
	cmd = addCommaSeparatedOption(cmd, "-t", opts.Types)
	cmd = addCommaSeparatedOption(cmd, "-s", opts.Sources)
	cmd = addCommaSeparated(cmd, properties)
	cmd = addNonEmpty(cmd, name)
	out, err := zExec(cmd)
	if err != nil {
		return nil, err
	}
	ret := make(map[string]map[string]*Property)
	for _, l := range bytes.Split(out, []byte("\n")) {
		d := strings.Split(string(l), "\t")
		if len(d) < 4 {
			continue
		}
		if _, ok := ret[d[0]]; !ok {
			ret[d[0]] = make(map[string]*Property)
		}
		ret[d[0]][d[1]] = &Property{Value: d[2], Source: d[3]}
	}
	return ret, nil
}
268401
func FromMap(m interface{}) (slice []MapItem) {
	mapValue := reflect.ValueOf(m)
	for _, key := range mapValue.MapKeys() {
		slice = append(slice, MapItem{key.Interface(), mapValue.MapIndex(key).Interface()})
	}
	return
}