// GetFilterArray returns an array of filter plugins.
975990
func (reader PluginConfigReaderWithError) GetFilterArray(key string, logger logrus.FieldLogger,
	defaultValue FilterArray) (FilterArray, error) {
	filters := []Filter{}

	modPlugins, err := reader.GetPluginArray(key, []Plugin{})
	if err != nil {
		return filters, err
	}
	if len(modPlugins) == 0 {
		return filters, nil
	}

	errors := tgo.NewErrorStack()
	errors.SetFormat(tgo.ErrorStackFormatCSV)

	for _, plugin := range modPlugins {
		if filter, isFilter := plugin.(Filter); isFilter {
			filters = append(filters, filter)
		} else {
			errors.Pushf("Plugin '%T' is not a valid filter", plugin)
			panic(errors.Top())
		}
	}

	return filters, errors.OrNil()
}
174996
func GetByFilters(skip int, filters ...Filter) (callinfo CallInfo, ok bool) {
	filters = append(FilterCommons, filters...)
	for {
		skip++

		if callinfo, ok = retrieveCallInfo(skip); !ok {
			return
		}

		valid, stop := filterAll(callinfo, filters...)
		if valid {
			return callinfo, true
		}
		if stop {
			return callinfo, false
		}
	}
}
1192578
func (r Network_Storage) GetAllFilesByFilter(filter *datatypes.Container_Utility_File_Entity) (resp []datatypes.Container_Utility_File_Entity, err error) {
	params := []interface{}{
		filter,
	}
	err = r.Session.DoRequest("SoftLayer_Network_Storage", "getAllFilesByFilter", params, &r.Options, &resp)
	return
}
1085055
func (reader PluginConfigReaderWithError) GetModulatorArray(key string, logger logrus.FieldLogger,
	defaultValue ModulatorArray) (ModulatorArray, error) {
	modulators := []Modulator{}

	modPlugins, err := reader.GetPluginArray(key, []Plugin{})
	if err != nil {
		return modulators, err
	}
	if len(modPlugins) == 0 {
		return modulators, nil
	}

	errors := tgo.NewErrorStack()
	errors.SetFormat(tgo.ErrorStackFormatCSV)

	for _, plugin := range modPlugins {
		if filter, isFilter := plugin.(Filter); isFilter {
			filterModulator := NewFilterModulator(filter)
			modulators = append(modulators, filterModulator)
		} else if formatter, isFormatter := plugin.(Formatter); isFormatter {
			formatterModulator := NewFormatterModulator(formatter)
			modulators = append(modulators, formatterModulator)
		} else if modulator, isModulator := plugin.(Modulator); isModulator {
			if modulator, isScopedModulator := plugin.(ScopedModulator); isScopedModulator {
				modulator.SetLogger(logger)
			}
			modulators = append(modulators, modulator)
		} else {
			errors.Pushf("Plugin '%T' is not a valid modulator", plugin)
			panic(errors.Top())
		}
	}

	return modulators, errors.OrNil()
}
837553
func ExtractTagFilters(opts ...interface{}) *opt.TagFiltersOption {
	for _, o := range opts {
		if v, ok := o.(*opt.TagFiltersOption); ok {
			return v
		}
	}
	return nil
}
121453
func (reader *PluginConfigReader) GetFormatterArray(key string, logger logrus.FieldLogger, defaultValue FormatterArray) FormatterArray {
	formatter, err := reader.WithError.GetFormatterArray(key, logger, defaultValue)
	reader.Errors.Push(err)
	return formatter
}
319715
func filterParams(pattern *regexp.Regexp, values map[string][]string) map[string][]string {
	for key := range values {
		if pattern.Match([]byte(key)) {
			values[key] = []string{FILTERED}
		}
	}

	return values
}
579666
func (reader PluginConfigReaderWithError) GetArray(key string, defaultValue []interface{}) ([]interface{}, error) {
	key = reader.config.registerKey(key)
	if reader.HasValue(key) {
		return reader.config.Settings.Array(key)
	}
	return defaultValue, nil
}
556001
func filterParams(values map[string][]string) map[string][]string {
	for key := range values {
		if FilterFields.Match([]byte(key)) {
			values[key] = []string{FILTERED}
		}
	}

	return values
}
346132
func ExtractFilters(opts ...interface{}) *opt.FiltersOption {
	for _, o := range opts {
		if v, ok := o.(*opt.FiltersOption); ok {
			return v
		}
	}
	return nil
}
959679
func (fm *filterManager) FilterByIndex(index int) Filter {
	fm.fmLocker.RLock()
	defer fm.fmLocker.RUnlock()
	n := len(fm.filters)
	if index < 0 && index >= n {
		return nil
	}
	return fm.filters[index]
}
1363106
func (j *Jenkins) GetPlugins(depth int) (*Plugins, error) {
	p := Plugins{Jenkins: j, Raw: new(PluginResponse), Base: "/pluginManager", Depth: depth}
	_, err := p.Poll()
	if err != nil {
		return nil, err
	}
	return &p, nil
}
542569
func (client *Client) GetEvents(filters ...Filter) ([]Event, Warnings, error) {
	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.GetEventsRequest,
		Query:       ConvertFilterParameters(filters),
	})
	if err != nil {
		return nil, nil, err
	}

	var fullEventsList []Event
	warnings, err := client.paginate(request, Event{}, func(item interface{}) error {
		if event, ok := item.(Event); ok {
			fullEventsList = append(fullEventsList, event)
		} else {
			return ccerror.UnknownObjectInListError{
				Expected:   Event{},
				Unexpected: item,
			}
		}
		return nil
	})

	return fullEventsList, warnings, err
}
196683
func (c *Cache) FilteredList(filter algorithm.PodFilter, selector labels.Selector) ([]*v1.Pod, error) {
	return nil, nil
}
570766
func (reader PluginConfigReaderWithError) GetPluginArray(key string, defaultValue []Plugin) ([]Plugin, error) {
	key = reader.config.registerKey(key)
	namedConfigs, err := reader.GetArray(key, []interface{}{})
	if err != nil {
		return defaultValue, err
	}

	if len(namedConfigs) == 0 {
		return defaultValue, nil
	}

	pluginArray := make([]Plugin, 0, len(namedConfigs))

	// Iterate over all entries in the array.
	// An entry can either be a string or a string -> map[string]interface{}
	for _, typedConfigInterface := range namedConfigs {
		typedConfigMap := tcontainer.TryConvertToMarshalMap(typedConfigInterface, nil)
		typedConfig, isMap := typedConfigMap.(tcontainer.MarshalMap)

		if !isMap {
			typeNameStr, isString := typedConfigInterface.(string)
			if !isString {
				return nil, fmt.Errorf("%s section is malformed (entry does not contain a config)", key)
			}

			// Only string given, initialize with empty config
			pluginConfig, _ := NewNestedPluginConfig(typeNameStr, tcontainer.NewMarshalMap())
			plugin, err := NewPluginWithConfig(pluginConfig)
			if err != nil {
				return nil, err
			}
			pluginArray = append(pluginArray, plugin)
		}

		// string -> map[string]interface{}
		// This is actually a map with just one entry
		for typename, config := range typedConfig {
			configMap, err := tcontainer.ConvertToMarshalMap(config, nil)
			if err != nil {
				return nil, fmt.Errorf("%s section is malformed (config for %s is not a map but %T)", key, typename, config)
			}

			pluginConfig, _ := NewNestedPluginConfig(typename, configMap)
			plugin, err := NewPluginWithConfig(pluginConfig)
			if err != nil {
				return pluginArray, err
			}
			pluginArray = append(pluginArray, plugin)
		}
	}

	return pluginArray, nil
}
540356
func (whisper *Whisper) GetFilter(id string) *Filter {
	return whisper.filters.Get(id)
}
741792
func (env *Environment) GetArray(key string, overrideDefault *[]string) ([]string, error) {
	var oD *string
	if overrideDefault != nil {
		if len(*overrideDefault) > 0 {
			ovr := (*overrideDefault)[0]
			oD = &ovr
		}
	}
	v, e := env.Get(key, oD)
	arr := []string{v}

	if env.supportArrays {
		if strings.Contains(v, ",") {
			arr = strings.Split(v, ",")
		}
	}

	if len(v) > 0 {
		return arr, e
	}
	return []string{}, e
}