// NewTransition creates a new transition to a given state.
352477
func NewTransition(nextState ParserStateID, flags ParserFlag, callback ParsedFunc) Transition {
	return Transition{
		nextState: nextState,
		flags:     flags,
		callback:  callback,
	}
}
210864
func (ls *LState) NewTypeMetatable(typ string) *LTable {
	regtable := ls.Get(RegistryIndex)
	mt := ls.GetField(regtable, typ)
	if tb, ok := mt.(*LTable); ok {
		return tb
	}
	mtnew := ls.NewTable()
	ls.SetField(regtable, typ, mtnew)
	return mtnew
}
403755
func NewTransport(rt http.RoundTripper, retry RetryFn, delay DelayFn) *Transport {
	if rt == nil {
		rt = http.DefaultTransport
	}
	return &Transport{
		RoundTripper: rt,
		retry:        toRetryFn(retry, delay),
	}
}
1070311
func (a *Automaton) initTransition(state int, t *Transition) int {
	assert2(state < a.numStates(), "state=%v nextState=%v", state, a.numStates())
	t.source = state
	t.transitionUpto = a.states[2*state]
	return a.numTransitions(state)
}
774639
func (t *Transferer) NewTransfer(conf *TransferConfig) (*storagetransfer.TransferJob, error) {
	job, err := conf.Job()
	if err != nil {
		return nil, err
	}

	return t.svc.Create(job).Do()
}
326990
func NewTransferCustomer(KfAccount string) *TransferCustomer {
	tc := new(TransferCustomer)
	if KfAccount != "" {
		transInfo := new(TransInfo)
		transInfo.KfAccount = KfAccount
		tc.TransInfo = transInfo
	}
	return tc
}
401531
func NewTransactionWithCCEvent(txID string, txValidationCode pb.TxValidationCode, ccID string, eventName string, payload []byte) *TxInfo {
	return &TxInfo{
		TxID:             txID,
		TxValidationCode: txValidationCode,
		ChaincodeID:      ccID,
		EventName:        eventName,
		Payload:          payload,
		HeaderType:       cb.HeaderType_ENDORSER_TRANSACTION,
	}
}
484891
func Transition(toState string) Decider {
	return func(ctx *FSMContext, h *swf.HistoryEvent, data interface{}) Outcome {
		logf(ctx, "at=transition")
		return ctx.Goto(toState, data, ctx.EmptyDecisions())
	}
}
212759
func NewTransport(name string, t func(...transport.Option) transport.Transport) Option {
	return func(o *Options) {
		o.Transports[name] = t
	}
}
892942
func (g *GossipSyncer) handleSyncTransition(req *syncTransitionReq) error {
	// Return early from any NOP sync transitions.
	syncType := g.SyncType()
	if syncType == req.newSyncType {
		return nil
	}

	log.Debugf("GossipSyncer(%x): transitioning from %v to %v",
		g.cfg.peerPub, syncType, req.newSyncType)

	var (
		firstTimestamp time.Time
		timestampRange uint32
	)

	switch req.newSyncType {
	// If an active sync has been requested, then we should resume receiving
	// new graph updates from the remote peer.
	case ActiveSync:
		firstTimestamp = time.Now()
		timestampRange = math.MaxUint32

	// If a PassiveSync transition has been requested, then we should no
	// longer receive any new updates from the remote peer. We can do this
	// by setting our update horizon to a range in the past ensuring no
	// graph updates match the timestamp range.
	case PassiveSync:
		firstTimestamp = zeroTimestamp
		timestampRange = 0

	default:
		return fmt.Errorf("unhandled sync transition %v",
			req.newSyncType)
	}

	err := g.sendGossipTimestampRange(firstTimestamp, timestampRange)
	if err != nil {
		return fmt.Errorf("unable to send local update horizon: %v", err)
	}

	g.setSyncType(req.newSyncType)

	return nil
}
852369
func NewTransport(username, password string) DigestTransport {
	dt := DigestTransport{}
	dt.Password = password
	dt.Username = username
	return dt
}
1089000
func (s *EnableStageTransitionInput) SetTransitionType(v string) *EnableStageTransitionInput {
	s.TransitionType = &v
	return s
}
738778
func (parser *TransitionParser) Add(stateName string, token string, nextStateName string, flags ParserFlag, callback ParsedFunc) {
	nextStateID := parser.GetStateID(nextStateName)
	parser.AddTransition(stateName, NewTransition(nextStateID, flags, callback), token)
}
198246
func (s *IssueService) DoTransitionWithPayload(ticketID, payload interface{}) (*Response, error) {
	apiEndpoint := fmt.Sprintf("rest/api/2/issue/%s/transitions", ticketID)

	req, err := s.client.NewRequest("POST", apiEndpoint, payload)
	if err != nil {
		return nil, err
	}

	resp, err := s.client.Do(req, nil)
	if err != nil {
		err = NewJiraError(resp, err)
	}

	return resp, err
}
391535
func NewTferAction(s string) (tferAction, error) {
	var e tferAction
	err := e.FromString(s)
	if err != nil {
		return 0, err
	}
	return e, nil
}
664693
func NewStateTransition(evm *vm.EVM, msg Message, gp *GasPool) *StateTransition {
	return &StateTransition{
		gp:       gp,
		evm:      evm,
		msg:      msg,
		gasPrice: msg.GasPrice(),
		value:    msg.Value(),
		data:     msg.Data(),
		state:    evm.StateDB,
	}
}
1154835
func (s *DisableStageTransitionInput) SetTransitionType(v string) *DisableStageTransitionInput {
	s.TransitionType = &v
	return s
}