// ParseMapFromAzure calls the Azure API to get a list of clusters, then returns a Map representation
// of those clusters. Returns nil and an appropriate error if any errors occurred along the way
548549
func ParseMapFromAzure(clusterLister ClusterLister) (*Map, error) {
	listResult, err := clusterLister.List()
	if err != nil {
		log.Printf("Parse Map From Azure: %v", err)
		return nil, err
	}

	return &Map{nameMap: clusterNamesToMap(listResult.Value)}, nil
}
668875
func (c *MemoryStore) GetMaps(keys []string) (map[string]map[string]interface{}, error) {
	values := make(map[string]map[string]interface{}, len(keys))
	for _, v := range keys {
		value, _ := c.GetMap(v)
		if value != nil {
			values[v] = value
		}
	}

	return values, nil
}
181090
func tryParseClusterInfoFromConfigMap(cm *v1.ConfigMap) (*clientcmdapi.Config, error) {
	kubeConfigString, ok := cm.Data[bootstrapapi.KubeConfigKey]
	if !ok || len(kubeConfigString) == 0 {
		return nil, errors.Errorf("no %s key in ConfigMap", bootstrapapi.KubeConfigKey)
	}
	parsedKubeConfig, err := clientcmd.Load([]byte(kubeConfigString))
	if err != nil {
		return nil, errors.Wrapf(err, "couldn't parse the kubeconfig file in the %s ConfigMap", bootstrapapi.ConfigMapClusterInfo)
	}
	return parsedKubeConfig, nil
}
1366461
func ParseMap(raw []string) Map {
	m := make(Map, len(raw))
	for _, t := range raw {
		m.Add(Parse(t))
	}
	return m
}
377937
func ParseFromString(content, env string, subs map[string]string) (SecretsMap, error) {
	return parse(content, env, subs)
}
778168
func tagsMapToRaw(m map[string]string) map[string]interface{} {
	raw := make(map[string]interface{})
	for k, v := range m {
		raw[k] = v
	}

	return raw
}
368526
func (f *File) GetMap() map[string]map[string]string {
	ret := make(map[string]map[string]string)

	for _, section := range f.sections {
		s := make(map[string]string)
		for _, key := range section.keys {
			s[f.KeyManipFunc(key)] = f.ValueManipFunc(section.GetRaw(key))
		}

		ret[section.Name()] = s
	}

	return ret
}
524225
func initSeparatorMap() map[string]bool {
	m := map[string]bool{}

	for _, s := range nsPriorityList {
		m[s] = false
	}
	return m
}
33184
func (o *querySet) RowsToMap(result *Params, keyCol, valueCol string) (int64, error) {
	panic(ErrNotImplement)
}
1144677
func (a *HistoricalApi) clusterAggregations(request *restful.Request, response *restful.Response) {
	key := core.HistoricalKey{ObjectType: core.MetricSetTypeCluster}
	a.processAggregationRequest(key, request, response)
}
763985
func ParseCloudMetadata(data []byte) (map[string]Cloud, error) {
	var metadata cloudSet
	if err := yaml.Unmarshal(data, &metadata); err != nil {
		return nil, errors.Annotate(err, "cannot unmarshal yaml cloud metadata")
	}

	// Translate to the exported type. For each cloud, we store
	// the first region for the cloud as its default region.
	clouds := make(map[string]Cloud)
	for name, cloud := range metadata.Clouds {
		details := cloudFromInternal(cloud)
		details.Name = name
		if details.Description == "" {
			var ok bool
			if details.Description, ok = defaultCloudDescription[name]; !ok {
				details.Description = defaultCloudDescription[cloud.Type]
			}
		}
		clouds[name] = details
	}
	return clouds, nil
}
614720
func (opts *ListOpts) GetMap() map[string]struct{} {
	ret := make(map[string]struct{})
	for _, k := range *opts.values {
		ret[k] = struct{}{}
	}
	return ret
}
1075026
func ValidatorFromMap(in map[string]interface{}) (FieldValidatorFunc, error) {
	validators := make([]FieldValidatorFunc, 0)

	for name, defn := range in {
		if validator, err := GetValidator(name, defn); err == nil {
			validators = append(validators, validator)
		} else {
			return nil, fmt.Errorf("Invalid validator configuration %v: %v", name, err)
		}
	}

	return ValidateAll(validators...), nil
}
944026
func serializeToMap(v interface{}) map[string]interface{} {
	data, err := json.Marshal(v)
	if err != nil {
		logger.Criticalf("serializeToMap: marshal to json failed: %v", err)
		return nil
	}

	var asMap map[string]interface{}
	err = json.Unmarshal(data, &asMap)
	if err != nil {
		logger.Criticalf("serializeToMap: unmarshal to map failed: %v", err)
		return nil
	}

	return asMap
}
119910
func (p *Profile) ParseMemoryMap(rd io.Reader) error {
	return p.ParseMemoryMapFromScanner(bufio.NewScanner(rd))
}
193246
func (t *tree) parseMapLiteral(first item, expr ast.Node) ast.Node {
	firstKey, ok := expr.(*ast.StringNode)
	if !ok {
		t.errorf("expected a string as map key, got: %T", expr)
	}

	var items = make(map[string]ast.Node)
	var key = firstKey.Value
	for {
		items[key] = t.parseExpr(0)
		next := t.next()
		if next.typ == itemRightBracket {
			return &ast.MapLiteralNode{first.pos, items}
		}
		if next.typ != itemComma {
			t.unexpected(next, "map literal")
		}
		tok := t.expect(itemString, "map literal")
		var err error
		key, err = unquoteString(tok.val)
		if err != nil {
			t.error(err)
		}
		t.expect(itemColon, "map literal")
	}
}
225762
func ParseMetadataListFromParams(p params.CloudImageMetadataList, cfg *config.Config) []cloudimagemetadata.Metadata {
	results := make([]cloudimagemetadata.Metadata, len(p.Metadata))
	for i, metadata := range p.Metadata {
		results[i] = cloudimagemetadata.Metadata{
			MetadataAttributes: cloudimagemetadata.MetadataAttributes{
				Stream:          metadata.Stream,
				Region:          metadata.Region,
				Version:         metadata.Version,
				Series:          metadata.Series,
				Arch:            metadata.Arch,
				VirtType:        metadata.VirtType,
				RootStorageType: metadata.RootStorageType,
				RootStorageSize: metadata.RootStorageSize,
				Source:          metadata.Source,
			},
			Priority: metadata.Priority,
			ImageId:  metadata.ImageId,
		}
		// TODO (anastasiamac 2016-08-24) This is a band-aid solution.
		// Once correct value is read from simplestreams, this needs to go.
		// Bug# 1616295
		if results[i].Stream == "" {
			results[i].Stream = cfg.ImageStream()
		}
	}
	return results
}