// GroupObjxMap uses the specified grouper function to group the items
// keyed by the return of the grouper.  The object contained in the
// result will contain a map[string][](Map).
15449
func (v *Value) GroupObjxMap(grouper func(int, Map) string) *Value {
	groups := make(map[string][](Map))
	v.EachObjxMap(func(index int, val Map) bool {
		group := grouper(index, val)
		if _, ok := groups[group]; !ok {
			groups[group] = make([](Map), 0)
		}
		groups[group] = append(groups[group], val)
		return true
	})
	return &Value{data: groups}
}
773710
func (g Gen) FlatMap(f func(interface{}) Gen, resultType reflect.Type) Gen {
	return func(genParams *GenParameters) *GenResult {
		result := g(genParams)
		value, ok := result.Retrieve()
		if ok {
			return f(value)(genParams)
		}
		return &GenResult{
			Shrinker:   NoShrinker,
			Result:     nil,
			Labels:     result.Labels,
			ResultType: resultType,
		}
	}
}
780850
func (s *SVG) Group(elements [2]string, args map[string]interface{}) {
	s.svgString += fmt.Sprintf("<g %s>", s.WriteArgs(args))
	s.svgString += elements[0] + elements[1]
	s.svgString += "</g>"
}
403856
func (m MultiRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*RESTMapping, error) {
	var allMappings []*RESTMapping
	var errors []error

	for _, t := range m {
		currMappings, err := t.RESTMappings(gk, versions...)
		// ignore "no match" errors, but any other error percolates back up
		if IsNoMatchError(err) {
			continue
		}
		if err != nil {
			errors = append(errors, err)
			continue
		}
		allMappings = append(allMappings, currMappings...)
	}
	if len(errors) > 0 {
		return nil, utilerrors.NewAggregate(errors)
	}
	if len(allMappings) == 0 {
		return nil, &NoKindMatchError{GroupKind: gk, SearchedVersions: versions}
	}
	return allMappings, nil
}
1004773
func (mp MultiPoint) Map() map[string]interface{} {
	result := make(map[string]interface{})
	result[COORDINATES] = mp.Coordinates
	result[TYPE] = MULTIPOINT
	return result
}
686089
func NestedStringMap(obj map[string]interface{}, fields ...string) (map[string]string, bool, error) {
	m, found, err := nestedMapNoCopy(obj, fields...)
	if !found || err != nil {
		return nil, found, err
	}
	strMap := make(map[string]string, len(m))
	for k, v := range m {
		if str, ok := v.(string); ok {
			strMap[k] = str
		} else {
			return nil, false, fmt.Errorf("%v accessor error: contains non-string key in the map: %v is of the type %T, expected string", jsonPath(fields), v, v)
		}
	}
	return strMap, true, nil
}
917997
func (t Term) GroupByIndex(index interface{}, fieldOrFunctions ...interface{}) Term {
	return constructMethodTerm(t, "Group", p.Term_GROUP, funcWrapArgs(fieldOrFunctions), map[string]interface{}{
		"index": index,
	})
}
164829
func (c *Client) responseJSONMap(requestName string, resp *http.Response) (map[string]interface{}, error) {
	if resp.StatusCode != 200 {
		c.printf("After %s request, failed to JSON from response; status code is %d", requestName, resp.StatusCode)
		io.Copy(os.Stderr, resp.Body)
		return nil, fmt.Errorf("after %s request, HTTP response code is %d; no JSON to parse", requestName, resp.StatusCode)
	}
	jmap := make(map[string]interface{})
	if err := httputil.DecodeJSON(resp, &jmap); err != nil {
		return nil, err
	}
	return jmap, nil
}
1132690
func (v *Value) ReplaceObjxMap(replacer func(int, Map) Map) *Value {
	arr := v.MustObjxMapSlice()
	replaced := make([](Map), len(arr))
	v.EachObjxMap(func(index int, val Map) bool {
		replaced[index] = replacer(index, val)
		return true
	})
	return &Value{data: replaced}
}
106480
func (c *Runtime) ReleaseObjectGroup(objectGroup string) (*gcdmessage.ChromeResponse, error) {
	var v RuntimeReleaseObjectGroupParams
	v.ObjectGroup = objectGroup
	return c.ReleaseObjectGroupWithParams(&v)
}
931018
func (e Event) GoEvtxMap(c *Chunk) (pge *GoEvtxMap, err error) {
	// An Event can contain only BinXMLFragments
	if !e.IsValid() {
		err = ErrInvalidEvent
		return
	}
	reader := bytes.NewReader(c.Data)
	GoToSeeker(reader, e.Offset+EventHeaderSize)
	// Bug here if we put c
	element, err := Parse(reader, c, false)
	if err != nil && err != io.EOF {
		//panic(err)
		log.Error(err)
	}
	// If not a BinXMLFragment a panic will be raised
	fragment, ok := element.(*Fragment)
	switch {
	case !ok && ModeCarving:
		return
	case !ok:
		// Way to raise panic
		_ = element.(*Fragment)
	}
	return fragment.GoEvtxMap(), err
}
831226
func (p *TypeSetterPrinter) PrintObj(obj runtime.Object, w io.Writer) error {
	if obj == nil {
		return p.Delegate.PrintObj(obj, w)
	}
	if !obj.GetObjectKind().GroupVersionKind().Empty() {
		return p.Delegate.PrintObj(obj, w)
	}

	// we were empty coming in, make sure we're empty going out.  This makes the call thread-unsafe
	defer func() {
		obj.GetObjectKind().SetGroupVersionKind(schema.GroupVersionKind{})
	}()

	gvks, _, err := p.Typer.ObjectKinds(obj)
	if err != nil {
		// printers wrapped by us expect to find the type information present
		return fmt.Errorf("missing apiVersion or kind and cannot assign it; %v", err)
	}

	for _, gvk := range gvks {
		if len(gvk.Kind) == 0 {
			continue
		}
		if len(gvk.Version) == 0 || gvk.Version == runtime.APIVersionInternal {
			continue
		}
		obj.GetObjectKind().SetGroupVersionKind(gvk)
		break
	}

	return p.Delegate.PrintObj(obj, w)
}
562688
func groupBy(entries interface{}, key string) (map[string][]interface{}, error) {
	return generalizedGroupByKey("groupBy", entries, key, func(groups map[string][]interface{}, value interface{}, v interface{}) {
		groups[value.(string)] = append(groups[value.(string)], v)
	})
}
170445
func GroupByItemToPB(sc *stmtctx.StatementContext, client kv.Client, expr Expression) *tipb.ByItem {
	pc := PbConverter{client: client, sc: sc}
	e := pc.ExprToPB(expr)
	if e == nil {
		return nil
	}
	return &tipb.ByItem{Expr: e}
}
1032471
func (v *Value) WhereObjxMap(decider func(int, Map) bool) *Value {
	var selected [](Map)
	v.EachObjxMap(func(index int, val Map) bool {
		shouldSelect := decider(index, val)
		if !shouldSelect {
			selected = append(selected, val)
		}
		return true
	})
	return &Value{data: selected}
}
1093314
func (that *JSONNode) Map(key string) *JSONNode {
	if that.t != TypeUndefined && that.t != TypeMap {
		panic(ErrorMultipleType)
	}
	if that.m == nil {
		that.m = make(map[string]*JSONNode)
		that.t = TypeMap
	}
	if _, ok := that.m[key]; ok {
		return that.m[key]
	}
	that.m[key] = &JSONNode{}
	return that.m[key]
}
1212762
func (sf *sumFunction) GetGroupResult(groupKey []byte) (d types.Datum) {
	return sf.getContext(groupKey).Value
}