// formatListSummary returns a tabular summary of remote application offers or
// errors out if parameter is not of expected type.
170557
func formatListSummary(writer io.Writer, value interface{}) error {
	offers, ok := value.(offeredApplications)
	if !ok {
		return errors.Errorf("expected value of type %T, got %T", offers, value)
	}
	return formatListEndpointsSummary(writer, offers)
}
796381
func (m *MockReporter) ReportSummary(metric string, tags map[string]string, value float64) error {
	ret := m.ctrl.Call(m, "ReportSummary", metric, tags, value)
	ret0, _ := ret[0].(error)
	return ret0
}
1051382
func (e Error) formatParams() string {
	if e.Params == nil || len(e.Params) == 0 {
		return "[]"
	}

	var keyValuePairs []struct {
		key   string
		value string
	}

	for k, v := range e.Params {
		keyValuePairs = append(keyValuePairs, struct {
			key   string
			value string
		}{
			key:   k,
			value: v,
		})
	}
	sort.Slice(keyValuePairs, func(i, j int) bool {
		return keyValuePairs[i].key < keyValuePairs[j].key
	})

	result := "["
	l := len(keyValuePairs)
	for i, kvp := range keyValuePairs {
		result += kvp.key + ":" + kvp.value
		if i < l-1 {
			result += ", "
		}
	}
	result += "]"
	return result
}
895201
func (l *Client) GetTopicSummary(topic string, limit int) (TopicSummary, error) {
	res := ApiResp{}
	data := TopicSummary{}
	params := url.Values{}

	if limit > 0 {
		params.Add("limit", strconv.Itoa(limit))
	}

	err := l.Get(parseLyticsURL(topicEndpoint, map[string]string{"topicId": topic}), params, nil, &res, &data)
	if err != nil {
		return data, err
	}

	return data, nil
}
35369
func (s *DeletePlatformVersionOutput) SetPlatformSummary(v *PlatformSummary) *DeletePlatformVersionOutput {
	s.PlatformSummary = v
	return s
}
455907
func (db *BytesConnectionRedis) ListValues(match string) (keyval.BytesKeyValIterator, error) {
	if db.closed {
		return nil, fmt.Errorf("ListValues(%s) called on a closed connection", match)
	}
	return listValues(db, match, nil, nil)
}
880666
func NewSummary(opts prometheus.SummaryOpts) prometheus.Summary {
	s := prometheus.NewSummary(opts)
	prometheus.MustRegister(s)
	return s
}
646493
func (e *Empire) ListScale(ctx context.Context, app *App) (Formation, error) {
	return currentFormation(e.db, app)
}
604745
func formatListWithSpaces(in []string) string {
	columnConf := columnize.DefaultConfig()
	return columnize.Format(in, columnConf)
}
224518
func locatorSummary(locator []*chainhash.Hash, stopHash *chainhash.Hash) string {
	if len(locator) > 0 {
		return fmt.Sprintf("locator %s, stop %s", locator[0], stopHash)
	}

	return fmt.Sprintf("no locator, stop %s", stopHash)

}
1021237
func (s Byte) List() []byte {
	res := make(sortableSliceOfByte, 0, len(s))
	for key := range s {
		res = append(res, key)
	}
	sort.Sort(res)
	return []byte(res)
}
102500
func (client *Client) ListAssemblies(ctx context.Context, options *ListOptions) (AssemblyList, error) {
	var assemblies AssemblyList
	err := client.listRequest(ctx, "assemblies", options, &assemblies)

	return assemblies, err
}
198429
func generateListStorageOutput(ctx *cmd.Context, api StorageListAPI) (map[string]StorageInfo, error) {
	results, err := api.ListStorageDetails()
	if err != nil {
		return nil, errors.Trace(err)
	}
	if len(results) == 0 {
		return nil, nil
	}
	return formatStorageDetails(results)
}
607639
func (c *Client) GetSummary() (SummaryResponse, error) {
	s := SummaryResponse{}
	err := c.request("api/v2/summary.json", &s)
	return s, err
}
106248
func ListFormatWrite(ctx formatter.Context, services []swarm.Service, info map[string]ListInfo) error {
	render := func(format func(subContext formatter.SubContext) error) error {
		for _, service := range services {
			serviceCtx := &serviceContext{service: service, mode: info[service.ID].Mode, replicas: info[service.ID].Replicas}
			if err := format(serviceCtx); err != nil {
				return err
			}
		}
		return nil
	}
	serviceCtx := serviceContext{}
	serviceCtx.Header = formatter.SubHeaderContext{
		"ID":       serviceIDHeader,
		"Name":     formatter.NameHeader,
		"Mode":     modeHeader,
		"Replicas": replicasHeader,
		"Image":    formatter.ImageHeader,
		"Ports":    formatter.PortsHeader,
	}
	return ctx.Write(&serviceCtx, render)
}
813215
func (k *ksonnetApp) ListParams(environment string) ([]*v1alpha1.KsonnetParameter, error) {
	args := []string{"param", "list", "--output", "json"}
	if environment != "" {
		args = append(args, "--env", environment)
	}
	out, err := k.ksCmd(args...)
	if err != nil {
		return nil, err
	}
	// Auxiliary data to hold unmarshaled JSON output, which may use different field names
	var ksParams struct {
		Data []struct {
			Component string `json:"component"`
			Key       string `json:"param"`
			Value     string `json:"value"`
		} `json:"data"`
	}
	if err := json.Unmarshal([]byte(out), &ksParams); err != nil {
		return nil, err
	}
	var params []*v1alpha1.KsonnetParameter
	for _, ksParam := range ksParams.Data {
		value := strings.Trim(ksParam.Value, `'"`)
		params = append(params, &v1alpha1.KsonnetParameter{
			Component: ksParam.Component,
			Name:      ksParam.Key,
			Value:     value,
		})
	}
	return params, nil
}
594139
func (s *ApprovalResult) SetSummary(v string) *ApprovalResult {
	s.Summary = &v
	return s
}