// printCharCode here is slightly different from lexer.printCharCode()
769173
func printCharCode(code rune) string {
	// print as ASCII for printable range
	if code >= 0x0020 {
		return fmt.Sprintf(`%c`, code)
	}
	// Otherwise print the escaped form. e.g. `"\\u0007"`
	return fmt.Sprintf(`\u%04X`, code)
}
13626
func Decode(input string, alphabet *Alphabet) ([]byte, error) {
	capacity := utf8.RuneCountInString(input)*733/1000 + 1 // log(58) / log(256)
	output := make([]byte, capacity)
	outputReverseEnd := capacity - 1
	var carry, outputIdx, i int
	var target rune

	// prefix 0
	zero58Byte := alphabet.encodeTable[0]
	prefixZeroes := 0
	skipZeros := false

	for _, target = range input {
		// collect prefix zeros
		if !skipZeros {
			if target == zero58Byte {
				prefixZeroes++
				continue
			} else {
				skipZeros = true
			}
		}

		carry = -1
		if target >= 0 && target < 256 {
			carry = alphabet.decodeTable[target]
		} else { // unicode
			for i = 0; i < len(alphabet.unicodeDecodeTable); i += 2 {
				if alphabet.unicodeDecodeTable[i] == target {
					carry = int(alphabet.unicodeDecodeTable[i+1])
					break
				}
			}
		}
		if carry == -1 {
			return nil, ErrorInvalidBase58String
		}

		outputIdx = capacity - 1
		for ; outputIdx > outputReverseEnd || carry != 0; outputIdx-- {
			carry += 58 * int(output[outputIdx])
			output[outputIdx] = byte(uint32(carry) & 0xff) // same as: byte(uint32(carry) % 256)
			carry >>= 8                                    // same as: carry /= 256
		}
		outputReverseEnd = outputIdx
	}

	retBytes := make([]byte, prefixZeroes+(capacity-1-outputReverseEnd))
	copy(retBytes[prefixZeroes:], output[outputReverseEnd+1:])
	return retBytes, nil
}
385053
func (l *Logger) Printf(format string, v ...interface{}) {
	l.Fprint(l.flags, LEVEL_PRINT, 2, fmt.Sprintf(format, v...), nil)
}
190510
func lexField(r *strings.Reader) (string, string, error) {
	key := make([]byte, 0, 5)
	val := make([]byte, 0, 32)

	// read the key
	for {
		ch, _ := r.ReadByte()
		if ch == '=' {
			break
		}
		if ch < 'a' || ch > 'z' { // fail if not ASCII lowercase letter
			return "", "", AuthFormatError{"header", "cannot parse header field"}
		}
		key = append(key, ch)
	}
	if ch, _ := r.ReadByte(); ch != '"' {
		return "", "", AuthFormatError{string(key), "cannot parse value"}
	}
	// read the value
	for {
		ch, _ := r.ReadByte()
		if ch == '"' {
			break
		}
		// character class is ASCII printable [\x20-\x7E] without \ and "
		if ch < 0x20 || ch > 0x7E || ch == '\\' {
			return "", "", AuthFormatError{string(key), "cannot parse value"}
		}
		val = append(val, ch)
	}

	return string(key), string(val), nil
}
844984
func (a *Writer) Print(args ...interface{}) (int, error) {
	return fmt.Fprint(a.w, args...)
}
576614
func (list *List) PrintOption(option string) int {
	list.colors.Option.Set()
	bytes, _ := list.Print(list.indent + option)
	color.Unset()

	return bytes
}
624334
func Print(err error) string {
	return fmt.Sprintf("%v: %v\n", Code(err), err.Error())
}
945988
func (out *Output) Printf(format string, a ...interface{}) error {
	out.mu.Lock()
	defer out.mu.Unlock()
	s := fmt.Sprintf(format, a...)
	_, err := out.wd.Write([]byte(s))
	return err
}
1347388
func quoteChar(c int) string {
	// special cases - different from quoted strings
	if c == '\'' {
		return `'\''`
	}
	if c == '"' {
		return `'"'`
	}

	// use quoted string with different quotation marks
	s := strconv.Quote(string(c))
	return "'" + s[1:len(s)-1] + "'"
}
1076458
func (t *Tree) Print(w io.Writer) {
	allMethods := [...]string{
		http.MethodConnect,
		http.MethodDelete,
		http.MethodGet,
		http.MethodHead,
		http.MethodOptions,
		http.MethodPatch,
		http.MethodPost,
		http.MethodPut,
		http.MethodTrace,
	}
	t.root.walk(false, func(n *node) {
		var methods []string
		for _, m := range allMethods {
			if r := n.getRoute(m); r != nil && r.handler != nil {
				methods = append(methods, m)
			}
		}

		if len(methods) > 0 {
			fmt.Fprintln(w, n.path, methods)
		} else {
			fmt.Fprintln(w, n.path)
		}
	})
}
945806
func (ns *Namespace) Printf(format string, a ...interface{}) string {
	return _fmt.Sprintf(format, a...)

}
589888
func Print(a ...interface{}) (n int, err error) {
	return fmt.Fprint(out, formatAll(a)...)
}
1202685
func (u *UITable) Print() error {
	result := &bytes.Buffer{}
	t := u.Table

	err := t.PrintTo(result)
	if err != nil {
		return err
	}

	// DevNote. With the change to printing into a buffer all
	// lines now come with a terminating \n. The t.ui.Say() below
	// will then add another \n to that. To avoid this additional
	// line we chop off the last \n from the output (if there is
	// any). Operating on the slice avoids string copying.
	//
	// WIBNI if the terminal API had a variant of Say not assuming
	// that each output is a single line.

	r := result.Bytes()
	if len(r) > 0 {
		r = r[0 : len(r)-1]
	}

	// Only generate output for a non-empty table.
	if len(r) > 0 {
		u.UI.Say("%s", string(r))
	}
	return nil
}
660153
func (c *Code) Print(args ...interface{}) {
	if len(args) > 0 {
		for i := 0; i < c.indent; i++ {
			c.text += indentation
		}
		c.text += fmt.Sprintf(args[0].(string), args[1:]...)
	}
	c.text += "\n"
}
921209
func (a *OutputAdapters) Print(print func(v interface{})) io.Writer {
	return &printAdapter{
		print: print,
	}
}
1177254
func (l *Logger) Printf(format string, args ...interface{}) {
	l.print(DisableLevel, fmt.Sprintf(format, args...), l.NewLine)
}
897711
func (g *Group) Print(args ...Code) *Statement {
	s := Print(args...)
	g.items = append(g.items, s)
	return s
}