// Bindings returns the list of bindings available on the graph clauses for he
// statement.
544596
func (s *Statement) Bindings() []string {
	var bs []string
	for k := range s.BindingsMap() {
		bs = append(bs, k)
	}
	return bs
}
1319649
func (g *Graph) Vertices() []Vertex {
	list := g.vertices.List()
	result := make([]Vertex, len(list))
	for i, v := range list {
		result[i] = v.(Vertex)
	}

	return result
}
614998
func (f *FrequencyPlan) ADRSettings(dataRate string, txPower int, snr float32, deviceMargin float32) (desiredDataRate string, desiredTxPower int, err error) {
	if f.ADR == nil {
		return dataRate, txPower, ErrADRUnavailable
	}
	margin := linkMargin(dataRate, snr) - deviceMargin
	drIdx, err := f.GetDataRateIndexFor(dataRate)
	if err != nil {
		return dataRate, txPower, err
	}
	nStep := int(margin / 3)

	// Increase the data rate with each step
	for nStep > 0 && drIdx < f.ADR.MaxDataRate {
		drIdx++
		nStep--
	}

	nStep = int(float32(nStep*3) / float32(f.ADR.StepTXPower))
	// Decrease the Tx power by f.ADR.StepTXPower for each step, until min reached
	for nStep > 0 && txPower > f.ADR.MinTXPower {
		txPower -= f.ADR.StepTXPower
		nStep--
	}
	if txPower < f.ADR.MinTXPower {
		txPower = f.ADR.MinTXPower
	}

	// Increase the Tx power by 3 for each step, until max reached
	for nStep < 0 && txPower < f.ADR.MaxTXPower {
		txPower += f.ADR.StepTXPower
		nStep++
	}
	if txPower > f.ADR.MaxTXPower {
		txPower = f.ADR.MaxTXPower
	}

	desiredDataRate, err = f.GetDataRateStringForIndex(drIdx)
	if err != nil {
		return dataRate, txPower, err // This should maybe panic; it means that f.ADR is incosistent with f.DataRates
	}
	return desiredDataRate, txPower, nil
}
274445
func orderByBindings() ElementHook {
	var f func(st *Statement, ce ConsumedElement) (ElementHook, error)
	f = func(st *Statement, ce ConsumedElement) (ElementHook, error) {
		if ce.IsSymbol() {
			return f, nil
		}
		tkn := ce.Token()
		switch tkn.Type {
		case lexer.ItemBinding:
			st.orderBy = append(st.orderBy, table.SortConfig{{Binding: tkn.Text}}...)
		case lexer.ItemAsc:
			st.orderBy[len(st.orderBy)-1].Desc = false
		case lexer.ItemDesc:
			st.orderBy[len(st.orderBy)-1].Desc = true
		}
		return f, nil
	}
	return f
}
226789
func (s *SubmitContainerStateChangeInput) SetNetworkBindings(v []*NetworkBinding) *SubmitContainerStateChangeInput {
	s.NetworkBindings = v
	return s
}
376319
func NewBindArgs(port int) *BindArgs {
	args := new(BindArgs)
	args.Port = port
	return args
}
1121711
func (q *Queryx) BindStruct(arg interface{}) *Queryx {
	arglist, err := bindStructArgs(q.Names, arg, nil, q.Mapper)
	if err != nil {
		q.err = fmt.Errorf("bind error: %s", err)
	} else {
		q.err = nil
		q.Bind(arglist...)
	}

	return q
}
244566
func (mr *MockRbacV1InterfaceMockRecorder) RoleBindings(arg0 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RoleBindings", reflect.TypeOf((*MockRbacV1Interface)(nil).RoleBindings), arg0)
}
692521
func (g *Gui) DeleteKeybindings(viewname string) {
	var s []*keybinding
	for _, kb := range g.keybindings {
		if kb.viewName != viewname {
			s = append(s, kb)
		}
	}
	g.keybindings = s
}
559794
func (c *Constrainer) MatchConstraints(tags []string) (bool, *types.Constraint) {
	// if there is no tags and no constraints, filtering is disabled
	if len(tags) == 0 && len(c.Constraints) == 0 {
		return true, nil
	}

	for _, constraint := range c.Constraints {
		// xor: if ok and constraint.MustMatch are equal, then no tag is currently matching with the constraint
		if ok := constraint.MatchConstraintWithAtLeastOneTag(tags); ok != constraint.MustMatch {
			return false, constraint
		}
	}

	// If no constraint or every constraints matching
	return true, nil
}
431748
func (s *ServiceBinding) SetBindDetails(dt brokerapi.BindDetails) {
	s.AppGUID = dt.AppGUID
	s.PlanID = dt.PlanID
	s.ServiceID = dt.ServiceID
	b, _ := json.Marshal(dt.Parameters)
	s.Parameters = string(b)
}
521564
func (r Network_SecurityGroup) GetOrderBindings() (resp []datatypes.Network_SecurityGroup_OrderBinding, err error) {
	err = r.Session.DoRequest("SoftLayer_Network_SecurityGroup", "getOrderBindings", nil, &r.Options, &resp)
	return
}
1196031
func (d *Data) BindwithFiles(procs int) error {

	fmt.Println("\nbinding with files...")

	filesize := d.filesize
	filename := d.filename
	dirname := d.dirname

	fh, err := os.Create(d.fullfilename)
	if err != nil {
		return errors.Wrap(err, "failed to create a file in download location")
	}
	defer fh.Close()

	bar := pb.New64(int64(filesize))
	bar.Start()

	var f string
	for i := 0; i < procs; i++ {
		f = fmt.Sprintf("%s/%s.%d.%d", dirname, filename, procs, i)
		subfp, err := os.Open(f)
		if err != nil {
			return errors.Wrap(err, "failed to open "+f+" in download location")
		}

		proxy := bar.NewProxyReader(subfp)
		io.Copy(fh, proxy)

		// Not use defer
		subfp.Close()

		// remove a file in download location for join
		if err := os.Remove(f); err != nil {
			return errors.Wrap(err, "failed to remove a file in download location")
		}
	}

	bar.Finish()

	// remove download location
	// RemoveAll reason: will create .DS_Store in download location if execute on mac
	if err := os.RemoveAll(dirname); err != nil {
		return errors.Wrap(err, "failed to remove download location")
	}

	fmt.Println("Complete")

	return nil
}
530972
func Bind(params *Params, name string, typ reflect.Type) reflect.Value {
	if binder, found := binderForType(typ); found {
		return binder.Bind(params, name, typ)
	}
	return reflect.Zero(typ)
}
998394
func (p *Imports) Bind(opts libs.SassOptions) {
	entries := make([]libs.ImportEntry, p.Len())
	i := 0

	p.RLock()
	for _, ent := range p.m {
		bs := ent.bytes
		entries[i] = libs.ImportEntry{
			Parent: ent.Prev,
			Path:   ent.Path,
			Source: string(bs),
		}
		i++
	}
	p.RUnlock()

	resolver := func(url string, prev string) (newURL string, body string, resolved bool) {
		if p.resolver != nil {
			newURL, body, resolved = p.resolver(url, prev)
			if resolved {
				return
			}
		}
		entry, err := libs.GetEntry(entries, prev, url)
		if err == nil {
			return url, entry, true
		}
		return "", "", false
	}

	// set entries somewhere so GC doesn't collect it
	p.idx = libs.BindImporter(opts, resolver)
}
802700
func (b *Bound) Equals(c *Bound) bool {
	if b.sw.Equals(c.sw) && b.ne.Equals(c.ne) {
		return true
	}

	return false
}
584059
func (c *Client) DeleteBinding(vhost string, info BindingInfo) (res *http.Response, err error) {
	req, err := newRequestWithBody(c, "DELETE", "bindings/"+PathEscape(vhost)+
		"/e/"+PathEscape(info.Source)+"/"+PathEscape(string(info.DestinationType[0]))+
		"/"+PathEscape(info.Destination)+"/"+PathEscape(info.PropertiesKey), nil)
	if err != nil {
		return nil, err
	}

	res, err = executeRequest(c, req)
	if err != nil {
		return nil, err
	}

	return res, nil
}