// BuildStateEngine returns a new StateEngine instance set with a particular state as its owner
977477
func BuildStateEngine(s States) *StateEngine {
	es := StateEngine{
		states: make(map[States]string),
		owner:  s,
	}
	return &es
}
744754
func (w *WalletState) accountStateBuild(accountID stellar1.AccountID) (account *AccountState, built bool) {
	w.Lock()
	defer w.Unlock()

	a, ok := w.accounts[accountID]
	if ok {
		return a, false
	}

	a = newAccountState(accountID, w.Remoter, w.refreshReqs)
	w.accounts[accountID] = a

	return a, true
}
1045948
func (s *InstanceGroupStatus) SetState(v string) *InstanceGroupStatus {
	s.State = &v
	return s
}
201663
func (se *StateEngine) ShallowState() States {
	if se.curr == nil {
		return nil
	}

	return se.curr
}
1063647
func (a *Automaton) createState() int {
	state := len(a.states) / 2
	a.states = append(a.states, -1, 0)
	return state
}
1032330
func CreateStateFile(stor storage.Storage) (string, error) {
	err := putState(stor, []byte{})
	if err != nil {
		return "", fmt.Errorf("cannot create initial state file: %v", err)
	}
	return stor.URL(StateFile)
}
899525
func (se *StateEngine) UseState(addr string, s States) States {
	if addr == "" {
		addr = "."
	}

	se.add(addr, s)

	return s
}
1304960
func (s *DescribeOrderableDBInstanceOptionsInput) SetEngine(v string) *DescribeOrderableDBInstanceOptionsInput {
	s.Engine = &v
	return s
}
1109522
func (s *GlobalCluster) SetEngine(v string) *GlobalCluster {
	s.Engine = &v
	return s
}
589003
func (s *RestoreDBClusterFromSnapshotInput) SetEngine(v string) *RestoreDBClusterFromSnapshotInput {
	s.Engine = &v
	return s
}
1332915
func (s *Instance) SetState(v *InstanceState) *Instance {
	s.State = v
	return s
}
209715
func MakeGenesisStateFromFile(genDocFile string) (State, error) {
	genDoc, err := MakeGenesisDocFromFile(genDocFile)
	if err != nil {
		return State{}, err
	}
	return MakeGenesisState(genDoc)
}
314980
func (b *Local) createState(name string) error {
	if name == backend.DefaultStateName {
		return nil
	}

	stateDir := filepath.Join(b.stateWorkspaceDir(), name)
	s, err := os.Stat(stateDir)
	if err == nil && s.IsDir() {
		// no need to check for os.IsNotExist, since that is covered by os.MkdirAll
		// which will catch the other possible errors as well.
		return nil
	}

	err = os.MkdirAll(stateDir, 0755)
	if err != nil {
		return err
	}

	return nil
}
1093885
func (session *Session) StoreEngine(storeEngine string) *Session {
	session.statement.StoreEngine = storeEngine
	return session
}
989354
func NewState(caller base.APICaller) *State {
	facadeCaller := base.NewFacadeCaller(caller, machinerFacade)
	return &State{
		facade:       facadeCaller,
		APIAddresser: common.NewAPIAddresser(facadeCaller),
	}
}
673958
func (s *DescribeCacheEngineVersionsInput) SetEngine(v string) *DescribeCacheEngineVersionsInput {
	s.Engine = &v
	return s
}
1141614
func (s *InstanceGroupDetail) SetState(v string) *InstanceGroupDetail {
	s.State = &v
	return s
}