// Print returns a string representation of given AST, that can be used for debugging purpose.
183768
func Print(node Node) string {
	visitor := newPrintVisitor()
	node.Accept(visitor)
	return visitor.output()
}
102822
func (p *Printer) Print(vs ...interface{}) {
	for i, v := range vs {
		if i > 0 {
			fmt.Fprint(p.w, " ")
		}
		p.reprValue(map[reflect.Value]bool{}, reflect.ValueOf(v), "")
	}
}
813481
func (dbg DebugPrinter) Printf(format string, v ...interface{}) {
	if dbg.Enabled {
		fmt.Fprintf(dbg.out, format, v...)
	}
}
496650
func (p *VersionedColumnPrinter) Print(out interface{}) ([]string, []byte, error) {
	var output []byte
	if obj, ok := out.(runtime.Object); ok {
		converted, err := p.convertor.ConvertToVersion(obj, p.version)
		if err != nil {
			if !runtime.IsNotRegisteredError(err) {
				return nil, nil, err
			}
			converted = obj
		}
		data, err := json.Marshal(converted)
		if err != nil {
			return nil, nil, err
		}
		output = data
		out = map[string]interface{}{}
		if err := json.Unmarshal(data, &out); err != nil {
			return nil, nil, err
		}
	}
	args, _, err := p.printer.Print(out)
	return args, output, err
}
318288
func (n *node) print(w io.Writer, level int) {
	fmt.Fprintf(w, "%sNODE:%v\n", strings.Repeat("  ", level), n.items)
	for _, c := range n.children {
		c.print(w, level+1)
	}
}
1257160
func Print(fset *token.FileSet, x interface{}) (int, error) {
	return Fprint(os.Stdout, fset, x, NotNilFilter)
}
394641
func (db *CLevelDB) Print() {
	itr := db.Iterator(nil, nil)
	defer itr.Close()
	for ; itr.Valid(); itr.Next() {
		key := itr.Key()
		value := itr.Value()
		fmt.Printf("[%X]:\t[%X]\n", key, value)
	}
}
733428
func (p *Progress) Print(optionals ...bool) {
	stream := os.Stderr
	if len(optionals) > 0 {
		if optionals[0] {
			stream = os.Stdout
		}
	}
	f := bufio.NewWriter(stream)
	defer f.Flush()
	f.WriteString(fmt.Sprintf("% *s\r", p.sOutput, ""))
	f.WriteString(p.String() + "\r")
}
161776
func (p *Printer) Print(obj runtime.Object, w io.Writer) error {
	if obj == nil {
		return nil
	}
	data, err := yaml.Marshal(obj)
	if err != nil {
		return err
	}
	_, err = w.Write(data)
	return err

}
617007
func PrintAsJSON(x interface{}) {
	b, err := json.MarshalIndent(x, "", "    ")
	if err != nil {
		fmt.Fprintf(os.Stderr, "can't marshal %+v as a JSON string: %v\n", x, err)
	}
	fmt.Println(string(b))
}
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)
		}
	})
}
307136
func (p HTMLPrinter) Print(w io.Writer, kind Kind, tokText string) error {
	if p.AsOrderedList {
		if i := strings.Index(tokText, "\n"); i > -1 {
			if err := p.Print(w, kind, tokText[:i]); err != nil {
				return err
			}
			w.Write([]byte("</li>\n<li>"))
			if err := p.Print(w, kind, tokText[i+1:]); err != nil {
				return err
			}
			return nil
		}
	}

	class := ((HTMLConfig)(p)).Class(kind)
	if class != "" {
		_, err := w.Write([]byte(`<span class="`))
		if err != nil {
			return err
		}
		_, err = io.WriteString(w, class)
		if err != nil {
			return err
		}
		_, err = w.Write([]byte(`">`))
		if err != nil {
			return err
		}
	}
	template.HTMLEscape(w, []byte(tokText))
	if class != "" {
		_, err := w.Write([]byte(`</span>`))
		if err != nil {
			return err
		}
	}
	return nil
}
235756
func (lib *Lib) Print(level Severity, a ...interface{}) {
	if lib == nil || lib.Printers == nil || level >= Severity(len(lib.Printers)) {
		return
	}
	lib.Printers[level].Print(a...)
}
843969
func (w *Writer) Print() error {
	w.mtx.Lock()
	defer w.mtx.Unlock()
	// do nothing if buffer is empty
	if len(w.Buf.Bytes()) == 0 {
		return nil
	}

	var currentLine bytes.Buffer
	for _, b := range w.Buf.Bytes() {
		if b == '\n' {
			w.lineCount++
			currentLine.Reset()
		} else {
			currentLine.Write([]byte{b})
			if currentLine.Len() > termWidth {
				w.lineCount++
				currentLine.Reset()
			}
		}
	}
	_, err := w.Out.Write(w.Buf.Bytes())
	w.Buf.Reset()
	return err
}
351846
func (l *Logger) Print(v ...interface{}) {
	l.Emit(0, fmt.Sprint(v...), nil)
}
1349674
func (t *Tree) Print(w io.Writer, f IterateFunc, itemSiz int) {

	fmt.Fprintf(w, "treeNode-+-Left \t / Left High\n")
	fmt.Fprintf(w, "     |      \t = Equal\n")
	fmt.Fprintf(w, "     +-Right\t \\ Right High\n\n")

	maxHeight := t.Height()

	if f != nil && t.root != nil {
		d := &printData{0, itemSiz, make([]byte, maxHeight), 0, f, w}
		d.printer(t.root)
	}
}
769267
func Print(ctx context.Context, dockerCli command.Cli, tasks []swarm.Task, resolver *idresolver.IDResolver, trunc, quiet bool, format string) error {
	sort.Stable(tasksBySlot(tasks))

	names := map[string]string{}
	nodes := map[string]string{}

	tasksCtx := formatter.Context{
		Output: dockerCli.Out(),
		Format: NewTaskFormat(format, quiet),
		Trunc:  trunc,
	}

	prevName := ""
	for _, task := range tasks {
		serviceName, err := resolver.Resolve(ctx, swarm.Service{}, task.ServiceID)
		if err != nil {
			return err
		}

		nodeValue, err := resolver.Resolve(ctx, swarm.Node{}, task.NodeID)
		if err != nil {
			return err
		}

		var name string
		if task.Slot != 0 {
			name = fmt.Sprintf("%v.%v", serviceName, task.Slot)
		} else {
			name = fmt.Sprintf("%v.%v", serviceName, task.NodeID)
		}

		// Indent the name if necessary
		indentedName := name
		if name == prevName {
			indentedName = fmt.Sprintf(" \\_ %s", indentedName)
		}
		prevName = name

		names[task.ID] = name
		if tasksCtx.Format.IsTable() {
			names[task.ID] = indentedName
		}
		nodes[task.ID] = nodeValue
	}

	return FormatWrite(tasksCtx, tasks, names, nodes)
}