// WithW sets the number of nodes that must report back a successful write in order for the
// command operation to be considered a success by Riak.
//
// See http://basho.com/posts/technical/riaks-config-behaviors-part-2/
558141
func (builder *StoreBucketTypePropsCommandBuilder) WithW(w uint32) *StoreBucketTypePropsCommandBuilder {
	builder.props.W = &w
	return builder
}
370484
func (b *UpdatesQueryBuilder) WriteRow(buffer *bytes.Buffer, row []sqltypes.Value) {
	// Example: msg='a' WHERE id=0 AND sub_id=10
	nonPrimaryOffset := len(b.td.PrimaryKeyColumns)
	for i, column := range b.nonPrimaryKeyColumns {
		if i > 0 {
			buffer.WriteByte(',')
		}
		sqlescape.WriteEscapeID(buffer, column)
		buffer.WriteByte('=')
		row[nonPrimaryOffset+i].EncodeSQL(buffer)
	}
	buffer.WriteString(" WHERE ")
	for i, pkColumn := range b.td.PrimaryKeyColumns {
		if i > 0 {
			buffer.WriteString(" AND ")
		}
		sqlescape.WriteEscapeID(buffer, pkColumn)
		buffer.WriteByte('=')
		row[i].EncodeSQL(buffer)
	}
}
197541
func (o *GetTaskCommentsParams) WithID(id int64) *GetTaskCommentsParams {
	o.SetID(id)
	return o
}
1234662
func (rn *rawNode) ProcessWith(p Processor) error {
	return p.Raw(rn.raw)
}
517461
func (w *Writer) WriteWith(fw recordio.Writer, b *logpb.ButlerLogBundle) error {
	data, err := proto.Marshal(b)
	if err != nil {
		entries := b.GetEntries()
		// TODO(tandrii, hinoka): leave just error after crbug.com/859995 is fixed.
		if len(entries) > 100 {
			return fmt.Errorf("butlerproto: failed to marshal Bundle of len %d with first 100 entries %s: %s",
				len(entries), entries[:100], err)
		} else {
			return fmt.Errorf("butlerproto: failed to marshal Bundle %s: %s", entries, err)
		}
	}

	return w.writeData(fw, logpb.ButlerMetadata_ButlerLogBundle, data)
}
1197755
func (n node) WithCodec(codec codec.MarshalUnmarshaler) Node {
	n.codec = codec
	return &n
}
1179097
func (tn *textNode) ProcessWith(p Processor) error {
	return p.Text(tn.text)
}
814298
func WithWriter(w io.Writer) OptFunc {
	return func(c *RWI) {
		if w != nil {
			c.writer = w
		}
	}
}
403635
func (cn *commentNode) ProcessWith(p Processor) error {
	return p.Comment(cn.comment)
}
841696
func WithNodeID(id int) Option {
	return func(e *Engine) {
		e.nodeID = &id
		e.defaultMetricLabels["node_id"] = fmt.Sprint(*e.nodeID)
	}
}
369891
func (o *FindPetsByStatusOK) WithPayload(payload []*models.Pet) *FindPetsByStatusOK {
	o.Payload = payload
	return o
}
1351125
func (c *chunkedSeq) WithMeta(meta iseq.PMap) iseq.MetaW {
	if meta == c.meta {
		return c
	}
	return newChunkedSeqM(meta, c.vec, c.node, c.idx, c.offset)
}
926657
func (builder *UpdateCounterCommandBuilder) WithKey(key string) *UpdateCounterCommandBuilder {
	builder.key = key
	return builder
}
578008
func (s *shim) WithFields(fields log.Fields) log.Logger {
	var keyvals []interface{}

	for key, value := range fields {
		keyvals = append(keyvals, key, value)
	}

	return &shim{
		logger: kitlog.With(s.logger, keyvals...),
	}
}
803358
func WithTee(cmd string, args []string, logfile string) []string {
	// exec so we don't have a shell that doesn't pass signals to the real process
	execCmd := "exec " + cmd + " " + strings.Join(args, " ")

	// NOTE: tee & mkfifo is in /usr/bin in the kube-proxy image, but /bin in other images

	// Bash supports something like this, but dash and other limited shells don't
	//shCmd := "exec &> >(/usr/bin/tee -a " + logfile + "); " + execCmd
	// Instead we create the pipe manually and wire up the tee:
	shCmd := "mkfifo /tmp/pipe; (tee -a " + logfile + " < /tmp/pipe & ) ; " + execCmd + " > /tmp/pipe 2>&1"

	// Execute shell command
	return []string{"/bin/sh", "-c", shCmd}
}
641601
func WithWriter(a adaptor.Adaptor) OptionFunc {
	return func(n *Node) error {
		w, err := a.Writer(n.done, &n.wg)
		n.writer = w
		return err
	}
}
913217
func (builder *FetchValueCommandBuilder) WithKey(key string) *FetchValueCommandBuilder {
	builder.protobuf.Key = []byte(key)
	return builder
}