// From returns a new transition for the blueprint.
// The transition will be added to the blueprint automatically when it has both
// "from" and "to" values.
168944
func (b *Blueprint) From(start uint8) *Transition {
	return (&Transition{blueprint: b}).From(start)
}
208231
func From(other generic.T) T {
	r := Ident
	cols := other.Cols()
	rows := other.Rows()
	if (cols == 3 && rows == 3) || (cols == 4 && rows == 4) {
		cols = 2
		rows = 2
	} else if !(cols == 2 && rows == 2) {
		panic("Unsupported type")
	}
	for col := 0; col < cols; col++ {
		for row := 0; row < rows; row++ {
			r[col][row] = other.Get(col, row)
		}
	}
	return r
}
180471
func (p *BugTemplate) FromProperty(prop datastore.Property) error {
	data, err := prop.Project(datastore.PTBytes)
	if err != nil {
		return err
	}
	return proto.Unmarshal(data.([]byte), p)
}
39709
func (b *Blueprint) Add(t *Transition) {
	idx := b.transitions.InsertPos(t)
	trans := make(list, len(b.transitions)+1)

	copy(trans, b.transitions[:idx])
	copy(trans[idx+1:], b.transitions[idx:])
	trans[idx] = t
	b.transitions = trans
}
1345748
func (r *Render) move(from, to int) int {
	fromX, fromY := r.toPos(from)
	toX, toY := r.toPos(to)

	r.out.CursorUp(fromY - toY)
	r.out.CursorBackward(fromX - toX)
	return to
}
1161160
func (p *Flow) From(url string, params ...interface{}) *Flow {
	u, err := processURI(url)
	if err != nil {
		p.err = err
		return p
	}
	if err := pipeConnectorsSync[u.protocol](p.message, u, params...); err != nil {
		p.err = err
	}
	return p
}
1013920
func (s *IssueService) GetTransitions(id string) ([]Transition, *Response, error) {
	apiEndpoint := fmt.Sprintf("rest/api/2/issue/%s/transitions?expand=transitions.fields", id)
	req, err := s.client.NewRequest("GET", apiEndpoint, nil)
	if err != nil {
		return nil, nil, err
	}

	result := new(transitionResult)
	resp, err := s.client.Do(req, result)
	if err != nil {
		err = NewJiraError(resp, err)
	}
	return result.Transitions, resp, err
}
727072
func (m *MockJobResolver) From(arg0 manifest.Manifest) ([]job.Job, error) {
	ret := m.ctrl.Call(m, "From", arg0)
	ret0, _ := ret[0].([]job.Job)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
1261147
func (repo Repo) From(collection string) Query {
	return Query{
		repo:       &repo,
		Collection: collection,
		Fields:     []string{collection + ".*"},
	}
}
1160450
func (a *Automaton) transition(state, index int, t *Transition) {
	i := a.states[2*state] + 3*index
	t.source = state
	t.dest = a.transitions[i]
	t.min = a.transitions[i+1]
	t.max = a.transitions[i+2]
}
336068
func (s *SearchSource) From(from int) *SearchSource {
	s.from = from
	return s
}
877975
func (s *UpdateByQueryService) From(from int) *UpdateByQueryService {
	s.from = &from
	return s
}
569952
func (b *DeleteBuilder) From(table string) *DeleteBuilder {
	b.table = table
	return b
}
520309
func (config *configuration) fromOptions(labels map[string]string) error {
	for label, value := range labels {
		switch label {
		case parentOpt:
			// parse driver option '-o parent'
			config.Parent = value
		case driverModeOpt:
			// parse driver option '-o ipvlan_mode'
			config.IpvlanMode = value
		}
	}
	return nil
}
93592
func FromObject(obj runtime.Object) error {
	switch t := obj.(type) {
	case *unversioned.Status:
		return &StatusError{*t}
	}
	return &UnexpectedObjectError{obj}
}
402788
func (b *Builder) From(subject interface{}, alias ...string) *Builder {
	switch subject.(type) {
	case *Builder:
		b.subQuery = subject.(*Builder)

		if len(alias) > 0 {
			b.from = alias[0]
		} else {
			b.isNested = true
		}
	case string:
		b.from = subject.(string)

		if len(alias) > 0 {
			b.from = b.from + " " + alias[0]
		}
	}

	return b
}
24152
func (tc BoulderTypeConverter) FromDb(target interface{}) (gorp.CustomScanner, bool) {
	switch target.(type) {
	case *core.AcmeIdentifier, *[]core.Challenge, *[]string, *[][]int:
		binder := func(holder, target interface{}) error {
			s, ok := holder.(*string)
			if !ok {
				return errors.New("FromDb: Unable to convert *string")
			}
			b := []byte(*s)
			if err := json.Unmarshal(b, target); err != nil {
				return badJSONError(
					fmt.Sprintf("binder failed to unmarshal %T", target),
					b,
					err)
			}
			return nil
		}
		return gorp.CustomScanner{Holder: new(string), Target: target, Binder: binder}, true
	case *jose.JSONWebKey:
		binder := func(holder, target interface{}) error {
			s, ok := holder.(*string)
			if !ok {
				return fmt.Errorf("FromDb: Unable to convert %T to *string", holder)
			}
			if *s == "" {
				return errors.New("FromDb: Empty JWK field.")
			}
			b := []byte(*s)
			k, ok := target.(*jose.JSONWebKey)
			if !ok {
				return fmt.Errorf("FromDb: Unable to convert %T to *jose.JSONWebKey", target)
			}
			if err := k.UnmarshalJSON(b); err != nil {
				return badJSONError(
					"binder failed to unmarshal JWK",
					b,
					err)
			}
			return nil
		}
		return gorp.CustomScanner{Holder: new(string), Target: target, Binder: binder}, true
	case *core.AcmeStatus:
		binder := func(holder, target interface{}) error {
			s, ok := holder.(*string)
			if !ok {
				return fmt.Errorf("FromDb: Unable to convert %T to *string", holder)
			}
			st, ok := target.(*core.AcmeStatus)
			if !ok {
				return fmt.Errorf("FromDb: Unable to convert %T to *core.AcmeStatus", target)
			}

			*st = core.AcmeStatus(*s)
			return nil
		}
		return gorp.CustomScanner{Holder: new(string), Target: target, Binder: binder}, true
	case *core.OCSPStatus:
		binder := func(holder, target interface{}) error {
			s, ok := holder.(*string)
			if !ok {
				return fmt.Errorf("FromDb: Unable to convert %T to *string", holder)
			}
			st, ok := target.(*core.OCSPStatus)
			if !ok {
				return fmt.Errorf("FromDb: Unable to convert %T to *core.OCSPStatus", target)
			}

			*st = core.OCSPStatus(*s)
			return nil
		}
		return gorp.CustomScanner{Holder: new(string), Target: target, Binder: binder}, true
	default:
		return gorp.CustomScanner{}, false
	}
}