// Results returns the structured output of the action and any error.
162332
func (a *action) Results() (map[string]interface{}, string) {
	return a.doc.Results, a.doc.Message
}
333233
func (f *F) Result() (interface{}, error) {
	<-f.done
	f.mu.Lock()
	defer f.mu.Unlock()
	return f.result, f.err
}
1079801
func (c *Client) Result(req *Request, resp interface{}) error {
	result, err := c.Do(req)
	if err != nil {
		return err
	}
	return unmarshal(result, resp)
}
839163
func (c *MockConnection) Result(operation Operation) (ResultDesc, bool) {
	op, ok := c.operations[operation]
	return op, ok
}
879352
func (q Query) Results() (r []interface{}) {
	next := q.Iterate()

	for item, ok := next(); ok; item, ok = next() {
		r = append(r, item)
	}

	return
}
1126551
func printQueryResult(writer io.Writer, qr *sqltypes.Result) {
	table := tablewriter.NewWriter(writer)
	table.SetAutoFormatHeaders(false)

	// Make header.
	header := make([]string, 0, len(qr.Fields))
	for _, field := range qr.Fields {
		header = append(header, field.Name)
	}
	table.SetHeader(header)

	// Add rows.
	for _, row := range qr.Rows {
		vals := make([]string, 0, len(row))
		for _, val := range row {
			vals = append(vals, val.ToString())
		}
		table.Append(vals)
	}

	// Print table.
	table.Render()
}
659009
func (cf *concatFunction) GetResult(evalCtx *AggEvaluateContext) (d types.Datum) {
	if evalCtx.Buffer != nil {
		d.SetString(evalCtx.Buffer.String())
	} else {
		d.SetNull()
	}
	return d
}
89970
func (this *SubscribeResponse) PrintResults() {

	fmt.Println("Response Status: ", this.Status)
	fmt.Println("Response Code  : ", this.StatusCode)
	if this.StatusCode != 200 {
		fmt.Println("Error          : ", this.Error)
	}

}
455680
func (r Result) Status() model.Status {
	switch r {
	case NoResult:
		return model.Running
	case Success:
		return model.Success
	case Warning:
		return model.Warning
	case Failure:
		return model.Failure
	case Skipped:
		return model.NotRun
	case Exception, Retry:
		return model.Exception
	default:
		panic(fmt.Errorf("unknown status %d", r))
	}
}
239519
func (q *queue) Results(block bool) []*fetchResult {
	q.lock.Lock()
	defer q.lock.Unlock()

	// Count the number of items available for processing
	nproc := q.countProcessableItems()
	for nproc == 0 && !q.closed {
		if !block {
			return nil
		}
		q.active.Wait()
		nproc = q.countProcessableItems()
	}
	// Since we have a batch limit, don't pull more into "dangling" memory
	if nproc > maxResultsProcess {
		nproc = maxResultsProcess
	}
	results := make([]*fetchResult, nproc)
	copy(results, q.resultCache[:nproc])
	if len(results) > 0 {
		// Mark results as done before dropping them from the cache.
		for _, result := range results {
			hash := result.Header.Hash()
			delete(q.blockDonePool, hash)
			delete(q.receiptDonePool, hash)
		}
		// Delete the results from the cache and clear the tail.
		copy(q.resultCache, q.resultCache[nproc:])
		for i := len(q.resultCache) - nproc; i < len(q.resultCache); i++ {
			q.resultCache[i] = nil
		}
		// Advance the expected block number of the first cache entry.
		q.resultOffset += uint64(nproc)

		// Recalculate the result item weights to prevent memory exhaustion
		for _, result := range results {
			size := result.Header.Size()
			for _, uncle := range result.Uncles {
				size += uncle.Size()
			}
			for _, receipt := range result.Receipts {
				size += receipt.Size()
			}
			for _, tx := range result.Transactions {
				size += tx.Size()
			}
			q.resultSize = common.StorageSize(blockCacheSizeWeight)*size + (1-common.StorageSize(blockCacheSizeWeight))*q.resultSize
		}
	}
	return results
}
128617
func (r *Result) Error() string {
	if r.Err != nil {
		return r.Err.Error()
	}

	return ""
}
545273
func (a *ActionAPI) Actions(arg params.Entities) (params.ActionResults, error) {
	if err := a.checkCanRead(); err != nil {
		return params.ActionResults{}, errors.Trace(err)
	}

	response := params.ActionResults{Results: make([]params.ActionResult, len(arg.Entities))}
	for i, entity := range arg.Entities {
		currentResult := &response.Results[i]
		tag, err := names.ParseTag(entity.Tag)
		if err != nil {
			currentResult.Error = common.ServerError(common.ErrBadId)
			continue
		}
		actionTag, ok := tag.(names.ActionTag)
		if !ok {
			currentResult.Error = common.ServerError(common.ErrBadId)
			continue
		}
		m, err := a.state.Model()
		if err != nil {
			return params.ActionResults{}, errors.Trace(err)
		}
		action, err := m.ActionByTag(actionTag)
		if err != nil {
			currentResult.Error = common.ServerError(common.ErrBadId)
			continue
		}
		receiverTag, err := names.ActionReceiverTag(action.Receiver())
		if err != nil {
			currentResult.Error = common.ServerError(err)
			continue
		}
		response.Results[i] = common.MakeActionResult(receiverTag, action)
	}
	return response, nil
}
1357036
func (this *InstanceIdInfoResponse) PrintResults() {
	fmt.Println("Error     : ", this.Error)
	fmt.Println("App       : ", this.Application)
	fmt.Println("Auth      : ", this.AuthorizedEntity)
	fmt.Println("Ver       : ", this.ApplicationVersion)
	fmt.Println("Sig       : ", this.AppSigner)
	fmt.Println("Att       : ", this.AttestStatus)
	fmt.Println("Platform  : ", this.Platform)
	fmt.Println("Connection: ", this.ConnectionType)
	fmt.Println("ConnDate  : ", this.ConnectDate)
	fmt.Println("Rel       : ")
	for k, v := range this.Rel {
		fmt.Println(k, " --> ")
		for k2, v2 := range v {
			fmt.Println("\t", k2, "\t|")
			fmt.Println("\t\t", "addDate", " : ", v2["addDate"])
		}
	}
}
1146531
func (r *AnnotationSearchResponse) ResultsWithScore(score int) []*Annotation {
	var res []*Annotation
	for _, v := range r.Annotations {
		if r.Scores[v] >= score {
			res = append(res, v)
		}
	}
	return res
}
959423
func (result *Result) AppendResult(src *Result) {
	if src.RowsAffected == 0 && len(src.Fields) == 0 {
		return
	}
	if result.Fields == nil {
		result.Fields = src.Fields
	}
	result.RowsAffected += src.RowsAffected
	if src.InsertID != 0 {
		result.InsertID = src.InsertID
	}
	if len(result.Rows) == 0 {
		// we haven't gotten any result yet, just save the new extras.
		result.Extras = src.Extras
	} else {
		// Merge the EventTokens / Fresher flags within Extras.
		if src.Extras == nil {
			// We didn't get any from innerq. Have to clear any
			// we'd have gotten already.
			if result.Extras != nil {
				result.Extras.EventToken = nil
				result.Extras.Fresher = false
			}
		} else {
			// We may have gotten an EventToken from
			// innerqr.  If we also got one earlier, merge
			// it. If we didn't get one earlier, we
			// discard the new one.
			if result.Extras != nil {
				// Note if any of the two is nil, we get nil.
				result.Extras.EventToken = EventTokenMinimum(result.Extras.EventToken, src.Extras.EventToken)

				result.Extras.Fresher = result.Extras.Fresher && src.Extras.Fresher
			}
		}
	}
	result.Rows = append(result.Rows, src.Rows...)
}
384047
func (s *Search) Result(parser ResultParser) (*SolrResult, error) {
	resp, err := s.Resource("select", s.QueryParams())
	if err != nil {
		return nil, err
	}
	if parser == nil {
		parser = new(StandardResultParser)
	}
	return parser.Parse(resp)
}
726294
func (p *ProcessingResult) WriteResult(r interface{}) error {
	blob, err := json.Marshal(r)
	switch {
	case err != nil:
		return errors.Annotate(err, "failed to serialize the result").Err()
	case len(blob) == 0 || blob[0] != '{':
		return errors.Reason("the result is not a JSON object").Err()
	}
	out := bytes.Buffer{}
	z := zlib.NewWriter(&out)
	if _, err := io.Copy(z, bytes.NewReader(blob)); err != nil {
		z.Close()
		return errors.Annotate(err, "failed to compress the result").Err()
	}
	if err := z.Close(); err != nil {
		return errors.Annotate(err, "failed to close zlib writer").Err()
	}
	p.ResultRaw = out.Bytes()
	return nil
}