// make a new context; inheret c.Namers, but add on 'namers'. In case of a name
// collision, the namer in 'namers' wins.
177601
func (c *Context) addNameSystems(namers namer.NameSystems) *Context {
	if namers == nil {
		return c
	}
	c2 := *c
	// Copy the existing name systems so we don't corrupt a parent context
	c2.Namers = namer.NameSystems{}
	for k, v := range c.Namers {
		c2.Namers[k] = v
	}

	for name, namer := range namers {
		c2.Namers[name] = namer
	}
	return &c2
}
918347
func NewContextWith(data map[string]interface{}) *Context {
	c := NewContext()
	c.data = data
	return c
}
452580
func Namespace(c context.Context, namespace string) (context.Context, error) {
	if !validNamespace.MatchString(namespace) {
		return nil, fmt.Errorf("appengine: namespace %q does not match /%s/", namespace, validNamespace)
	}
	n := &namespacedContext{
		ctx:       c,
		namespace: namespace,
	}
	return internal.WithNamespace(internal.WithCallOverride(c, n.call), namespace), nil
}
460994
func Context(err error) []interface{} {
	type contextor interface {
		Context() []interface{}
	}

	var kvs []interface{}

	ForEachCause(err, func(err error) bool {
		if cerr, ok := err.(contextor); ok {
			kvs = append(cerr.Context(), kvs...)
		}

		return true
	})

	return kvs
}
156090
func (c *PutCall) Context(ctx context.Context) *PutCall {
	c.ctx_ = ctx
	return c
}
704339
func (f *BuildSource) Context() string {
	if f.BuildSourceName != "" {
		return fmt.Sprintf("BuildSource %#v", f.BuildSourceName)
	}
	return "unnamed BuildSource"
}
53249
func nameSet(names []string) map[string]bool {
	set := make(map[string]bool)
	for _, name := range names {
		set[name] = true
	}
	return set
}
286522
func (ns *NamedStopwatch) add(name string) error {
	if ns.stopwatches == nil {
		// create structure
		ns.stopwatches = make(map[string](*Stopwatch))
	} else {
		// check for existing name
		if _, ok := ns.stopwatches[name]; ok {
			return fmt.Errorf("NamedStopwatch.add() Stopwatch name %q already exists", name)
		}
	}
	ns.stopwatches[name] = New(nil)

	return nil
}
747754
func NewContextMux() *ContextMux {
	mux := New()
	cg := mux.UsingContext()

	return &ContextMux{
		TreeMux:      mux,
		ContextGroup: cg,
	}
}
761356
func (api *Client) RenameChannelContext(ctx context.Context, channelID, name string) (*Channel, error) {
	values := url.Values{
		"token":   {api.token},
		"channel": {channelID},
		"name":    {name},
	}

	// XXX: the created entry in this call returns a string instead of a number
	// so I may have to do some workaround to solve it.
	response, err := api.channelRequest(ctx, "channels.rename", values)
	if err != nil {
		return nil, err
	}
	return &response.Channel, nil
}
883144
func FromContext(c context.Context) *Goon {
	return &Goon{
		Context:          c,
		cache:            make(map[string]interface{}),
		KindNameResolver: DefaultKindName,
	}
}
1061097
func (c *ResetCall) Context(ctx context.Context) *ResetCall {
	c.ctx_ = ctx
	return c
}
1361047
func (c *GroupUpdateCall) Context(ctx context.Context) *GroupUpdateCall {
	c.ctx_ = ctx
	return c
}
492087
func NewContext() (retVal *Context) {
	var internal C.cudnnHandle_t
	if err := result(C.cudnnCreate(&internal)); err != nil {
		panic(err)
	}
	retVal = &Context{internal}
	return retVal
}
387979
func NewContextWithHeaders(ctx context.Context, header http.Header) context.Context {
	if ctx == nil {
		ctx = context.Background()
	}
	return context.WithValue(ctx, requestHeaderKey, header)
}
721029
func NewContext(app *App, set *flag.FlagSet, globalSet *flag.FlagSet) *Context {
	return &Context{App: app, flagSet: set, globalSet: globalSet}
}
1118461
func NewContext(res http.ResponseWriter, req *http.Request, handlers ...Handler) *Context {
	c := &Context{handlers: handlers}
	c.init(res, req)
	return c
}