// GetVerdict returns the verdict performed on the flow (forwarded|denied)
547210
func GetVerdict(m *cilium.LogEntry) accesslog.FlowVerdict {
	// the default verdict is forwarded
	result := accesslog.VerdictForwarded

	if m != nil {
		switch m.EntryType {
		case cilium.EntryType_Denied:
			result = accesslog.VerdictDenied
		}
	}

	return result
}
1186550
func GetFact(fact string, file string, log *logrus.Entry) ([]byte, gjson.Result, error) {
	j, err := JSON(file, log)
	if err != nil {
		return nil, gjson.Result{}, err
	}

	found := gjson.GetBytes(j, fact)
	if !found.Exists() {
		return nil, gjson.Result{}, nil
	}

	return j, found, nil
}
1132319
func (s *VirtualMachineService) GetVMPassword(p *GetVMPasswordParams) (*GetVMPasswordResponse, error) {
	resp, err := s.cs.newRequest("getVMPassword", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r GetVMPasswordResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
324676
func (p *BlockPrefetchClient) GetBlock(hash *chainhash.Hash) (*wire.MsgBlock, error) {
	msgBlock, _, err := p.GetBlockData(hash)
	return msgBlock, err
}
815367
func getPayload(c context.Context) *Payload {
	p, _ := c.Value(&pldKey).(*Payload)
	return p
}
1149163
func (obj *Doc) GetVariable(ctx context.Context, name string) (*Variable, error) {
	result := &struct {
		Return *ObjectInterface	`json:"qReturn"`
	} {}
	err := obj.rpc(ctx, "GetVariable", result, name)
	if err != nil {
		return nil, err
	}
	return &Variable{obj.session.getRemoteObject(result.Return)}, err 
}
985257
func (r *ProtoKeyValWrapper) GetPrevValue(prevValue proto.Message) (prevValueExist bool, err error) {
	exists, err := r.ProtoKeyVal.GetPrevValue(prevValue)
	if !exists || err != nil {
		return exists, err
	}
	_, err = r.decrypter.Decrypt(prevValue, r.decryptFunc)
	return exists, err
}
1214847
func GetFlowType(m *cilium.LogEntry) accesslog.FlowType {
	// the fall back type is request
	result := accesslog.TypeRequest

	if m != nil {
		switch m.EntryType {
		case cilium.EntryType_Denied:
			result = accesslog.TypeRequest
		case cilium.EntryType_Request:
			result = accesslog.TypeRequest
		case cilium.EntryType_Response:
			result = accesslog.TypeResponse
		}
	}

	return result
}
984016
func (client *Instance) GetJSON(v interface{}) (statusCode int, err error) {
	statusCode, body, err := client.GET()
	if err != nil {
		return 0, err
	}

	return statusCode, json.NewDecoder(bytes.NewReader(body)).Decode(&v)
}
1077783
func (p *NFPacket) SetVerdictWithPacket(v Verdict, packet []byte) {
	p.verdictChannel <- VerdictContainer{Verdict: v, Packet: packet}
}
331481
func (n *NameProvider) GetJSONName(subject interface{}, name string) (string, bool) {
	tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
	return n.GetJSONNameForType(tpe, name)
}
423992
func (c *Client) GetBlockVerbose(blockHash *chainhash.Hash) (*btcjson.GetBlockVerboseResult, error) {
	return c.GetBlockVerboseAsync(blockHash).Receive()
}
574484
func (l *LoadAvg) Get() error {
	var sysinfo syscall.Sysinfo_t
	err := syscall.Sysinfo(&sysinfo)
	if err != nil {
		return err
	}
	l.Timestamp = time.Now().UTC().UnixNano()
	l.One = float64(sysinfo.Loads[0]) / LoadsScale
	l.Five = float64(sysinfo.Loads[1]) / LoadsScale
	l.Fifteen = float64(sysinfo.Loads[2]) / LoadsScale
	return nil
}
831718
func GetBlockVerbose(client *rpcclient.Client, idx int64, verboseTx bool) *dcrjson.GetBlockVerboseResult {
	blockhash, err := client.GetBlockHash(idx)
	if err != nil {
		log.Errorf("GetBlockHash(%d) failed: %v", idx, err)
		return nil
	}

	blockVerbose, err := client.GetBlockVerbose(blockhash, verboseTx)
	if err != nil {
		log.Errorf("GetBlockVerbose(%v) failed: %v", blockhash, err)
		return nil
	}

	return blockVerbose
}
795257
func getRevInfo(resp *http.Response) (string, error) {
	if rev := resp.Header.Get("ETag"); rev == "" {
		var dbResponse struct {
			Ok  bool   `json:"ok"`
			Id  string `json:"id"`
			Rev string `json:"rev"`
		}
		// if ETag header isn't present, attempt to get the rev from the response body
		// see: https://issues.apache.org/jira/browse/COUCHDB-2853
		json.NewDecoder(resp.Body).Decode(&dbResponse)
		if dbResponse.Rev != "" {
			return dbResponse.Rev, nil
		}
		return "", fmt.Errorf("CouchDB did not return rev info")
	} else {
		return rev[1 : len(rev)-1], nil
	}
}
543128
func (that *JSONNode) Get() interface{} {
	if that.t != TypeValue {
		panic(ErrorRetrieveUserValue)
	}
	if that.vChanged {
		rv := reflect.ValueOf(that.v)
		return rv.Elem().Interface()
	}
	return that.v
}
1255319
func GetJSONPathValue(obj interface{}, path string, allowMissingKeys bool) (interface{}, error) {
	j := jsonpath.New("GetJSONPathValue")
	// If the key is missing, return an empty string without errors
	j.AllowMissingKeys(allowMissingKeys)
	err := j.Parse(path)
	if err != nil {
		return "", errors.Wrapf(err, "JsonPath parse %s error", path)
	}
	values, err := j.FindResults(obj)
	if err != nil {
		return "", errors.Wrap(err, "JsonPath execute error")
	}
	if len(values) == 0 {
		return nil, nil
	}
	if len(values) > 1 {
		return nil, errors.Errorf("single result expected, got %d", len(values))
	}
	if values[0] == nil || len(values[0]) == 0 || values[0][0].IsNil() {
		return nil, nil
	}
	return values[0][0].Interface(), nil
}