// Get an initialized Threefish1024 structure
777056
func newThreefish1024(key []byte, tweak []uint64) (*threefish1024, error) {
    c := new(threefish1024)

    // Initialize tweak 
    setTweak(tweak, c.expanedTweak[:])

    c.expanedKey[EXPANDED_KEY_SIZE_1024-1] = KEY_SCHEDULE_CONST

    // Convert key bytes to required uint64 array
    if key != nil {
        var tmpkey [EXPANDED_KEY_SIZE_1024]uint64
        for i := 0; i < EXPANDED_KEY_SIZE_1024-1; i++ {
            tmpkey[i] = binary.LittleEndian.Uint64(key[i*8 : i*8+8])
        }
        setKey(tmpkey[:], c.expanedKey[:])
    }
    return c, nil
}
938205
func (cs *CommitsService) GetFromBuild(buildId uint) (*Commit, *http.Response, error) {
	u, err := urlWithOptions(fmt.Sprintf("/builds/%d", buildId), nil)
	if err != nil {
		return nil, nil, err
	}

	req, err := cs.client.NewRequest("GET", u, nil, nil)
	if err != nil {
		return nil, nil, err
	}

	var buildResp getBuildResponse
	resp, err := cs.client.Do(req, &buildResp)
	if err != nil {
		return nil, resp, err
	}

	return &buildResp.Commit, resp, nil
}
152315
func getPointerToStruct(oldObj interface{}) interface{} {
	resType := reflect.TypeOf(oldObj)
	ptr := reflect.New(resType)
	ptr.Elem().Set(reflect.ValueOf(oldObj))
	return ptr.Interface()
}
288653
func (lscc *LifeCycleSysCC) getChaincodes(stub shim.ChaincodeStubInterface) pb.Response {
	// get all rows from LSCC
	itr, err := stub.GetStateByRange("", "")

	if err != nil {
		return shim.Error(err.Error())
	}
	defer itr.Close()

	// array to store metadata for all chaincode entries from LSCC
	var ccInfoArray []*pb.ChaincodeInfo

	for itr.HasNext() {
		response, err := itr.Next()
		if err != nil {
			return shim.Error(err.Error())
		}

		// CollectionConfig isn't ChaincodeData
		if privdata.IsCollectionConfigKey(response.Key) {
			continue
		}

		ccdata := &ccprovider.ChaincodeData{}
		if err = proto.Unmarshal(response.Value, ccdata); err != nil {
			return shim.Error(err.Error())
		}

		var path string
		var input string

		// if chaincode is not installed on the system we won't have
		// data beyond name and version
		ccpack, err := lscc.Support.GetChaincodeFromLocalStorage(ccdata.Name, ccdata.Version)
		if err == nil {
			path = ccpack.GetDepSpec().GetChaincodeSpec().ChaincodeId.Path
			input = ccpack.GetDepSpec().GetChaincodeSpec().Input.String()
		}

		// add this specific chaincode's metadata to the array of all chaincodes
		ccInfo := &pb.ChaincodeInfo{Name: ccdata.Name, Version: ccdata.Version, Path: path, Input: input, Escc: ccdata.Escc, Vscc: ccdata.Vscc}
		ccInfoArray = append(ccInfoArray, ccInfo)
	}
	// add array with info about all instantiated chaincodes to the query
	// response proto
	cqr := &pb.ChaincodeQueryResponse{Chaincodes: ccInfoArray}

	cqrbytes, err := proto.Marshal(cqr)
	if err != nil {
		return shim.Error(err.Error())
	}

	return shim.Success(cqrbytes)
}
315828
func (c *ContainerServer) GetInfraContainer(id string) *oci.Container {
	return c.state.infraContainers.Get(id)
}
1134076
func (p *propInterfaces) GetFirstInterface() *Interface {
	if len(p.Interfaces) == 0 {
		return nil
	}
	return &p.Interfaces[0]
}
309116
func (i *Instance) initializeChains() error {

	cfg, err := i.newACLInfo(0, "", nil, 0)
	if err != nil {
		return err
	}

	tmpl := template.Must(template.New(triremChains).Funcs(template.FuncMap{
		"isLocalServer": func() bool {
			return i.mode == constants.LocalServer
		},
	}).Parse(triremChains))

	rules, err := extractRulesFromTemplate(tmpl, cfg)
	if err != nil {
		return fmt.Errorf("unable to create trireme chains:%s", err)
	}

	for _, rule := range rules {
		if len(rule) != 4 {
			continue
		}
		if err := i.ipt.NewChain(rule[1], rule[3]); err != nil {
			return err
		}
	}

	return nil
}
940055
func (r *MachineInitReader) GetInitConfig() (map[string]interface{}, error) {
	series := r.config.Series

	containerOS, err := utilsseries.GetOSFromSeries(series)
	if err != nil {
		return nil, errors.Trace(err)
	}
	switch containerOS {
	case utilsos.Ubuntu, utilsos.CentOS, utilsos.OpenSUSE:
		if series != utilsseries.MustHostSeries() {
			logger.Debugf("not attempting to get init config for %s, series of machine and container differ", series)
			return nil, nil
		}
	default:
		logger.Debugf("not attempting to get init config for %s container", series)
		return nil, nil
	}

	machineCloudInitData, err := r.getMachineCloudCfgDirData()
	if err != nil {
		return nil, errors.Trace(err)
	}

	file := filepath.Join(r.config.CloudInitInstanceConfigDir, "vendor-data.txt")
	vendorData, err := r.unmarshallConfigFile(file)
	if err != nil {
		return nil, errors.Trace(err)
	}
	for k, v := range vendorData {
		machineCloudInitData[k] = v
	}

	_, curtinData, err := fileAsConfigMap(r.config.CurtinInstallConfigFile)
	if err != nil {
		return nil, errors.Trace(err)
	}
	for k, v := range curtinData {
		machineCloudInitData[k] = v
	}

	return machineCloudInitData, nil
}
976999
func GetHeader(bytes []byte) (*common.Header, error) {
	hdr := &common.Header{}
	err := proto.Unmarshal(bytes, hdr)
	return hdr, errors.Wrap(err, "error unmarshaling Header")
}
509068
func GetInitSystem() (InitSystem, error) {
	// Assume existence of systemctl in path implies this is a systemd system:
	_, err := exec.LookPath("systemctl")
	if err == nil {
		return &SystemdInitSystem{}, nil
	}
	_, err = exec.LookPath("wininit.exe")
	if err == nil {
		return &WindowsInitSystem{}, nil
	}
	return nil, fmt.Errorf("no supported init system detected, skipping checking for services")
}
1095207
func (s *ChainService) GetBlockHeader(
	blockHash *chainhash.Hash) (*wire.BlockHeader, error) {
	header, _, err := s.BlockHeaders.FetchHeader(blockHash)
	return header, err
}
888413
func (s *GenericStorage) GetMulti(keys ...interface{}) ([]interface{}, error) {
	if s.get == nil && s.getMulti == nil {
		return nil, errors.Newf(
			"'%s' does not have Get/GetMulti implementation",
			s.name)
	}

	s.rwMutex.RLock()
	defer s.rwMutex.RUnlock()

	if s.getMulti != nil {
		return s.getMulti(keys...)
	}

	results := make([]interface{}, len(keys))
	for i, key := range keys {
		item, err := s.get(key)
		if err != nil {
			return nil, err
		}
		results[i] = item
	}
	return results, nil
}
1266165
func (c *priorityClasses) Get(name string, options v1.GetOptions) (result *v1alpha1.PriorityClass, err error) {
	result = &v1alpha1.PriorityClass{}
	err = c.client.Get().
		Resource("priorityclasses").
		Name(name).
		VersionedParams(&options, scheme.ParameterCodec).
		Do().
		Into(result)
	return
}
634430
func Get() apimachineryversion.Info {
	// These variables typically come from -ldflags settings and in
	// their absence fallback to the settings in ./base.go
	return apimachineryversion.Info{
		Major:        gitMajor,
		Minor:        gitMinor,
		GitVersion:   gitVersion,
		GitCommit:    gitCommit,
		GitTreeState: gitTreeState,
		BuildDate:    buildDate,
		GoVersion:    runtime.Version(),
		Compiler:     runtime.Compiler,
		Platform:     fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH),
	}
}
1053605
func (obj *GenericObject) GetInfo(ctx context.Context) (*NxInfo, error) {
	result := &struct {
		Info *NxInfo	`json:"qInfo"`
	} {}
	err := obj.rpc(ctx, "GetInfo", result)
	return result.Info, err 
}
1210198
func (c *Client) FetchStruct(bucket, key string, out interface{}) (*RpbGetResp, error) {
	return c.fetchStruct(nil, bucket, key, out)
}
535780
func (c *thirdPartyResources) Get(name string) (result *extensions.ThirdPartyResource, err error) {
	result = &extensions.ThirdPartyResource{}
	err = c.r.Get().Namespace(c.ns).Resource("thirdpartyresources").Name(name).Do().Into(result)
	return
}