// CombinedOutput is part of the Cmd interface.
553437
func (cmd *cmdWrapper) CombinedOutput() ([]byte, error) {
	out, err := (*osexec.Cmd)(cmd).CombinedOutput()
	if err != nil {
		if ee, ok := err.(*osexec.ExitError); ok {
			// Force a compile fail if exitErrorWrapper can't convert to ExitError.
			var x ExitError = &exitErrorWrapper{ee}
			return out, x
		}
		if ee, ok := err.(*osexec.Error); ok {
			if ee.Err == osexec.ErrNotFound {
				return out, ErrExecutableNotFound
			}
		}
		return out, err
	}
	return out, nil
}
1126210
func (t *LocalTarget) CombinedOutput(args []string) ([]byte, error) {
	c := exec.Command(args[0], args[1:]...)
	return c.CombinedOutput()
}
137262
func (s *SSHRunner) CombinedOutput(cmd string) (string, error) {
	glog.Infoln("Run with output:", cmd)
	sess, err := s.c.NewSession()
	if err != nil {
		return "", errors.Wrap(err, "NewSession")
	}
	defer sess.Close()

	var combined singleWriter
	err = teeSSH(sess, cmd, &combined, &combined)
	out := combined.b.String()
	if err != nil {
		return out, err
	}
	return out, nil
}
466838
func (logger *Logger) SetOutput(output io.Writer) {
	logger.mu.Lock()
	defer logger.mu.Unlock()
	logger.Out = output
}
993768
func (l *Logger) SetOutput(output io.Writer) {
	l.fLogger.setOutput(output)
}
434495
func (s *DataFormatConversionConfiguration) SetOutputFormatConfiguration(v *OutputFormatConfiguration) *DataFormatConversionConfiguration {
	s.OutputFormatConfiguration = v
	return s
}
822862
func CombinedOutputTimeout(c *exec.Cmd, timeout time.Duration) ([]byte, error) {
	var b bytes.Buffer
	c.Stdout = &b
	c.Stderr = &b
	if err := c.Start(); err != nil {
		return nil, err
	}
	err := WaitTimeout(c, timeout)
	return b.Bytes(), err
}
164939
func output(stack *cloudformation.Stack, key string) (output *cloudformation.Output) {
	for _, o := range stack.Outputs {
		if *o.OutputKey == key {
			output = o
		}
	}
	return
}
1146993
func streamOutput(src io.Reader, dst *bytes.Buffer, out io.Writer) error {
	mw := io.MultiWriter(dst, out)
	s := bufio.NewReader(src)
	for {
		var line []byte
		line, err := s.ReadSlice('\n')
		if err == io.EOF && len(line) == 0 {
			break // done
		}
		if err == io.EOF {
			return fmt.Errorf("Improper termination: %v", line)
		}
		if err != nil {
			return err
		}

		// append to the buffer and out at once
		mw.Write(line)
	}

	return nil
}
1175717
func (a *Agent) closeOutputs() {
	for _, output := range a.Config.Outputs {
		output.Close()
	}
}
395309
func (s *ConnStats) incOutputBytes(n int) {
	s.totalOutputBytes.Add(uint64(n))
}
1120738
func (c *Cmd) CombinedOutput(scopedLog *logrus.Entry, verbose bool) ([]byte, error) {
	out, err := combinedOutput(c.ctx, c.Cmd, c.filters, scopedLog, verbose)
	if c.cancelFn != nil {
		c.cancelFn()
	}
	return out, err
}
613540
func (s *Stack) SetOutputs(v []*Output) *Stack {
	s.Outputs = v
	return s
}
703714
func RunOutput(args ...string) ([]byte, error) {
	stdout := bytes.NewBuffer(nil)
	err := RunStdout(stdout, args...)
	return stdout.Bytes(), err
}
1216597
func SetOutput(file *os.File) {
	writer := NewStandardOutput(file)
	runtime.Writers[0] = writer
}
893316
func (c *RawKVClient) BatchPut(keys, values [][]byte) error {
	start := time.Now()
	defer func() {
		tikvRawkvCmdHistogramWithBatchPut.Observe(time.Since(start).Seconds())
	}()

	if len(keys) != len(values) {
		return errors.New("the len of keys is not equal to the len of values")
	}
	for _, value := range values {
		if len(value) == 0 {
			return errors.New("empty value is not supported")
		}
	}
	bo := NewBackoffer(context.Background(), rawkvMaxBackoff)
	err := c.sendBatchPut(bo, keys, values)
	return errors.Trace(err)
}
159099
func tableOutput(list []string, c *columnize.Config) string {
	if len(list) == 0 {
		return ""
	}

	delim := "|"
	if c != nil && c.Delim != "" {
		delim = c.Delim
	}

	underline := ""
	headers := strings.Split(list[0], delim)
	for i, h := range headers {
		h = strings.TrimSpace(h)
		u := strings.Repeat("-", len(h))

		underline = underline + u
		if i != len(headers)-1 {
			underline = underline + delim
		}
	}

	list = append(list, "")
	copy(list[2:], list[1:])
	list[1] = underline

	return columnOutput(list, c)
}