// popParseState pops a parse state (already obtained) off the stack
// and updates s.step accordingly.
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
	}
}
243422
func NewState(caller base.APICaller) *State {
	facadeCaller := base.NewFacadeCaller(caller, provisionerFacade)
	return NewStateFromFacade(facadeCaller)
}
989354
func NewState(caller base.APICaller) *State {
	facadeCaller := base.NewFacadeCaller(caller, machinerFacade)
	return &State{
		facade:       facadeCaller,
		APIAddresser: common.NewAPIAddresser(facadeCaller),
	}
}
638617
func NewState(caller base.APICaller) *State {
	facadeCaller := base.NewFacadeCaller(caller, deployerFacade)
	return &State{facade: facadeCaller}

}
1141614
func (s *InstanceGroupDetail) SetState(v string) *InstanceGroupDetail {
	s.State = &v
	return s
}
633394
func (s *LogStream) PopulateState(c context.Context, lst *LogStreamState) {
	lst.Parent = ds.KeyForObj(c, s)
}
28094
func (state *PluginRunState) SetState(nextState PluginState) {
	prevState := PluginState(atomic.SwapInt32(&state.state, int32(nextState)))

	if nextState != prevState {
		stateToMetric[prevState].Dec(1)
		stateToMetric[nextState].Inc(1)
	}
}
349148
func ParseStateID(stateID string) (string, string, int, error) {
	parts := strings.SplitN(stateID, "-", 3)
	if len(parts) != 3 {
		return "", "", 0, ErrInvalidStateID
	}
	instanceID, err := strconv.Atoi(parts[2])
	if err != nil {
		return "", "", 0, ErrInvalidStateID
	}
	return parts[0], parts[1], instanceID, nil
}
550180
func (s *State) StateSnapshotMeta() statemgr.SnapshotMeta {
	return statemgr.SnapshotMeta{
		Lineage: s.lineage,
		Serial:  s.serial,
	}
}
1257498
func (p *parser) popGroup() error {
	p.concatenation = p.stack
	p.alternation = p.concatenation.next
	p.group = p.alternation.next
	p.stack = p.group.next

	// The first () inside a Testgroup group goes directly to the group
	if p.group.t == ntTestgroup && len(p.group.children) == 0 {
		if p.unit == nil {
			return p.getErr(ErrConditionalExpression)
		}

		p.group.addChild(p.unit)
		p.unit = nil
	}
	return nil
}
1039325
func (s *SearchAvailablePhoneNumbersInput) SetState(v string) *SearchAvailablePhoneNumbersInput {
	s.State = &v
	return s
}
449275
func (s *Stack) PopString() (string, error) {
	s.l.Lock()
	defer s.l.Unlock()
	l := len(s.s)
	if l > 0 {
		item := s.s[l-1]
		if item, ok := item.(string); ok {
			s.s = s.s[:l-1]
			return item, nil
		}
		return "", ErrBadTypeCast{}
	}
	return "", ErrEmptyStack{action: "PopString"}
}
1288257
func (s *sstack) Pop() (res interface{}) {
	s.size--
	s.offset--
	if s.offset < 0 {
		s.offset = blockSize - 1
		s.active = s.blocks[s.size/blockSize]
	}
	res, s.active[s.offset] = s.active[s.offset], nil
	if s.setIndex != nil {
		s.setIndex(res.(*item).value, -1)
	}
	return
}
418664
func (s *AssessmentRunStateChange) SetState(v string) *AssessmentRunStateChange {
	s.State = &v
	return s
}
854343
func (s *Session) PopString(key string) string {
	r, _ := s.Pop(key).(string)
	return r
}
304109
func (s *DatasetContentStatus) SetState(v string) *DatasetContentStatus {
	s.State = &v
	return s
}
881487
func (cs *ConsensusState) GetState() sm.State {
	cs.mtx.RLock()
	defer cs.mtx.RUnlock()
	return cs.state.Copy()
}