// Return a map filled with the relevant data.
427858
func (m *Message) toMap(pToken, rToken string) map[string]string {
	ret := map[string]string{
		"token":    pToken,
		"user":     rToken,
		"message":  m.Message,
		"priority": strconv.Itoa(m.Priority),
	}

	if m.Title != "" {
		ret["title"] = m.Title
	}

	if m.URL != "" {
		ret["url"] = m.URL
	}

	if m.URLTitle != "" {
		ret["url_title"] = m.URLTitle
	}

	if m.Sound != "" {
		ret["sound"] = m.Sound
	}

	if m.DeviceName != "" {
		ret["device"] = m.DeviceName
	}

	if m.Timestamp != 0 {
		ret["timestamp"] = strconv.FormatInt(m.Timestamp, 10)
	}

	if m.HTML {
		ret["html"] = "1"
	}

	if m.Priority == PriorityEmergency {
		ret["retry"] = strconv.FormatFloat(m.Retry.Seconds(), 'f', -1, 64)
		ret["expire"] = strconv.FormatFloat(m.Expire.Seconds(), 'f', -1, 64)
		if m.CallbackURL != "" {
			ret["callback"] = m.CallbackURL
		}
	}

	return ret
}
1123444
func Map(args ...cty.Value) (cty.Value, error) {
	return MapFunc.Call(args)
}
123131
func (t Result) Map() map[string]Result {
	if t.Type != JSON {
		return map[string]Result{}
	}
	r := t.arrayOrMap('{', false)
	return r.o
}
441124
func FormatMap(m map[string]string) string {
	keys := make([]string, 0, len(m))
	values := make([]string, 0, len(m))
	for k, v := range m {
		keys = append(keys, k)
		values = append(values, v)
	}
	return FormatOrderedMap(keys, values)
}
926417
func (v *Insanity) GetUserMap() (o map[Numberz]UserId) {
	if v != nil && v.UserMap != nil {
		return v.UserMap
	}

	return
}
1172229
func (c *xContext) MapData(i interface{}, data map[string][]string, names ...string) error {
	var name string
	if len(names) > 0 {
		name = names[0]
	}
	return NamedStructMap(c.echo, i, data, name)
}
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
}
725804
func getJsonBytesFromMap(data map[string]interface{}) ([]byte, error) {
	jsonData, err := json.Marshal(data)
	if err != nil {
		fmt.Println("Invalid data object, can't parse to json:")
		fmt.Println("Error:", err)
		fmt.Println("Data:", data)
		return nil, err
	}
	return jsonData, nil
}
1106551
func (_m Map) Fill(m Map) {
	for key, value := range _m {
		m[key] = value
	}
}
1314038
func (t *Template) Map() (map[string]interface{}, error) {
	m := map[string]interface{}{
		"$schema":        schema,
		"contentVersion": contentVersion,
		"resources":      t.Resources,
	}
	return m, nil
}
349482
func CoalesceMap(data map[string]interface{}, fieldJoiner string) (map[string]interface{}, error) {
    return deepGetValues([]string{}, fieldJoiner, data), nil
}
262522
func (mp MultiPolygon) Map() map[string]interface{} {
	result := make(map[string]interface{})
	result[COORDINATES] = mp.Coordinates
	result[TYPE] = MULTIPOLYGON
	return result
}
915198
func (m schemaMap) Data(
	s *terraform.InstanceState,
	d *terraform.InstanceDiff) (*ResourceData, error) {
	return &ResourceData{
		schema:       m,
		state:        s,
		diff:         d,
		panicOnError: m.panicOnError(),
	}, nil
}
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
}
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
}
921723
func getMap(schema proto.Schema) (*proto.Map, error) {
	if schema == nil {
		return nil, nil
	}
	visitor := &mapSchemaVisitor{}
	schema.Accept(visitor)
	return visitor.Result, visitor.Err
}
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
}