// pushParseState pushes a new parse state p onto the parse stack.
343973
func (s *Scanner) pushParseState(p int) {
	s.parseState = append(s.parseState, p)
}
586082
func (stub *ChaincodeStub) PutState(key string, value []byte) error {
	if key == "" {
		return errors.New("key must not be an empty string")
	}
	// Access public data by setting the collection to empty string
	collection := ""
	return stub.handler.handlePutState(collection, key, value, stub.ChannelId, stub.TxID)
}
480432
func (tbs *TokenBucketSet) debugState() string {
	periods := sort.IntSlice(make([]int, 0, len(tbs.buckets)))
	for period := range tbs.buckets {
		periods = append(periods, int(period))
	}
	sort.Sort(periods)
	bucketRepr := make([]string, 0, len(tbs.buckets))
	for _, period := range periods {
		bucket := tbs.buckets[time.Duration(period)]
		bucketRepr = append(bucketRepr, fmt.Sprintf("{%v: %v}", bucket.period, bucket.availableTokens))
	}
	return strings.Join(bucketRepr, ", ")
}
406400
func (s *Swap) loadState(peer *protocols.Peer) (err error) {
	var peerBalance int64
	peerID := peer.ID()
	//only load if the current instance doesn't already have this peer's
	//balance in memory
	if _, ok := s.balances[peerID]; !ok {
		err = s.stateStore.Get(peerID.String(), &peerBalance)
		s.balances[peerID] = peerBalance
	}
	return
}
1014706
func (p *parser) parseStateCodeExpr(state *stateCodeExpr) (interface{}, bool) {
	// ==template== {{ if not .Optimize }}
	if p.debug {
		defer p.out(p.in("parseStateCodeExpr"))
	}

	// {{ end }} ==template==
	err := state.run(p)
	if err != nil {
		p.addErr(err)
	}
	return nil, true
}
694701
func NewState(caller base.APICaller) (*State, error) {
	facadeCaller := base.NewFacadeCaller(caller, storageProvisionerFacade)
	return &State{facadeCaller}, nil
}
587504
func postActionState(deployment *deployment, ctx *context) stateFn {
	application := deployment.application
	_, name := splitServiceId(application.ID[1:], "/")

	res, _ := deployment.client.GetApp(application.ID)
	if res.App.TasksRunning > 0 {
		log.Printf("Post Deployment: %s", deployment.application.ID)
		appRes, err := deployment.client.GetApp(application.ID)
		if err != nil {
			deployment.status.code = FAIL
			deployment.status.message = fmt.Sprintf("%s", err)
			return nil
		}

		mappings := createDockerMapping(appRes.App, name)
		if len(mappings) > 0 {
			log.Printf("Adding mappings : %s", strings.ToLower(name))
			ctx.values[strings.ToLower(name)] = mappings
		}

		deployment.status.code = OK
		deployment.status.message = fmt.Sprintf("Successful deployment: %s", deployment.application.ID)
		log.Printf("Successful deployment: %s", deployment.application.ID)

		return nil
	}
	time.Sleep(2000 * time.Millisecond)
	return postActionState
}
1006448
func (l *Logger) PushPrefix(format string, a ...interface{}) {
	l.prefixStack = append(l.prefixStack, fmt.Sprintf(format, a...))
}
240416
func (L *State) PushGoStruct(iface interface{}) {
	iid := L.register(iface)
	C.clua_pushgostruct(L.s, C.uint(iid))
}
1012412
func (p *Pusher) Push(ctx context.Context) error {
	if p.PushFormat == "" {
		p.PushFormat = expfmt.FmtText
	}

	resps := make(chan (error))
	go func() {
		resps <- p.push(ctx)
	}()

	select {
	case err := <-resps:
		return err
	case <-ctx.Done():
		return ctx.Err()
	}
}
1285351
func (l *State) PushString(s string) string { // TODO is it useful to return the argument?
	l.apiPush(s)
	return s
}
264771
func (f *FSM) SetState(state string) {
	f.stateMu.Lock()
	defer f.stateMu.Unlock()
	f.current = state
	return
}
1139137
func (p *ProtoCommand) NextState(state State) State {
	if p.NextStateFunc != nil {
		return p.NextStateFunc(state)
	}
	return state
}
160155
func (s *Scanner) popParseState() {
	n := len(s.parseState) - 1
	s.parseState = s.parseState[0:n]
	s.redo = false
	if n == 0 {
		s.Step = stateEndTop
		s.endTop = true
	} else {
		s.Step = stateEndValue
	}
}
439591
func (q *prioQueue) Push(v int) {
	n := q.Len()
	q.heap = append(q.heap, v)
	q.index[v] = n
	q.up(n)
}
943535
func (s *GetInstanceStateOutput) SetState(v *InstanceState) *GetInstanceStateOutput {
	s.State = v
	return s
}
344440
func (ph *pendingHeap) Push(x interface{}) {
	ps := x.(*peerScore)
	ps.index = len(ph.peers)
	ph.peers = append(ph.peers, ps)
}