// redirectResponseToOutputStream redirect the response stream to stdout and stderr. When tty is true, all stream will
// only be redirected to stdout.
489570
func (d *kubeDockerClient) redirectResponseToOutputStream(tty bool, outputStream, errorStream io.Writer, resp io.Reader) error {
	if outputStream == nil {
		outputStream = ioutil.Discard
	}
	if errorStream == nil {
		errorStream = ioutil.Discard
	}
	var err error
	if tty {
		_, err = io.Copy(outputStream, resp)
	} else {
		_, err = dockerstdcopy.StdCopy(outputStream, errorStream, resp)
	}
	return err
}
326763
func SetOutput(w io.Writer) {
	std.mu.Lock()
	defer std.mu.Unlock()
	std.SetOutput(w)
}
1012403
func EncodeHTTPRedirectResponse(redirectURLHeader, redirectURLQueryParam string) httptransport.EncodeResponseFunc {
	return func(ctx context.Context, w http.ResponseWriter, response interface{}) error {
		res := response.(redirectResponse)
		if res.Err != nil {
			return businessErrorEncoder(ctx, res.Err, w)
		}
		w.Header().Add("Location", fmt.Sprintf("%s?%s=%s", res.RedirectURL, redirectURLQueryParam, res.RequestURL))
		w.Header().Add(redirectURLHeader, res.RequestURL)

		defer kitty.TraceStatusAndFinish(ctx, w.Header(), 307)
		w.WriteHeader(307)
		return nil
	}
}
707715
func (s *rpcServer) writeHTTPResponseHeaders(req *http.Request, headers http.Header, code int, w io.Writer) error {
	_, err := io.WriteString(w, s.httpStatusLine(req, code))
	if err != nil {
		return err
	}

	err = headers.Write(w)
	if err != nil {
		return err
	}

	_, err = io.WriteString(w, "\r\n")
	return err
}
993768
func (l *Logger) SetOutput(output io.Writer) {
	l.fLogger.setOutput(output)
}
765714
func (p *Pool) respondToPings() error {
	pong := redisPool.Get()
	ping := redis.PubSubConn{redisPool.Get()}
	defer func() {
		pong.Close()
		ping.Close()
	}()
	// Subscribe to the ping key for this pool to receive pings.
	if err := ping.Subscribe(p.pingKey()); err != nil {
		return err
	}
	for {
		// Whenever we recieve a ping, reply immediately with a pong by
		// publishing to the pong key for this pool.
		switch reply := ping.Receive().(type) {
		case redis.Message:
			if _, err := pong.Do("PUBLISH", p.pongKey(), 0); err != nil {
				return err
			}
		case error:
			err := reply.(error)
			return err
		}
		time.Sleep(1 * time.Millisecond)
	}
}
343003
func (c *Color) SetOutput(w io.Writer) {
	c.output = w
	if w, ok := w.(*os.File); !ok || !isatty.IsTerminal(w.Fd()) {
		c.disabled = true
	}
}
340628
func (s *OutputDescription) SetKinesisStreamsOutputDescription(v *KinesisStreamsOutputDescription) *OutputDescription {
	s.KinesisStreamsOutputDescription = v
	return s
}
1148511
func (s *GetCommandInvocationOutput) SetResponseCode(v int64) *GetCommandInvocationOutput {
	s.ResponseCode = &v
	return s
}
479091
func StreamingResponseWriter(w http.ResponseWriter) *ResponseWriter {
	fw, err := newFlushWriter(w)
	if err != nil {
		panic(err)
	}

	return &ResponseWriter{
		ResponseWriter: w,
		w:              fw,
	}
}
847290
func (s *InputUpdate) SetKinesisStreamsInputUpdate(v *KinesisStreamsInputUpdate) *InputUpdate {
	s.KinesisStreamsInputUpdate = v
	return s
}
481240
func NewTakeResponseBodyAsStreamArgs(requestID RequestID) *TakeResponseBodyAsStreamArgs {
	args := new(TakeResponseBodyAsStreamArgs)
	args.RequestID = requestID
	return args
}
716381
func (logger *Logger) SetOutput(out io.Writer) {
	unsafeStd := (*unsafe.Pointer)(unsafe.Pointer(&logger.std))
	old := logger.std
	logger.std.Out = out
	atomic.CompareAndSwapPointer(unsafeStd, unsafe.Pointer(old), unsafe.Pointer(logger.std))

}
1216597
func SetOutput(file *os.File) {
	writer := NewStandardOutput(file)
	runtime.Writers[0] = writer
}
1341296
func StreamResponse(w http.ResponseWriter, data io.ReadCloser) {
	w.Header().Set("Content-Type", DefaultContentTypeV1_1)
	if _, err := copyBuf(w, data); err != nil {
		fmt.Printf("ERROR in stream: %v\n", err)
	}
	data.Close()
}
499662
func (s *LabelingJobOutput) SetOutputDatasetS3Uri(v string) *LabelingJobOutput {
	s.OutputDatasetS3Uri = &v
	return s
}
570753
func LogicalResponseToHTTPResponse(input *Response) *HTTPResponse {
	httpResp := &HTTPResponse{
		Data:     input.Data,
		Warnings: input.Warnings,
		Headers:  input.Headers,
	}

	if input.Secret != nil {
		httpResp.LeaseID = input.Secret.LeaseID
		httpResp.Renewable = input.Secret.Renewable
		httpResp.LeaseDuration = int(input.Secret.TTL.Seconds())
	}

	// If we have authentication information, then
	// set up the result structure.
	if input.Auth != nil {
		httpResp.Auth = &HTTPAuth{
			ClientToken:      input.Auth.ClientToken,
			Accessor:         input.Auth.Accessor,
			Policies:         input.Auth.Policies,
			TokenPolicies:    input.Auth.TokenPolicies,
			IdentityPolicies: input.Auth.IdentityPolicies,
			Metadata:         input.Auth.Metadata,
			LeaseDuration:    int(input.Auth.TTL.Seconds()),
			Renewable:        input.Auth.Renewable,
			EntityID:         input.Auth.EntityID,
			TokenType:        input.Auth.TokenType.String(),
			Orphan:           input.Auth.Orphan,
		}
	}

	return httpResp
}