// gets the input serialization opts from cli context and constructs a map of csv, json or parquet options
340174
func getInputSerializationOpts(ctx *cli.Context) map[string]map[string]string {
	icsv := ctx.String("csv-input")
	ijson := ctx.String("json-input")
	m := make(map[string]map[string]string)

	csvType := ctx.IsSet("csv-input")
	jsonType := ctx.IsSet("json-input")
	if csvType && jsonType {
		fatalIf(errInvalidArgument(), "Only one of --csv-input or --json-input can be specified as input serialization option")
	}

	if icsv != "" {
		kv, err := parseSerializationOpts(icsv, append(validCSVCommonKeys, validCSVInputKeys...), validCSVInputAbbrKeys)
		fatalIf(err, "Invalid serialization option(s) specified for --csv-input flag")

		m["csv"] = kv
	}
	if ijson != "" {
		kv, err := parseSerializationOpts(ijson, validJSONInputKeys, nil)

		fatalIf(err, "Invalid serialization option(s) specified for --json-input flag")
		m["json"] = kv
	}

	return m
}
269809
func (o *LocaleOptions) getParameters() (params map[string]string, err error) {
	params = make(map[string]string)
	if o.cc != "" {
		params["cc"] = o.cc
	}
	if o.lang != "" {
		params["lang"] = o.lang
	}
	return params, nil
}
485324
func (s Serializers) Serialize(key string, obj interface{}, options ...map[string]interface{}) ([]byte, error) {
	if key == "" {
		return nil, errKeyMissing
	}
	if s == nil {
		return nil, errSerializersEmpty
	}

	serializers := s[key]
	if serializers == nil {
		return nil, errSerializerNotFound.Format(key)
	}
	var finalResult []byte

	for i, n := 0, len(serializers); i < n; i++ {
		result, err := serializers[i].Serialize(obj, options...)
		if err != nil {
			return nil, err
		}
		finalResult = append(finalResult, result...)
	}
	return finalResult, nil
}
1248028
func (s *RedisMapStore) GetFields(key string, fields ...string) (interface{}, error) {
	if !strings.HasPrefix(key, s.prefix) {
		key = s.prefix + key
	}
	result, err := s.client.HMGet(key, fields...).Result()
	if err == redis.Nil {
		return nil, errors.NewErrNotFound(key)
	}
	if err != nil {
		return nil, err
	}
	res := make(map[string]string)
	for i, field := range fields {
		if str, ok := result[i].(string); ok {
			res[field] = str
		}
	}
	i, err := s.decoder(res)
	if err != nil {
		return nil, err
	}
	return i, nil
}
1190574
func (p Property) GetJSONPrimitiveType() string {

	if p.IsPrimitive() {
		return convertTypeToJSON(p.PrimitiveType)
	}

	if p.IsMap() && p.IsMapOfPrimitives() {
		return convertTypeToJSON(p.PrimitiveItemType)
	}

	if p.IsList() && p.IsListOfPrimitives() {
		return convertTypeToJSON(p.PrimitiveItemType)
	}

	return "unknown"

}
1353620
func Get(name string, options map[string]interface{}, storageDriver storagedriver.StorageDriver) (storagedriver.StorageDriver, error) {
	if storageMiddlewares != nil {
		if initFunc, exists := storageMiddlewares[name]; exists {
			return initFunc(storageDriver, options)
		}
	}

	return nil, fmt.Errorf("no storage middleware registered with name: %s", name)
}
533789
func UnitSerialize(opts []*unit.UnitOption) io.Reader {
	var buf bytes.Buffer

	if len(opts) == 0 {
		return &buf
	}

	idx := map[string][]*unit.UnitOption{}
	for _, opt := range opts {
		idx[opt.Section] = append(idx[opt.Section], opt)
	}

	// CHANGED HERE: Output in the following order:
	// - Unit
	// - Service
	// - Install
	// rather than just iterating over the map in random order.
	for _, curSection := range []string{"Unit", "Service", "Install"} {
		curOpts, found := idx[curSection]
		if !found {
			continue
		}
		writeSectionHeader(&buf, curSection)
		writeNewline(&buf)

		for _, opt := range curOpts {
			writeOption(&buf, opt)
			writeNewline(&buf)
		}
		writeNewline(&buf)
	}

	return &buf
}
708566
func (s *SpanStat) GetMap() map[string]*spanstat.SpanStat {
	return map[string]*spanstat.SpanStat{
		"bpfCompilation": &s.bpfCompilation,
		"bpfWaitForELF":  &s.bpfWaitForELF,
		"bpfWriteELF":    &s.bpfWriteELF,
		"bpfLoadProg":    &s.bpfLoadProg,
	}
}
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
}
884657
func getKeySet(list reflect.Value) map[string]struct{} {
	m := map[string]struct{}{}
	for i := 0; i < list.Len(); i++ {
		m[util.CallKey(list.Index(i))] = struct{}{}
	}
	return m
}
915623
func (reader *PluginConfigReader) GetStreamMap(key string, defaultValue string) map[MessageStreamID]string {
	value, err := reader.WithError.GetStreamMap(key, defaultValue)
	reader.Errors.Push(err)
	return value
}
11992
func (s Serializers) SerializeToString(key string, obj interface{}, options ...map[string]interface{}) (string, error) {
	result, err := s.Serialize(key, obj, options...)
	if err != nil {
		return "", err
	}

	return string(result), nil
}
531019
func (confSrc *CommandLineConfigurationSource) GetConfigurations() (map[string]interface{}, error) {
	configMap := make(map[string]interface{})

	confSrc.Lock()
	defer confSrc.Unlock()
	for key, value := range confSrc.Configurations {
		configMap[key] = value
	}

	return configMap, nil
}
355619
func Curl(cli plugin.CliConnection, path string) (map[string]interface{}, error) {
	output, err := cli.CliCommandWithoutTerminalOutput("curl", path)

	if nil != err {
		return nil, err
	}

	return parseOutput(output)
}
349703
func Serialize(key string, obj interface{}, options ...map[string]interface{}) ([]byte, error) {
	// only to the default serializer, check if no of the built'n serializer's key are registered, if not register them here
	// I don't put it to the initialize of the defaultSerializers because the developer may don't want the built'n serializers at all
	once.Do(func() {
		RegisterDefaults(defaultSerializers)
	})

	return defaultSerializers.Serialize(key, obj, options...)
}
1294321
func (v *NestedMixedx2) GetMapIntStrset() (o map[int32]map[string]struct{}) {
	if v != nil && v.MapIntStrset != nil {
		return v.MapIntStrset
	}

	return
}
670038
func MapsGet(xu *xgbutil.XUtil) (*xproto.GetKeyboardMappingReply,
	*xproto.GetModifierMappingReply) {

	min, max := minMaxKeycodeGet(xu)
	newKeymap, keyErr := xproto.GetKeyboardMapping(xu.Conn(), min,
		byte(max-min+1)).Reply()
	newModmap, modErr := xproto.GetModifierMapping(xu.Conn()).Reply()

	// If there are errors, we really need to panic. We just can't do
	// any key binding without a mapping from the server.
	if keyErr != nil {
		panic(fmt.Sprintf("COULD NOT GET KEYBOARD MAPPING: %v\n"+
			"THIS IS AN UNRECOVERABLE ERROR.\n",
			keyErr))
	}
	if modErr != nil {
		panic(fmt.Sprintf("COULD NOT GET MODIFIER MAPPING: %v\n"+
			"THIS IS AN UNRECOVERABLE ERROR.\n",
			keyErr))
	}

	return newKeymap, newModmap
}