// GetOnlyAttributeValueBytes gets an attribute value, returning an error if the
// attribute occurs multiple times or has multiple values.
502244
func (attrs Attributes) GetOnlyAttributeValueBytes(oid asn1.ObjectIdentifier) (rv asn1.RawValue, err error) {
	var vals []AnySet
	if vals, err = attrs.GetValues(oid); err != nil {
		return
	}
	if len(vals) != 1 {
		err = ASN1Error{"bad attribute count"}
		return
	}
	if len(vals[0].Elements) != 1 {
		err = ASN1Error{"bad attribute element count"}
		return
	}

	return vals[0].Elements[0], nil
}
828587
func ExtractDisableTypoToleranceOnAttributes(opts ...interface{}) *opt.DisableTypoToleranceOnAttributesOption {
	for _, o := range opts {
		if v, ok := o.(*opt.DisableTypoToleranceOnAttributesOption); ok {
			return v
		}
	}
	return nil
}
1309738
func (c *Conn) GetAttributes(attr, value string, attrs []string) (*ldap.Entry, error) {
	return c.SearchOne(fmt.Sprintf("(%s=%s)", attr, value), attrs)
}
557842
func ExtractUnretrievableAttributes(opts ...interface{}) *opt.UnretrievableAttributesOption {
	for _, o := range opts {
		if v, ok := o.(*opt.UnretrievableAttributesOption); ok {
			return v
		}
	}
	return nil
}
11677
func (b *BinaryAttribute) GetSysValFromString(userVal string) []byte {
	f, err := strconv.ParseFloat(userVal, 64)
	if err != nil {
		panic(err)
	}
	ret := make([]byte, 1)
	if f > 0 {
		ret[0] = 1
	}
	return ret
}
944604
func (e *Entry) GetAttributeValue(attribute string) string {
	values := e.GetAttributeValues(attribute)
	if len(values) == 0 {
		return ""
	}
	return values[0]
}
23813
func (e *Element) GetAttribute(name string) string {
	attr, err := e.GetAttributes()
	if err != nil {
		return ""
	}
	return attr[name]
}
327405
func (d *downloader) getTotalBytes() int64 {
	d.m.Lock()
	defer d.m.Unlock()

	return d.totalBytes
}
748474
func ExtractSearchableAttributes(opts ...interface{}) *opt.SearchableAttributesOption {
	for _, o := range opts {
		if v, ok := o.(*opt.SearchableAttributesOption); ok {
			return v
		}
	}
	return nil
}
637691
func getAttributesFromCert(cert *x509.Certificate) ([]byte, error) {
	for _, ext := range cert.Extensions {
		if isAttrOID(ext.Id) {
			return ext.Value, nil
		}
	}
	return nil, nil
}
358740
func (c *ClassifierDeserializer) GetAttributeForKey(key string) (Attribute, error) {
	b, err := c.GetBytesForKey(key)
	if err != nil {
		return nil, WrapError(err)
	}
	attr, err := DeserializeAttribute(b)
	if err != nil {
		return nil, WrapError(err)
	}
	return attr, nil
}
1160179
func (b *BinningFilter) GetAttributesAfterFiltering() []base.FilteredAttribute {
	oldAttrs := b.train.AllAttributes()
	ret := make([]base.FilteredAttribute, len(oldAttrs))
	for i, a := range oldAttrs {
		if b.attrs[a] {
			retAttr := new(base.CategoricalAttribute)
			minVal := b.minVals[a]
			maxVal := b.maxVals[a]
			delta := float64(maxVal-minVal) / float64(b.bins)
			retAttr.SetName(a.GetName())
			for i := 0; i <= b.bins; i++ {
				floatVal := float64(i)*delta + minVal
				fmtStr := fmt.Sprintf("%%.%df", a.(*base.FloatAttribute).Precision)
				binVal := fmt.Sprintf(fmtStr, floatVal)
				retAttr.GetSysValFromString(binVal)
			}
			ret[i] = base.FilteredAttribute{a, retAttr}
		} else {
			ret[i] = base.FilteredAttribute{a, a}
		}
	}
	return ret
}
347923
func (c *clientIdentityImpl) AssertAttributeValue(attrName, attrValue string) error {
	val, ok, err := c.GetAttributeValue(attrName)
	if err != nil {
		return err
	}
	if !ok {
		return errors.Errorf("Attribute '%s' was not found", attrName)
	}
	if val != attrValue {
		return errors.Errorf("Attribute '%s' equals '%s', not '%s'", attrName, val, attrValue)
	}
	return nil
}
1164720
func (fs *errorFS) GetInodeAttributes(
	ctx context.Context,
	op *fuseops.GetInodeAttributesOp) (err error) {
	if fs.transformError(op, &err) {
		return
	}

	// Figure out which inode the request is for.
	switch {
	case op.Inode == fuseops.RootInodeID:
		op.Attributes = fuseops.InodeAttributes{
			Mode: os.ModeDir | 0777,
		}

	case op.Inode == fooInodeID:
		op.Attributes = fooAttrs

	default:
		err = fmt.Errorf("Unknown inode: %d", op.Inode)
		return
	}

	return
}
1335336
func (s *DomainMetadataOutput) SetAttributeValuesSizeBytes(v int64) *DomainMetadataOutput {
	s.AttributeValuesSizeBytes = &v
	return s
}
147104
func (c *Cache) GetBytes(key string) (value []byte, ok bool) {
	v, ok := c.Get(key)
	if !ok {
		return nil, false
	}
	return v.([]byte), true
}
998690
func getBytes(raw string) []byte {
	rawSlice := strings.FieldsFunc(raw, isArray)
	result := make([]byte, len(rawSlice))

	i := 0
	for _, b := range rawSlice {
		fmt.Sscan(b, &result[i])
		i++
	}
	return result
}