//Demand forces all the dependencies up to date and then
//calls the function to get the new value.
770392
func (self *AttributeImpl) Demand() Equaler {
	self.demandCount++

	if DEBUG_MESSAGES {
		print("Demand called ", self.id(), " (", self.name, ") with dirty ", self.dirty(), "\n")
	}
	//first if we are not dirty, return our stored value
	if !self.dirty() {
		return self.curr
	}

	//when we exit, we are not dirty
	self.clean = true

	//second, we are dirty so we have to pull everybody
	//we depend on up to date
	params := make([]Equaler, self.inDegree())
	pcount := 0
	self.walkIncoming(func(e *edgeImpl) {
		params[pcount] = e.src().Demand()
		pcount++
	})

	//we now know if anybody we depend on changed
	anyMarks := false
	self.walkIncoming(func(e *edgeImpl) {
		if e.marked() {
			anyMarks = true
		}
	})

	if DEBUG_MESSAGES {
		print("inside demand ", self.id(), " (", self.name, ") anyMarks = ", anyMarks, "\n")
	}

	//if nobody actually returned a different value, then we
	//don't need to reevaluate
	if !anyMarks && self.valueFn == nil {
		return self.curr
	}

	//we have to calculate the new value
	self.evalCount++
	var newval Equaler

	if DEBUG_MESSAGES {
		print("inside demand ", self.id(), " (", self.name, ") self.valueFn = ",
			self.valueFn, ",", self.constraint, "\n")
	}

	if self.valueFn != nil && self.constraint == nil {
		newval = self.valueFn()
	} else {
		newval = self.constraint.Fn(params)
	}

	//did it change?
	if self.curr != nil && self.curr.Equal(newval) {
		return self.curr
	}
	//it did change, so we need to mark our outgoing edges
	self.walkOutgoing(func(e *edgeImpl) {
		e.mark()
	})

	return self.assign(newval, true)
}
405770
func (self *Collection) All() []Model {
	if self.coll.Demand() == nil {
		return nil
	}
	curr := self.coll.Demand().(EqList)
	result := make([]Model, len(curr))
	for i, c := range curr {
		result[i] = c
	}
	return result
}
75047
func (cli *Client) DependsGet(target string) (*pb.DependsReply, error) {
	req := &pb.DependsRequest{Target: target}
	ctx, cancel := context.WithTimeout(context.Background(), cli.timeout)
	defer cancel()
	rpl, err := cli.dependsClient.Get(ctx, req)
	return rpl, err
}
219821
func Get(c *deis.Client, appID string, version int) (api.Release, error) {
	u := fmt.Sprintf("/v2/apps/%s/releases/v%d/", appID, version)

	res, reqErr := c.Request("GET", u, nil)
	if reqErr != nil && !deis.IsErrAPIMismatch(reqErr) {
		return api.Release{}, reqErr
	}
	defer res.Body.Close()

	release := api.Release{}
	if err := json.NewDecoder(res.Body).Decode(&release); err != nil {
		return api.Release{}, err
	}

	return release, reqErr
}
1259443
func (p *ProgressBar) UpdateRequired() bool {
	return p.Current == 0 || p.Current == p.Total
}
253953
func (w *Wait) Add() {
	curr := atomic.LoadInt64(&w.totalCount)

	if curr < 0 {
		return
	}

	atomic.AddInt64(&w.totalCount, 1)
}
1193965
func (g *Graph) Dependencies(x util.T) map[util.T]struct{} {
	return g.adj[x]
}
89233
func (t *Transactor) RequestExpectation(request *token.ExpectationRequest) (*token.TokenTransaction, error) {
	panic("not implemented yet")
}
1110087
func (p *Loader) storeRequest(id stellar1.KeybaseRequestID, request *stellar1.RequestDetailsLocal) (isUpdate bool) {
	p.Lock()
	x, ok := p.requests[id]
	if !ok || x.Status != request.Status {
		isUpdate = true
	}
	p.requests[id] = request
	p.rlist = append(p.rlist, id)
	p.Unlock()

	return isUpdate
}
393789
func (b UpdateMap) Get(ns, coll, key string) *statedb.VersionedValue {
	nsPvtBatch, ok := b[ns]
	if !ok {
		return nil
	}
	return nsPvtBatch.Get(coll, key)
}
867944
func (m *Motto) Require(id, pwd string) (otto.Value, error) {
	if cache, ok := m.cachedModule(id); ok {
		return cache, nil
	}

	loader := m.module(id)
	if loader == nil {
		loader = Module(id)
	}

	if loader != nil {
		v, err := loader(m)
		if err != nil {
			return otto.UndefinedValue(), err
		}

		m.addCachedModule(id, v)
		return v, nil
	}

	filename, err := FindFileModule(id, pwd, append(m.paths, globalPaths...))
	if err != nil {
		return otto.UndefinedValue(), err
	}

	// resove id
	id = filename

	if cache, ok := m.cachedModule(id); ok {
		return cache, nil
	}

	v, err := CreateLoaderFromFile(id)(m)

	if err != nil {
		return otto.UndefinedValue(), err
	}

	m.addCachedModule(id, v)
	return v, nil
}
276895
func (d *Provider) Get(name string) (interface{}, error) {
	d.Block()
	if d.isCalled(name) {
		return nil, fmt.Errorf("%s is cyclic dependency (dependency callstack: %v)", name, append(d.callstack, name))
	}
	if instance, exist := d.instances[name]; exist {
		return instance, nil
	}
	if factory, exist := d.factories[name]; exist {
		d.callstack = append(d.callstack, name)
		instance, err := factory(d)
		if err != nil {
			return nil, fmt.Errorf("%v (dependency callstack: %v)", err, d.callstack)
		}
		if instance == nil {
			return nil, fmt.Errorf("factory for %s return nil as instance", name)
		}
		d.callstack = d.callstack[:len(d.callstack)-1]
		d.clean(name)
		d.instances[name] = instance
		return instance, nil
	}
	if factory, exist := d.defaultFactories[name]; exist {
		d.callstack = append(d.callstack, name)
		instance, err := factory(d)
		if err != nil {
			return nil, fmt.Errorf("%v (dependency callstack: %v)", err, d.callstack)
		}
		if instance == nil {
			return nil, fmt.Errorf("default factory for %s return nil as instance", name)
		}
		d.callstack = d.callstack[:len(d.callstack)-1]
		if d.autoclean {
			delete(d.defaultFactories, name)
		}
		d.instances[name] = instance
		return instance, nil
	}
	return nil, fmt.Errorf("goatcore/dependency/provider: dependency %s doesn't exist", name)
}
88386
func (o *Outbound) Call(ctx context.Context, treq *transport.Request) (*transport.Response, error) {
	if treq == nil {
		return nil, yarpcerrors.InvalidArgumentErrorf("request for http unary outbound was nil")
	}

	return o.call(ctx, treq)
}
653308
func (p *PKGBUILD) BuildDepends() []*Dependency {
	// TODO real merge
	deps := make([]*Dependency, len(p.Depends)+len(p.Makedepends)+len(p.Checkdepends))

	deps = append(p.Depends, p.Makedepends...)
	deps = append(deps, p.Checkdepends...)

	return deps
}
149389
func (c *BoundContract) Call(opts *CallOpts, result interface{}, method string, params ...interface{}) error {
	// Don't crash on a lazy user
	if opts == nil {
		opts = new(CallOpts)
	}
	// Pack the input, call and unpack the results
	input, err := c.abi.Pack(method, params...)
	if err != nil {
		return err
	}
	var (
		msg    = ethereum.CallMsg{From: opts.From, To: &c.address, Data: input}
		ctx    = ensureContext(opts.Context)
		code   []byte
		output []byte
	)
	if opts.Pending {
		pb, ok := c.caller.(PendingContractCaller)
		if !ok {
			return ErrNoPendingState
		}
		output, err = pb.PendingCallContract(ctx, msg)
		if err == nil && len(output) == 0 {
			// Make sure we have a contract to operate on, and bail out otherwise.
			if code, err = pb.PendingCodeAt(ctx, c.address); err != nil {
				return err
			} else if len(code) == 0 {
				return ErrNoCode
			}
		}
	} else {
		output, err = c.caller.CallContract(ctx, msg, opts.BlockNumber)
		if err == nil && len(output) == 0 {
			// Make sure we have a contract to operate on, and bail out otherwise.
			if code, err = c.caller.CodeAt(ctx, c.address, opts.BlockNumber); err != nil {
				return err
			} else if len(code) == 0 {
				return ErrNoCode
			}
		}
	}
	if err != nil {
		return err
	}
	return c.abi.Unpack(result, method, output)
}
267539
func (c *Client) Get() *Request {
	return NewRequest(c.httpClient, c.base, "GET", c.version, c.authstring, c.userAgent)
}
772230
func (*SwitchesTable) needsUpdate(row, cfg *Switch) bool {
	return row.Ports != cfg.Ports || row.Description != cfg.Description || row.State != cfg.State || row.RackId != cfg.RackId
}