// FromId attempts to match Material by its id.
// Matching order:
//   1: if id < MinBlock { return Air }
//   2: exact match
//   3: "Block" + name
//   4: "Item" + name
//   5: "Disc" + name
//   6: return Air
482600
func FromId(id int) (m Material) {
	if id < MinBlock {
		return Air
	}

	m = Material(id)
	if m.IsBlock() || m.IsItem() || m.IsDisc() {
		return
	}
	return Air
}
756796
func (s *IndexService) Id(id string) *IndexService {
	s.id = id
	return s
}
593345
func (item *MoreLikeThisQueryItem) Id(id string) *MoreLikeThisQueryItem {
	item.id = id
	return item
}
1025716
func (s *IDsScanner) ID() string {
	if len(s.ids) == 0 {
		return ""
	}
	return s.ids[s.start : s.start+1][0]
}
818587
func FromInt(data [4]byte) int {
	ui32 := binary.LittleEndian.Uint32(data[:])
	return int(ui32)
}
910842
func ByID(s *Selector) {
	s.sel = "#" + strings.TrimPrefix(s.selAsString(), "#")
	ByQuery(s)
}
262129
func FromString(str string) (UUID, error) {
	u := UUID{}

	err := u.SetString(str)

	return u, err
}
430757
func (m *MailYak) From(addr string) {
	m.fromAddr = m.trimRegex.ReplaceAllString(addr, "")
}
768277
func (p *Peer) fromDictInterface(d map[string]interface{}) {
	p.IP = net.ParseIP(d["ip"].(string))
	if _, ok := d["peer id"]; ok {
		p.ID = []byte(d["peer id"].(string))
	}
	p.Port = int(d["port"].(int64))
}
461357
func (i *environInstance) Id() instance.Id {
	return instance.Id(i.container.Name)
}
1060163
func (mpi *MempoolInfo) ID() uint64 {
	mpi.RLock()
	defer mpi.RUnlock()
	return mpi.Ident
}
1328532
func FromBytes(input []byte) (u UUID, err error) {
	err = u.UnmarshalBinary(input)
	return
}
365027
func (a *Attempt_ID) FromProperty(p datastore.Property) error {
	if p.Type() != datastore.PTString {
		return fmt.Errorf("wrong type for property: %s", p.Type())
	}
	return a.SetDMEncoded(p.Value().(string))
}
705930
func From(in []byte) ([]byte, error) {
	tr, err := fromCp949()
	if err != nil {
		return nil, err
	}

	_, out, err := tr.Translate(in)
	if err != nil {
		return nil, err
	}

	return out, nil
}
74570
func (g *Generator) NextID() (string, error) {
	n, err := g.sf.NextID()
	if err != nil {
		return "", err
	}
	return g.enc.Encode(n), nil
}
650986
func ById(id string) Matcher {
	return func(node *html.Node) bool { return Attr(node, "id") == id }
}
569952
func (b *DeleteBuilder) From(table string) *DeleteBuilder {
	b.table = table
	return b
}