// WithStdin returns a context with the value for Stdin set. If true some input
// is available on Stdin (e.g. something is being piped into it)
501926
func WithStdin(ctx context.Context, isStdin bool) context.Context {
	return context.WithValue(ctx, ctxKeyStdin, isStdin)
}
1039583
func WithAutoPrint(ctx context.Context, bv bool) context.Context {
	return context.WithValue(ctx, ctxKeyAutoPrint, bv)
}
334932
func WithContext(ctx *cli.Context, opts ...source.Option) source.Source {
	return &cliSource{
		ctx:  ctx,
		opts: source.NewOptions(opts...),
	}
}
496468
func (h *Handler) WithContext(ctx context.Context) {
	go func() {
		<-ctx.Done()
		h.terminating = true
	}()
}
881776
func WithStdio(opt *Streams) {
	WithStreams(os.Stdin, os.Stdout, os.Stderr)(opt)
}
226426
func WithFunc(template string, format Func) (string, error) {
	buffer := bytes.NewBuffer(make([]byte, 0, len(template)))
	opts := &Options{
		Template: strings.NewReader(template),
		Output:   buffer,
		Format:   format,
	}
	i := NewWithOptions(opts)
	if err := i.Interpolate(); err != nil {
		return "", err
	}
	return buffer.String(), nil
}
1116188
func WithFsckFunc(ctx context.Context, imf store.FsckCallback) context.Context {
	return context.WithValue(ctx, ctxKeyFsckFunc, imf)
}
134406
func input(filename string) (nm string, rc io.ReadCloser) {
	nm = "stdin"
	inf := os.Stdin
	if filename != "" {
		f, err := os.Open(filename)
		if err != nil {
			fmt.Fprintln(os.Stderr, err)
			exit(2)
		}
		inf = f
		nm = filename
	}
	r := bufio.NewReader(inf)
	return nm, makeReadCloser(r, inf)
}
419719
func With(ctx context.Context, opts ...func(logrus.Fields)) context.Context {
	logger := FromContext(ctx)

	fields := make(logrus.Fields)
	for _, opt := range opts {
		opt(fields)
	}
	logger = logger.WithFields(fields)

	return context.WithValue(ctx, loggerKey, logger)
}
279621
func (q *Query) WithContext(ctx context.Context) *Query {
	q.ctx = ctx
	return q
}
1053392
func (o *DiscoverOpenIDConfigurationParams) WithContext(ctx context.Context) *DiscoverOpenIDConfigurationParams {
	o.SetContext(ctx)
	return o
}
805962
func (logger *Logger) WithContext(ctx context.Context) *Entry {
	entry := logger.newEntry()
	defer logger.releaseEntry(entry)
	return entry.WithContext(ctx)
}
313349
func (m *Meta) StdinPiped() bool {
	fi, err := wrappedstreams.Stdin().Stat()
	if err != nil {
		// If there is an error, let's just say its not piped
		return false
	}

	return fi.Mode()&os.ModeNamedPipe != 0
}
401285
func (l *Context) With(keyvals ...interface{}) *Context {
	if len(keyvals)%2 != 0 {
		panic("Programmer error.  Please call log.Context.With() only with an even number of arguments.")
	}
	if len(keyvals) == 0 || l == nil {
		return l
	}
	return &Context{
		Logger:  l.Logger,
		KeyVals: addArrays(l.KeyVals, keyvals),
	}
}
846107
func input() io.Reader {
	if isatty.IsTerminal(os.Stdin.Fd()) {
		return strings.NewReader("{}")
	}

	return os.Stdin
}
694042
func WithPrefix(ctx context.Context, prefix string) context.Context {
	return context.WithValue(ctx, ctxKeyPrefix, prefix)
}
484333
func ContextWithRequestID(ctx context.Context) (context.Context, string) {
	reqID := ContextRequestID(ctx)
	if reqID == "" {
		reqID = shortID()
		ctx = context.WithValue(ctx, reqIDKey, reqID)
	}
	return ctx, reqID
}