// NewFormat returns a Format for rendering using a node Context
768428
func NewFormat(source string, quiet bool) formatter.Format {
	switch source {
	case formatter.PrettyFormatKey:
		return nodeInspectPrettyTemplate
	case formatter.TableFormatKey:
		if quiet {
			return formatter.DefaultQuietFormat
		}
		return defaultNodeTableFormat
	case formatter.RawFormatKey:
		if quiet {
			return `node_id: {{.ID}}`
		}
		return `node_id: {{.ID}}\nhostname: {{.Hostname}}\nstatus: {{.Status}}\navailability: {{.Availability}}\nmanager_status: {{.ManagerStatus}}\n`
	}
	return formatter.Format(source)
}
147391
func (s *JobReport) SetFormat(v string) *JobReport {
	s.Format = &v
	return s
}
521072
func (s *CreateDocumentInput) SetDocumentFormat(v string) *CreateDocumentInput {
	s.DocumentFormat = &v
	return s
}
1118400
func (fp *formatParser) addFormatFunc(
	f func(*LineData, *bytes.Buffer) error, size int,
) {
	fp.commitStatic()
	fp.formatFuncs = append(fp.formatFuncs, f)
	fp.initialSize += size
}
1333242
func NewFormat(source string, quiet bool) formatter.Format {
	switch source {
	case formatter.PrettyFormatKey:
		return configInspectPrettyTemplate
	case formatter.TableFormatKey:
		if quiet {
			return formatter.DefaultQuietFormat
		}
		return defaultConfigTableFormat
	}
	return formatter.Format(source)
}
776498
func NewErrorformat(efms []string) (*Errorformat, error) {
	errorformat := &Errorformat{Efms: make([]*Efm, 0, len(efms))}
	for _, efm := range efms {
		e, err := NewEfm(efm)
		if err != nil {
			return nil, err
		}
		errorformat.Efms = append(errorformat.Efms, e)
	}
	return errorformat, nil
}
1249259
func (s *WavSettings) SetFormat(v string) *WavSettings {
	s.Format = &v
	return s
}
53793
func (c *Context) ResponseFormat(r *http.Request, offers []string) (string, *http.Request) {
	var rCtx = r.Context()

	if v, ok := rCtx.Value(ctxResponseFormat).(string); ok {
		debugLog("[%s %s] found response format %q in context", r.Method, r.URL.Path, v)
		return v, r
	}

	format := NegotiateContentType(r, offers, "")
	if format != "" {
		debugLog("[%s %s] set response format %q in context", r.Method, r.URL.Path, format)
		r = r.WithContext(stdContext.WithValue(rCtx, ctxResponseFormat, format))
	}
	debugLog("[%s %s] negotiated response format %q", r.Method, r.URL.Path, format)
	return format, r
}
608031
func (s *JobParameters) SetFormat(v string) *JobParameters {
	s.Format = &v
	return s
}
1351798
func (s *InventoryS3BucketDestination) SetFormat(v string) *InventoryS3BucketDestination {
	s.Format = &v
	return s
}
1346755
func (s *VideoMetadata) SetFormat(v string) *VideoMetadata {
	s.Format = &v
	return s
}
534003
func (s *SegmentImportResource) SetFormat(v string) *SegmentImportResource {
	s.Format = &v
	return s
}
958061
func NewFormatter(fraction int, decimal, thousand, grapheme, template string) *Formatter {
	return &Formatter{
		Fraction: fraction,
		Decimal:  decimal,
		Thousand: thousand,
		Grapheme: grapheme,
		Template: template,
	}
}
524328
func NewContainerFormat(source string, quiet bool, size bool) Format {
	switch source {
	case TableFormatKey:
		if quiet {
			return DefaultQuietFormat
		}
		format := defaultContainerTableFormat
		if size {
			format += `\t{{.Size}}`
		}
		return Format(format)
	case RawFormatKey:
		if quiet {
			return `container_id: {{.ID}}`
		}
		format := `container_id: {{.ID}}
image: {{.Image}}
command: {{.Command}}
created_at: {{.CreatedAt}}
status: {{- pad .Status 1 0}}
names: {{.Names}}
labels: {{- pad .Labels 1 0}}
ports: {{- pad .Ports 1 0}}
`
		if size {
			format += `size: {{.Size}}\n`
		}
		return Format(format)
	}
	return Format(source)
}
820923
func (d *DiffResult) JSONFormat() (string, error) {
	if !d.Diff.Modified() {
		return "", nil
	}
	jsonFmt := formatter.NewDeltaFormatter()
	return jsonFmt.Format(d.Diff)
}
136094
func (p *Parameter) DataFormat(formatName string) *Parameter {
	p.data.DataFormat = formatName
	return p
}
1311313
func OutputFormat(s string) string {
	var buf bytes.Buffer
	for _, old := range s {
		if newVal, ok := replace[old]; ok {
			buf.WriteString(newVal)
			continue
		}
		buf.WriteRune(old)
	}

	return buf.String()
}