// Explain returns an explanation of a failure.
320834
func (f *ConstraintFilter) Explain(nodes int) string {
	if nodes == 1 {
		return "scheduling constraints not satisfied on 1 node"
	}
	return fmt.Sprintf("scheduling constraints not satisfied on %d nodes", nodes)
}
1166882
func (h *Exception) Description(description string) *Exception {
	h.description = description
	h.descriptionSet = true
	return h
}
1196805
func (p *basePhysicalAgg) ExplainInfo() string {
	buffer := bytes.NewBufferString("")
	if len(p.GroupByItems) > 0 {
		fmt.Fprintf(buffer, "group by:%s, ",
			expression.SortedExplainExpressionList(p.GroupByItems))
	}
	if len(p.AggFuncs) > 0 {
		buffer.WriteString("funcs:")
		for i, agg := range p.AggFuncs {
			buffer.WriteString(aggregation.ExplainAggFunc(agg))
			if i+1 < len(p.AggFuncs) {
				buffer.WriteString(", ")
			}
		}
	}
	return buffer.String()
}
1193235
func (s *ClusterRerouteService) Explain(explain bool) *ClusterRerouteService {
	s.explain = &explain
	return s
}
848008
func Fail(t TestingT, failureMessage string, msgAndArgs ...interface{}) {
	if h, ok := t.(tHelper); ok {
		h.Helper()
	}
	if assert.Fail(t, failureMessage, msgAndArgs...) {
		return
	}
	t.FailNow()
}
420128
func (f FailFeeInsufficient) Error() string {
	return fmt.Sprintf("FeeInsufficient(htlc_amt==%v, update=%v", f.HtlcMsat,
		spew.Sdump(f.Update))
}
1275283
func (f *validationFailer) Details() []FailureDetail {
	f.mux.Lock()
	defer f.mux.Unlock()
	return f.details
}
717951
func (s *IndicesAnalyzeService) Explain(explain bool) *IndicesAnalyzeService {
	s.request.Explain = explain
	return s
}
1010108
func (s *UpdateByQueryService) Explain(explain bool) *UpdateByQueryService {
	s.explain = &explain
	return s
}
164402
func Wrap(err error, message string) error {
	return errs.Wrap(err, message)
}
378516
func Describe(val interface{}) string {
	switch val := val.(type) {
	case *usb.Descriptor:
		if v, ok := Vendors[val.Vendor]; ok {
			if d, ok := v.Product[val.Product]; ok {
				return fmt.Sprintf("%s (%s)", d, v)
			}
			return fmt.Sprintf("Unknown (%s)", v)
		}
		return fmt.Sprintf("Unknown %s:%s", val.Vendor, val.Product)
	}
	return fmt.Sprintf("Unknown (%T)", val)
}
1225752
func (fn typeFunc) Describe(exact interface{}, extra ...interface{}) (string, error) {
	values := []reflect.Value{reflect.ValueOf(exact)}
	for _, obj := range extra {
		values = append(values, reflect.ValueOf(obj))
	}
	out := fn.Fn.Call(values)
	s := out[0].Interface().(string)
	var err error
	if !out[1].IsNil() {
		err = out[1].Interface().(error)
	}
	return s, err
}
1132493
func (c *Collector) Describe(ch chan<- *prometheus.Desc) {
	c.TotalConnections.Describe(ch)
	c.APIConnections.Describe(ch)
	c.LoginAttempts.Describe(ch)
	c.APIRequestDuration.Describe(ch)
	c.PingFailureCount.Describe(ch)
	c.LogWriteCount.Describe(ch)
	c.LogReadCount.Describe(ch)

	// TODO (stickupkid): remove post 2.6 release
	c.DeprecatedAPIConnections.Describe(ch)
	c.DeprecatedAPIRequestsTotal.Describe(ch)
	c.DeprecatedAPIRequestDuration.Describe(ch)
}
632969
func (c *causeT) Error() string {
	var buf bytes.Buffer
	buf.WriteString(c.msg)
	c.ctx.writeToBuf(&buf)
	buf.WriteString(": ")
	buf.WriteString(c.cause.Error())
	return buf.String()
}
842891
func (SimpleMetaFactory) Interpret(data []byte) (version, kind string, err error) {
	findKind := struct {
		APIVersion string `json:"apiVersion,omitempty"`
		Kind       string `json:"kind,omitempty"`
	}{}
	err = json.Unmarshal(data, &findKind)
	if err != nil {
		return "", "", fmt.Errorf("couldn't get version/kind; json parse error: %v", err)
	}
	return findKind.APIVersion, findKind.Kind, nil
}
962362
func (f *PlatformFilter) Explain(nodes int) string {
	if nodes == 1 {
		return "unsupported platform on 1 node"
	}
	return fmt.Sprintf("unsupported platform on %d nodes", nodes)
}
1207230
func Cause(err error) error {
	for {
		ews, ok := err.(*ErrorWithStacks)
		if !ok {
			return err
		}
		err = ews.Err
	}
}