// PrintBitriseHeaderASCIIArt ...
197903
func PrintBitriseHeaderASCIIArt(appVersion string) {
	// generated here: http://patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=Bitrise
	fmt.Println(`
  ██████╗ ██╗████████╗██████╗ ██╗███████╗███████╗
  ██╔══██╗██║╚══██╔══╝██╔══██╗██║██╔════╝██╔════╝
  ██████╔╝██║   ██║   ██████╔╝██║███████╗█████╗
  ██╔══██╗██║   ██║   ██╔══██╗██║╚════██║██╔══╝
  ██████╔╝██║   ██║   ██║  ██║██║███████║███████╗
  ╚═════╝ ╚═╝   ╚═╝   ╚═╝  ╚═╝╚═╝╚══════╝╚══════╝`)
	fmt.Println()
	log.Donef("  version: %s", appVersion)
	fmt.Println()
}
584311
func printHeader(w io.Writer, rpt *Report) {
	fmt.Fprintln(w, weblistPageHeader)

	var labels []string
	for _, l := range legendLabels(rpt) {
		labels = append(labels, template.HTMLEscapeString(l))
	}

	fmt.Fprintf(w, `<div class="legend">%s<br>Total: %s</div>`,
		strings.Join(labels, "<br>\n"),
		rpt.formatValue(rpt.total),
	)
}
1322941
func (w *wrapper) WriteHeader(code int) {
	w.status = code
	w.ResponseWriter.WriteHeader(code)
}
1193602
func BasicInfoHeader(name string, size int64, fileInfo *winio.FileBasicInfo) *tar.Header {
	hdr := &tar.Header{
		Name:         filepath.ToSlash(name),
		Size:         size,
		Typeflag:     tar.TypeReg,
		ModTime:      time.Unix(0, fileInfo.LastWriteTime.Nanoseconds()),
		ChangeTime:   time.Unix(0, fileInfo.ChangeTime.Nanoseconds()),
		AccessTime:   time.Unix(0, fileInfo.LastAccessTime.Nanoseconds()),
		CreationTime: time.Unix(0, fileInfo.CreationTime.Nanoseconds()),
		Winheaders:   make(map[string]string),
	}
	hdr.Winheaders[hdrFileAttributes] = fmt.Sprintf("%d", fileInfo.FileAttributes)

	if (fileInfo.FileAttributes & syscall.FILE_ATTRIBUTE_DIRECTORY) != 0 {
		hdr.Mode |= c_ISDIR
		hdr.Size = 0
		hdr.Typeflag = tar.TypeDir
	}
	return hdr
}
666203
func (rb *ResponseBuffer) CopyHeader() {
	for field, val := range rb.header {
		rb.ResponseWriterWrapper.Header()[field] = val
	}
}
364561
func printTaintsMultilineWithIndent(w PrefixWriter, initialIndent, title, innerIndent string, taints []corev1.Taint) {
	w.Write(LEVEL_0, "%s%s:%s", initialIndent, title, innerIndent)

	if taints == nil || len(taints) == 0 {
		w.WriteLine("<none>")
		return
	}

	// to print taints in the sorted order
	sort.Slice(taints, func(i, j int) bool {
		cmpKey := func(taint corev1.Taint) string {
			return string(taint.Effect) + "," + taint.Key
		}
		return cmpKey(taints[i]) < cmpKey(taints[j])
	})

	for i, taint := range taints {
		if i != 0 {
			w.Write(LEVEL_0, "%s", initialIndent)
			w.Write(LEVEL_0, "%s", innerIndent)
		}
		w.Write(LEVEL_0, "%s\n", taint.ToString())
	}
}
709279
func printPodTolerationsMultiline(w PrefixWriter, title string, tolerations []corev1.Toleration) {
	printTolerationsMultilineWithIndent(w, "", title, "\t", tolerations)
}
118188
func (w *writer) WriteHeader(key, value string) error {
	if w.phase != header {
		return &phaseError{header, w.phase}
	}
	_, err := fmt.Fprintf(w, "%s: %s\r\n", key, value)
	return err
}
715347
func (ls *LocalSigner) NewSignatureHeader() (*cb.SignatureHeader, error) {
	return &cb.SignatureHeader{
		Creator: ls.Identity,
		Nonce:   ls.Nonce,
	}, nil
}
640327
func (self *ErrWrapper) WriteHeader(status int) {
	if (status / 100) > 2 {
		self.err.ErrorDispatch(status, self.ResponseWriter, self.req)
	}
}
349402
func BuildB3SingleHeader(traceID, spanID, sampling, flags, parentSpanID string) string {
	if traceID == "" || spanID == "" {
		return ""
	}

	if sampling == "" && flags == "" {
		return traceID + "-" + spanID
	}

	samplingBit := "0"
	if flags == "1" {
		samplingBit = "d"
	} else if s, err := strconv.ParseBool(sampling); err == nil {
		if s {
			samplingBit = "1"
		}
	} else {
		return traceID + "-" + spanID
	}

	if parentSpanID == "" {
		return traceID + "-" + spanID + "-" + samplingBit
	}

	return traceID + "-" + spanID + "-" + samplingBit + "-" + parentSpanID
}
589888
func Print(a ...interface{}) (n int, err error) {
	return fmt.Fprint(out, formatAll(a)...)
}
331121
func NewSignatureHeaderOrPanic(signer crypto.LocalSigner) *cb.SignatureHeader {
	if signer == nil {
		panic(errors.New("invalid signer. cannot be nil"))
	}

	signatureHeader, err := signer.NewSignatureHeader()
	if err != nil {
		panic(fmt.Errorf("failed generating a new SignatureHeader: %s", err))
	}
	return signatureHeader
}
743169
func (w *interceptingWriter) WriteHeader(code int) {
	w.code = code
	w.ResponseWriter.WriteHeader(code)
}
175215
func PrintFlags(header string) {
	fmt.Println(header)
	valueFmt := fmt.Sprintf("%%-%ds\tdefault: %%-%ds\t%%-%ds\n", tabWidth[tabKey], tabWidth[tabValue], tabWidth[tabUsage])

	for _, desc := range descriptions {
		fmt.Printf(valueFmt, desc.flagKey, desc.value, desc.usage)
	}
}
508276
func (w *minifyResponseWriter) WriteHeader(status int) {
	w.ResponseWriter.Header().Del("Content-Length")
	w.ResponseWriter.WriteHeader(status)
}
1115333
func PrintHist(data []int) {
	if len(data) == 0 {
		return
	}
	// Cut the data at the 99th percentile
	p99Idx := pIdx(len(data), 0.99)
	data = data[:p99Idx]

	buckets := make([]int, numBuckets)
	min := data[0]
	max := data[len(data)-1]
	step := float64(max-min) / numBuckets
	prevCutIdx := 0
	maxBucket := 0
	maxBucketIdx := 0

	for i := 0; i < numBuckets; i++ {
		cut := float64(min) + step*float64(i+1)
		count := 0
		j := prevCutIdx

		for ; j < len(data) && float64(data[j]) < cut; j++ {
			count++
		}

		prevCutIdx = j
		buckets[i] = count

		if count > maxBucket {
			maxBucket = count
			maxBucketIdx = i
		}
	}

	topBucketFmt := fmt.Sprintf("%%%vd\n", maxBucketIdx+3)
	topPointerRow := make([]rune, numBuckets)

	for i := 1; i < numBuckets-1; i++ {
		topPointerRow[i] = ' '
	}

	topPointerRow[maxBucketIdx+1] = 'v'

	// Scale the graph to a reasonable maximum height
	heightRatio := float64(maxHeight) / float64(maxBucket)
	for i := 0; i < len(buckets); i++ {
		buckets[i] = int(math.Min(float64(maxHeight), math.Ceil(float64(buckets[i])*heightRatio)))
	}

	// Scan downward over the histogram printing line by line
	var hist []rune
	for i := maxHeight; i >= 0; i-- {
		for j := 0; j < numBuckets; j++ {
			if i == 0 {
				hist = append(hist, '=')
			} else if buckets[j] == i {
				hist = append(hist, '|')
				buckets[j]--
			} else {
				hist = append(hist, ' ')
			}
		}

		hist = append(hist, '\n')
	}

	gmin := float64(min) / msFactor
	gmax := float64(max) / msFactor
	gmid := gmin + (gmax-gmin)/2

	pointerRow := make([]rune, numBuckets)

	for i := 1; i < numBuckets-1; i++ {
		pointerRow[i] = ' '
	}

	pointerRow[0] = '^'
	pointerRow[len(pointerRow)/2] = '^'
	pointerRow[len(pointerRow)-1] = '^'

	fmt.Printf(topBucketFmt, maxBucket)
	fmt.Println(string(topPointerRow))
	fmt.Print(string(hist))
	fmt.Println(string(pointerRow))
	fmt.Printf("%.4fms                                       %.4fms                                     %.4fms\n", gmin, gmid, gmax)
}