// Sets the SR's physical_utilisation field
428110
func (_class SRClass) SetPhysicalUtilisation(sessionID SessionRef, self SRRef, value int) (_err error) {
	_method := "SR.set_physical_utilisation"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertSRRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_valueArg, _err := convertIntToXen(fmt.Sprintf("%s(%s)", _method, "value"), value)
	if _err != nil {
		return
	}
	_, _err =  _class.client.APICall(_method, _sessionIDArg, _selfArg, _valueArg)
	return
}
1333029
func (d *Lepton3) SetRadiometry(enable bool) error {
	if err := d.cciDev.SetRadiometry(enable); err != nil {
		return fmt.Errorf("SetRadiometry: %v", err)
	}
	return nil
}
1271696
func (s *GetApplicationSettingsOutput) SetApplicationSettingsResource(v *ApplicationSettingsResource) *GetApplicationSettingsOutput {
	s.ApplicationSettingsResource = v
	return s
}
605146
func (s *Offering) SetUsagePrice(v float64) *Offering {
	s.UsagePrice = &v
	return s
}
425331
func (s *StackResourceDetail) SetPhysicalResourceId(v string) *StackResourceDetail {
	s.PhysicalResourceId = &v
	return s
}
792309
func (p *Aggregation) convert2PhysicalPlan(prop *requiredProperty) (*physicalPlanInfo, error) {
	planInfo, err := p.getPlanInfo(prop)
	if err != nil {
		return nil, errors.Trace(err)
	}
	if planInfo != nil {
		return planInfo, nil
	}
	limit := prop.limit
	if len(prop.props) == 0 {
		planInfo, err = p.convert2PhysicalPlanHash()
		if err != nil {
			return nil, errors.Trace(err)
		}
	}
	streamInfo, err := p.convert2PhysicalPlanStream(removeLimit(prop))
	if planInfo == nil || streamInfo.cost < planInfo.cost {
		planInfo = streamInfo
	}
	planInfo = enforceProperty(limitProperty(limit), planInfo)
	err = p.storePlanInfo(prop, planInfo)
	return planInfo, errors.Trace(err)
}
827531
func (p *Apply) convert2PhysicalPlan(prop *requiredProperty) (*physicalPlanInfo, error) {
	info, err := p.getPlanInfo(prop)
	if err != nil {
		return info, errors.Trace(err)
	}
	if info != nil {
		return info, nil
	}
	if p.JoinType == InnerJoin {
		info, err = p.Join.convert2PhysicalPlanLeft(prop, true)
	} else {
		info, err = p.Join.convert2PhysicalPlanSemi(prop)
	}
	if err != nil {
		return info, errors.Trace(err)
	}
	switch info.p.(type) {
	case *PhysicalHashJoin, *PhysicalHashSemiJoin:
		ap := &PhysicalApply{
			PhysicalJoin: info.p,
			OuterSchema:  p.corCols,
		}
		ap.tp = App
		ap.allocator = p.allocator
		ap.initIDAndContext(p.ctx)
		ap.SetChildren(info.p.GetChildren()...)
		ap.SetSchema(info.p.GetSchema())
		info.p = ap
	default:
		info.cost = math.MaxFloat64
		info.p = nil
	}
	p.storePlanInfo(prop, info)
	return info, nil
}
226054
func (c *Client) SetMetricCredentials(application string, credentials []byte) error {
	creds := []params.ApplicationMetricCredential{
		{application, credentials},
	}
	p := params.ApplicationMetricCredentials{Creds: creds}
	results := new(params.ErrorResults)
	err := c.facade.FacadeCall("SetMetricCredentials", p, results)
	if err != nil {
		return errors.Trace(err)
	}
	return errors.Trace(results.OneError())
}
626735
func (s *Restrictions) SetGeoRestriction(v *GeoRestriction) *Restrictions {
	s.GeoRestriction = v
	return s
}
1176368
func (srv *Service) SetURLBase(urlBase *url.URL) {
	srv.SCPDURL.SetURLBase(urlBase)
	srv.ControlURL.SetURLBase(urlBase)
	srv.EventSubURL.SetURLBase(urlBase)
}
752387
func (c *Client) SetUnitResource(modelUUID, unit string, res resource.Resource) error {
	args := makeResourceArgs(res)
	args.Add("unit", unit)
	err := c.resourcePost(modelUUID, args, nil)
	return errors.Trace(err)
}
1325103
func (opts *Options) SetCompression(value CompressionType) {
	C.rocksdb_options_set_compression(opts.c, C.int(value))
}
590944
func (opts *Options) SetSoftPendingCompactionBytesLimit(value uint64) {
	C.rocksdb_options_set_soft_pending_compaction_bytes_limit(opts.c, C.size_t(value))
}
619684
func (c *Controller) setAppControllerFields() {
	appController := reflect.ValueOf(c.AppController).Elem()
	cValue := reflect.ValueOf(c)
	for _, index := range c.Type.ControllerIndexes {
		appController.FieldByIndex(index).Set(cValue)
	}
}
763202
func (s *StackResourceDrift) SetPhysicalResourceId(v string) *StackResourceDrift {
	s.PhysicalResourceId = &v
	return s
}
518204
func (a *AdafruitMotorHatDriver) SetServoMotorPulse(channel byte, on, off int32) (err error) {
	if err = a.setPWM(a.servoHatConnection, channel, on, off); err != nil {
		return
	}
	return
}
167671
func (p *Aggregation) convert2PhysicalPlanStream(prop *requiredProperty) (*physicalPlanInfo, error) {
	for _, aggFunc := range p.AggFuncs {
		if aggFunc.GetMode() == expression.FinalMode {
			return &physicalPlanInfo{cost: math.MaxFloat64}, nil
		}
	}
	agg := &PhysicalAggregation{
		AggType:      StreamedAgg,
		AggFuncs:     p.AggFuncs,
		GroupByItems: p.GroupByItems,
	}
	agg.tp = "StreamAgg"
	agg.allocator = p.allocator
	agg.initIDAndContext(p.ctx)
	agg.HasGby = len(p.GroupByItems) > 0
	agg.SetSchema(p.schema)
	// TODO: Consider distinct key.
	info := &physicalPlanInfo{cost: math.MaxFloat64}
	gbyCols := p.groupByCols
	if len(gbyCols) != len(p.GroupByItems) {
		// group by a + b is not interested in any order.
		return info, nil
	}
	isSortKey := make([]bool, len(gbyCols))
	newProp := &requiredProperty{
		props: make([]*columnProp, 0, len(gbyCols)),
	}
	for _, pro := range prop.props {
		idx := p.getGbyColIndex(pro.col)
		if idx == -1 {
			return info, nil
		}
		isSortKey[idx] = true
		// We should add columns in aggregation in order to keep index right.
		newProp.props = append(newProp.props, &columnProp{col: gbyCols[idx], desc: pro.desc})
	}
	newProp.sortKeyLen = len(newProp.props)
	for i, col := range gbyCols {
		if !isSortKey[i] {
			newProp.props = append(newProp.props, &columnProp{col: col})
		}
	}
	childInfo, err := p.children[0].(LogicalPlan).convert2PhysicalPlan(newProp)
	if err != nil {
		return nil, errors.Trace(err)
	}
	info = addPlanToResponse(agg, childInfo)
	info.cost += float64(info.count) * cpuFactor
	info.count = uint64(float64(info.count) * aggFactor)
	return info, nil
}