// Looks up the slot number for a given name
779691
func (p *parser) isCaptureName(capname string) bool {
	if p.capnames == nil {
		return false
	}

	_, ok := p.capnames[capname]
	return ok
}
1169015
func (t *PackageList) LookupByName(name string) *build.Package {
	t.ensureInit()
	return t.namepool[name]
}
1161675
func (n *NameProvider) GetGoName(subject interface{}, name string) (string, bool) {
	tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
	return n.GetGoNameForType(tpe, name)
}
985755
func callgrindName(names map[string]int, name string) string {
	if name == "" {
		return ""
	}
	if id, ok := names[name]; ok {
		return fmt.Sprintf("(%d)", id)
	}
	id := len(names) + 1
	names[name] = id
	return fmt.Sprintf("(%d) %s", id, name)
}
3125
func (r *Orchestrator) SlotTuple(t *api.Task) orchestrator.SlotTuple {
	return orchestrator.SlotTuple{
		ServiceID: t.ServiceID,
		Slot:      t.Slot,
	}
}
1286812
func getSlotNums(lobbytype Format, slot int) (int, int, error) {
	classList := typeClassList[lobbytype]

	if slot < len(classList) {
		return 0, slot, nil
	} else if slot < 2*len(classList) {
		return 1, slot - len(classList), nil
	} else {
		return 0, 0, ErrorInvalidSlot(slot)
	}
}
536635
func LookupCNAME(host string, server string, c *dns.Client, m *dns.Msg) (addrs []string, err error) {
	m.SetQuestion(dns.Fqdn(host), dns.TypeCNAME)
	r, _, err := c.Exchange(m, net.JoinHostPort(server, "53"))
	if err != nil {
		return nil, err
	}

	for _, ans := range r.Answer {
		if t, ok := ans.(*dns.CNAME); ok {
			addrs = append(addrs, t.Target)
		}
	}

	return
}
936568
func (r *EchoRequest) GetSlotValue(slotName string) (string, error) {
	slot, err := r.GetSlot(slotName)

	if err != nil {
		return "", err
	}

	return slot.Value, nil
}
559231
func (s *PoolService) GetStoragePoolID(name string, opts ...OptionFunc) (string, int, error) {
	p := &ListStoragePoolsParams{}
	p.p = make(map[string]interface{})

	p.p["name"] = name

	for _, fn := range append(s.cs.options, opts...) {
		if err := fn(s.cs, p); err != nil {
			return "", -1, err
		}
	}

	l, err := s.ListStoragePools(p)
	if err != nil {
		return "", -1, err
	}

	if l.Count == 0 {
		return "", l.Count, fmt.Errorf("No match found for %s: %+v", name, l)
	}

	if l.Count == 1 {
		return l.StoragePools[0].Id, l.Count, nil
	}

	if l.Count > 1 {
		for _, v := range l.StoragePools {
			if v.Name == name {
				return v.Id, l.Count, nil
			}
		}
	}
	return "", l.Count, fmt.Errorf("Could not find an exact match for %s: %+v", name, l)
}
762929
func Slot(key string) int {
	if key == "" {
		return RandomSlot()
	}
	key = Key(key)
	return int(crc16sum(key)) % slotNumber
}
529385
func (m *MarketplacePlan) GetName() string {
	if m == nil || m.Name == nil {
		return ""
	}
	return *m.Name
}
414028
func (n *Namer) Next() *Namer {
	if n.IsStart() {
		n.count = n.opts.start
	} else {
		n.count++
	}
	return n
}
1073599
func (s *Server) lookupAccount(name string) (*Account, error) {
	if v, ok := s.accounts.Load(name); ok {
		acc := v.(*Account)
		// If we are expired and we have a resolver, then
		// return the latest information from the resolver.
		if acc.IsExpired() {
			var err error
			s.mu.Lock()
			if s.accResolver != nil {
				err = s.updateAccount(acc)
			}
			s.mu.Unlock()
			if err != nil {
				return nil, err
			}
		}
		return acc, nil
	}
	// If we have a resolver see if it can fetch the account.
	if s.accResolver == nil {
		return nil, ErrMissingAccount
	}
	s.mu.Lock()
	acc, err := s.fetchAccount(name)
	s.mu.Unlock()
	return acc, err
}
648355
func (b *Box) FindString(name string) (string, error) {
	bb, err := b.Find(name)
	return string(bb), err
}
657804
func (b *fastStatBucket) lookUp(name string) (hit bool, o *gcs.Object) {
	b.mu.Lock()
	defer b.mu.Unlock()

	hit, o = b.cache.LookUp(name, b.clock.Now())
	return
}
1110994
func (s *StreamSession) Lookup(name string) (I2PAddr, error) {
	sam, err := NewSAM(s.samAddr)
	if err == nil {
		addr, err := sam.Lookup(name)
		sam.Close()
		return addr, err
	}
	return I2PAddr(""), err
}
1126957
func (r *QueryResults) SortedNames() []string {
	names := r.Names()
	sort.Strings(names)
	return names
}