// WithDigest combines the name from "name" and the digest from "digest" to form
// a reference incorporating both the name and the digest.
969707
func WithDigest(name Named, digest digest.Digest) (Canonical, error) {
	r, err := reference.WithDigest(name, digest)
	if err != nil {
		return nil, err
	}
	return &canonicalRef{namedRef{r}}, nil
}
783807
func WithGitInit(ctx context.Context, bv bool) context.Context {
	return context.WithValue(ctx, ctxKeyGitInit, bv)
}
1144076
func WithToken(ctx context.Context, token *AuthorizationToken) context.Context {
	return context.WithValue(ctx, tokenIndex, token)
}
1109131
func (c *Ctx) DigestInit(sh SessionHandle, m []*Mechanism) error {
	arena, mech := cMechanism(m)
	defer arena.Free()
	e := C.DigestInit(c.ctx, C.CK_SESSION_HANDLE(sh), mech)
	return toError(e)
}
1160177
func (a *accessToken) WithScope(scope string) Strategy {
	return &accessToken{
		accessToken: a.accessToken,
		manager:     a.manager,
		scope:       scope,
	}
}
1213803
func (e *ClientExecutor) WithName(name string) *ClientExecutor {
	if e.Named == nil {
		e.Named = make(map[string]*ClientExecutor)
		e.Deferred = append([]func() error{func() error {
			var errs []error
			for _, named := range e.Named {
				errs = append(errs, named.Release()...)
			}
			if len(errs) > 0 {
				return fmt.Errorf("%v", errs)
			}
			return nil
		}}, e.Deferred...)
	}

	copied := *e
	copied.Name = name
	copied.Container = nil
	copied.Deferred = nil
	copied.Image = nil
	copied.Volumes = nil

	child := &copied
	e.Named[name] = child
	return child
}
175959
func (p *pullMediatorImpl) SendDigest(digest []string, nonce uint64, context interface{}) {
	digMsg := &proto.GossipMessage{
		Channel: p.config.Channel,
		Tag:     p.config.Tag,
		Nonce:   0,
		Content: &proto.GossipMessage_DataDig{
			DataDig: &proto.DataDigest{
				MsgType: p.config.MsgType,
				Nonce:   nonce,
				Digests: util.StringsToBytes(digest),
			},
		},
	}
	remotePeer := context.(proto.ReceivedMessage).GetConnectionInfo()
	if p.logger.IsEnabledFor(zapcore.DebugLevel) {
		p.logger.Debug("Sending", p.config.MsgType, "digest:", digMsg.GetDataDig().FormattedDigests(), "to", remotePeer)
	}

	context.(proto.ReceivedMessage).Respond(digMsg)
}
1195131
func ParseAnyReferenceWithSet(ref string, ds *digestset.Set) (Reference, error) {
	if ok := anchoredShortIdentifierRegexp.MatchString(ref); ok {
		dgst, err := ds.Lookup(ref)
		if err == nil {
			return digestReference(dgst), nil
		}
	} else {
		if dgst, err := digest.Parse(ref); err == nil {
			return digestReference(dgst), nil
		}
	}

	return ParseNormalizedNamed(ref)
}
377817
func WithName(s string) source.Option {
	return func(o *source.Options) {
		if o.Context == nil {
			o.Context = context.Background()
		}
		o.Context = context.WithValue(o.Context, nameKey{}, s)
	}
}
102674
func WithServerName(serverName string) Option {
	return func(p *Peer) error {
		p.serverName = serverName

		return nil
	}
}
519495
func (c *Counter) With(labelValues ...string) metrics.Counter {
	return &Counter{
		Name: c.Name,
		bits: atomic.LoadUint64(&c.bits),
		lvs:  c.lvs.With(labelValues...),
	}
}
517683
func (s PluginMetaSet) WithName(name string) PluginMetaSet {
	ns := make(PluginMetaSet)
	for p := range s {
		if p.Name == name {
			ns.Add(p)
		}
	}
	return ns
}
45889
func (client *Client) WithAccessKeyId(id string) *Client {
	client.SetAccessKeyId(id)
	return client
}
887642
func (r *DB) With(ctx context.Context) *DB {
	return &DB{
		r.DB,
		ctx,
		r.inTx,
		r.Tx,
		r.TxOpts,
		r.Profiler,
	}
}
255849
func (o *PlaceOrderOK) WithPayload(payload *models.Order) *PlaceOrderOK {
	o.Payload = payload
	return o
}
1312465
func (s *LayerFailure) SetLayerDigest(v string) *LayerFailure {
	s.LayerDigest = &v
	return s
}
923922
func (a *Account) WithHeader(name, value string) *Account {
	a.headers[name] = value
	return a
}