// reflects an unrecoverable, illegal mechanism state; always returns IllegalState
// as the next step along with an IllegalStateErr
490841
func IllegalState(m Interface, data []byte) (StepFunc, []byte, error) {
	return IllegalState, nil, IllegalStateErr
}
683585
func stateStepsFor254() []Step {
	return []Step{
		&upgradeStep{
			description: "ensure default modification status is set for machines",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return context.State().EnsureDefaultModificationStatus()
			},
		},
		&upgradeStep{
			description: "ensure device constraints exists for applications",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return context.State().EnsureApplicationDeviceConstraints()
			},
		},
	}
}
528055
func (a *action) reflectIntoRunner() (e error) {
	if e = a.reflectOptions(); e != nil {
		return e
	}
	if e = a.reflectArguments(); e != nil {
		return e
	}
	return nil
}
971759
func (d *JsonNullDetector) nextState(b byte) int {
	switch d.state {
	case stateInit:
		if isJsonSpace(b) {
			return stateInit
		}
		if b == 'n' {
			return stateN
		}
	case stateN:
		if b == 'u' {
			return stateU
		}
	case stateU:
		if b == 'l' {
			return stateL
		}
	case stateL:
		if b == 'l' {
			return stateAccept
		}
	case stateAccept:
		if isJsonSpace(b) {
			return stateAccept
		}
	}
	return stateInvalid
}
1194616
func GetState(fd int) (*State, error) {
	termios, err := getTermios(fd)
	if err != nil {
		return nil, err
	}

	return &State{termios: *termios}, nil
}
998825
func (c *Client) GetState() uint8 {
	c.stateLock.Lock()
	defer c.stateLock.Unlock()

	return c.state.State()
}
1318975
func (sm *StateMachine) StateMachineDecorator() sparta.ServiceDecoratorHookFunc {
	cfName := sparta.CloudFormationResourceName("StateMachine", "StateMachine")
	return sm.StateMachineNamedDecorator(cfName)
}
332511
func (a *MobileAppState) State() keybase1.MobileAppState {
	a.Lock()
	defer a.Unlock()
	return a.state
}
1361729
func (sc *stateCheckpoint) restoreState() error {
	sc.mux.Lock()
	defer sc.mux.Unlock()
	var err error

	// used when all parsing is ok
	tmpAssignments := make(ContainerCPUAssignments)
	tmpDefaultCPUSet := cpuset.NewCPUSet()
	tmpContainerCPUSet := cpuset.NewCPUSet()

	checkpoint := NewCPUManagerCheckpoint()
	if err = sc.checkpointManager.GetCheckpoint(sc.checkpointName, checkpoint); err != nil {
		if err == errors.ErrCheckpointNotFound {
			sc.storeState()
			return nil
		}
		return err
	}

	if sc.policyName != checkpoint.PolicyName {
		return fmt.Errorf("configured policy %q differs from state checkpoint policy %q", sc.policyName, checkpoint.PolicyName)
	}

	if tmpDefaultCPUSet, err = cpuset.Parse(checkpoint.DefaultCPUSet); err != nil {
		return fmt.Errorf("could not parse default cpu set %q: %v", checkpoint.DefaultCPUSet, err)
	}

	for containerID, cpuString := range checkpoint.Entries {
		if tmpContainerCPUSet, err = cpuset.Parse(cpuString); err != nil {
			return fmt.Errorf("could not parse cpuset %q for container id %q: %v", cpuString, containerID, err)
		}
		tmpAssignments[containerID] = tmpContainerCPUSet
	}

	sc.cache.SetDefaultCPUSet(tmpDefaultCPUSet)
	sc.cache.SetCPUAssignments(tmpAssignments)

	klog.V(2).Info("[cpumanager] state checkpoint: restored state from checkpoint")
	klog.V(2).Infof("[cpumanager] state checkpoint: defaultCPUSet: %s", tmpDefaultCPUSet.String())

	return nil
}
199350
func (d *Domain) GetState() (DomainState, int, error) {
	var cState C.int
	var cReason C.int
	var err C.virError
	result := C.virDomainGetStateWrapper(d.ptr,
		(*C.int)(unsafe.Pointer(&cState)),
		(*C.int)(unsafe.Pointer(&cReason)),
		0, &err)
	if int(result) == -1 {
		return 0, 0, makeError(&err)
	}
	return DomainState(cState), int(cReason), nil
}
91755
func (d *Daemon) CheckServiceUpdateState(service string) func(*check.C) (interface{}, check.CommentInterface) {
	return func(c *check.C) (interface{}, check.CommentInterface) {
		service := d.GetService(c, service)
		if service.UpdateStatus == nil {
			return "", nil
		}
		return service.UpdateStatus.State, nil
	}
}
1286299
func (p *parser) restoreState(state storeDict) {
	if p.debug {
		defer p.out(p.in("restoreState"))
	}
	p.cur.state = state
}
1246887
func (u *UserMigration) GetState() string {
	if u == nil || u.State == nil {
		return ""
	}
	return *u.State
}
1035085
func (c *Client) GetURLForStateFile(instance url.URL) url.URL {
	return AppendPath(instance, "master/state")
}
1346764
func (s *stateTracker) getState() (current folderState, changed time.Time, err error) {
	s.mut.Lock()
	current, changed, err = s.current, s.changed, s.err
	s.mut.Unlock()
	return
}
1264613
func (_m *StateFetcher) FetchState() (validation.State, error) {
	ret := _m.Called()

	var r0 validation.State
	if rf, ok := ret.Get(0).(func() validation.State); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(validation.State)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func() error); ok {
		r1 = rf()
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
201663
func (se *StateEngine) ShallowState() States {
	if se.curr == nil {
		return nil
	}

	return se.curr
}