// ExtractResponseFields returns the first found ResponseFieldsOption from the
// given variadic arguments or nil otherwise.
503384
func ExtractResponseFields(opts ...interface{}) *opt.ResponseFieldsOption {
	for _, o := range opts {
		if v, ok := o.(*opt.ResponseFieldsOption); ok {
			return v
		}
	}
	return nil
}
592614
func (pb *pointBuilder) extractFields(mbean string, value interface{}) map[string]interface{} {
	fieldMap := make(map[string]interface{})
	valueMap, ok := value.(map[string]interface{})

	if ok {
		// complex value
		if len(pb.objectAttributes) == 0 {
			// if there were no attributes requested,
			// then the keys are attributes
			pb.fillFields("", valueMap, fieldMap)

		} else if len(pb.objectAttributes) == 1 {
			// if there was a single attribute requested,
			// then the keys are the attribute's properties
			fieldName := pb.formatFieldName(pb.objectAttributes[0], pb.objectPath)
			pb.fillFields(fieldName, valueMap, fieldMap)

		} else {
			// if there were multiple attributes requested,
			// then the keys are the attribute names
			for _, attribute := range pb.objectAttributes {
				fieldName := pb.formatFieldName(attribute, pb.objectPath)
				pb.fillFields(fieldName, valueMap[attribute], fieldMap)
			}
		}
	} else {
		// scalar value
		var fieldName string
		if len(pb.objectAttributes) == 0 {
			fieldName = pb.formatFieldName(defaultFieldName, pb.objectPath)
		} else {
			fieldName = pb.formatFieldName(pb.objectAttributes[0], pb.objectPath)
		}

		pb.fillFields(fieldName, value, fieldMap)
	}

	if len(pb.substitutions) > 1 {
		pb.applySubstitutions(mbean, fieldMap)
	}

	return fieldMap
}
499161
func parseFieldTags(f reflect.StructField) fieldTags {
	var ret fieldTags

	for i, s := range strings.Split(f.Tag.Get("json"), ",") {
		switch {
		case i == 0 && s == "-":
			ret.omit = true
		case i == 0:
			ret.name = s
		case s == "omitempty":
			ret.omitEmpty = true
		case s == "!omitempty":
			ret.noOmitEmpty = true
		case s == "string":
			ret.asString = true
		case s == "required":
			ret.required = true
		}
	}

	return ret
}
888829
func (p *testSuiteDataParser) ExtractProperties(line string) (map[string]string, bool) {
	// `os::cmd` suites cannot expose properties
	return map[string]string{}, false
}
1222251
func (s *session) GetFields(table Table, fields ...string) (bool, error) {
	action, ok, err := s.get(table, getOptions{}, fields...)
	if err != nil {
		return ok, s.catch("Get: "+action, err)
	}
	return ok, nil
}
525515
func ExtractReplicas(opts ...interface{}) *opt.ReplicasOption {
	for _, o := range opts {
		if v, ok := o.(*opt.ReplicasOption); ok {
			return v
		}
	}
	return nil
}
169686
func (sq *Subquery) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error) {
	inner, err := sq.Subquery.GetFields(vcursor, bindVars)
	if err != nil {
		return nil, err
	}
	return &sqltypes.Result{Fields: sq.buildFields(inner)}, nil
}
1103550
func (r *RangeOp) Fields(fields []string) *RangeOp {
	r.fieldsToRead = fields
	return r
}
705702
func getSQLFields(s DBModel) (ret []string) {
	fields := getFields(s)
	table := handleIdentifier(s.TableName())
	for _, field := range fields {
		ret = append(ret, table+"."+getColumnName(field))
	}
	return
}
438238
func ExtractVariables(configDict map[string]interface{}, pattern *regexp.Regexp) map[string]string {
	if pattern == nil {
		pattern = defaultPattern
	}
	return recurseExtract(configDict, pattern)
}
536552
func (s *IndicesStatsService) Fields(fields ...string) *IndicesStatsService {
	s.fields = append(s.fields, fields...)
	return s
}
1210299
func (s *TermvectorsService) Fields(fields ...string) *TermvectorsService {
	if s.fields == nil {
		s.fields = make([]string, 0)
	}
	s.fields = append(s.fields, fields...)
	return s
}
629894
func (c *Config) GetFields() []string {
	var names []string
	for k := range c.fields.dict() {
		names = append(names, k)
	}
	return names
}
962698
func ExtractFacetFilters(opts ...interface{}) *opt.FacetFiltersOption {
	for _, o := range opts {
		if v, ok := o.(*opt.FacetFiltersOption); ok {
			return v
		}
	}
	return nil
}
426248
func ExtractOptionalFilters(opts ...interface{}) *opt.OptionalFiltersOption {
	for _, o := range opts {
		if v, ok := o.(*opt.OptionalFiltersOption); ok {
			return v
		}
	}
	return nil
}
1142655
func extractParams(p url.Values) Params {
	params := Params{}
	for k, l := range p {
		for _, v := range l {
			params[k] = v
		}
	}
	return params
}
546072
func (r RouterJSR311) ExtractParameters(route *Route, webService *WebService, urlPath string) map[string]string {
	webServiceExpr := webService.pathExpr
	webServiceMatches := webServiceExpr.Matcher.FindStringSubmatch(urlPath)
	pathParameters := r.extractParams(webServiceExpr, webServiceMatches)
	routeExpr := route.pathExpr
	routeMatches := routeExpr.Matcher.FindStringSubmatch(webServiceMatches[len(webServiceMatches)-1])
	routeParams := r.extractParams(routeExpr, routeMatches)
	for key, value := range routeParams {
		pathParameters[key] = value
	}
	return pathParameters
}