// Attributes takes a js object and extracts the attribute lists from it
540455
func Attributes(co *js.Object) map[string]string {
	o := co.Get("attributes")

	if o == nil || o == js.Undefined {
		return nil
	}

	attrs := map[string]string{}

	length := o.Get("length").Int()

	for i := 0; i < length; i++ {
		item := o.Call("item", i)
		attrs[item.Get("name").String()] = item.Get("value").String()
	}

	return attrs
}
488783
func (m *AttributesMixin) Attribute(key string) string {
	if m.attributes == nil {
		return ""
	}
	return m.attributes[key]
}
498448
func (dev Device) Attributes(attrs ...DeviceAttribute) ([]int, error) {
	if len(attrs) == 0 {
		return nil, nil
	}
	cAttrs := make([]C.CUdevice_attribute, len(attrs))
	cRetVal := make([]C.int, len(attrs))
	size := C.int(len(attrs))

	for i, v := range attrs {
		cAttrs[i] = C.CUdevice_attribute(v)
	}

	err := result(C.cuDeviceGetAttributes(&cRetVal[0], &cAttrs[0], size, C.CUdevice(dev)))
	retVal := make([]int, len(attrs))
	for i, v := range cRetVal {
		retVal[i] = int(v)
	}

	return retVal, err
}
148434
func HasAttribute(o *js.Object, key string) bool {
	return o.Call("hasAttribute", key).Bool()
}
535528
func (s *ListFacetAttributesOutput) SetAttributes(v []*FacetAttribute) *ListFacetAttributesOutput {
	s.Attributes = v
	return s
}
125148
func (s *CreatePlatformApplicationInput) SetAttributes(v map[string]*string) *CreatePlatformApplicationInput {
	s.Attributes = v
	return s
}
1028421
func ExtractAttributesForFaceting(opts ...interface{}) *opt.AttributesForFacetingOption {
	for _, o := range opts {
		if v, ok := o.(*opt.AttributesForFacetingOption); ok {
			return v
		}
	}
	return nil
}
523896
func (c *ServiceCurve) Attrs() (uint32, uint32, uint32) {
	return c.m1, c.d, c.m2
}
1198745
func (s *App) SetAttributes(v map[string]*string) *App {
	s.Attributes = v
	return s
}
29286
func (xmlNode *XmlNode) Attribute(name string) (attribute *AttributeNode) {
	if xmlNode.NodeType() != XML_ELEMENT_NODE {
		return
	}
	nameBytes := GetCString([]byte(name))
	namePtr := unsafe.Pointer(&nameBytes[0])
	attrPtr := C.xmlHasNsProp(xmlNode.Ptr, (*C.xmlChar)(namePtr), nil)
	if attrPtr == nil {
		return
	} else {
		node := NewNode(unsafe.Pointer(attrPtr), xmlNode.Document)
		if node, ok := node.(*AttributeNode); ok {
			attribute = node
		}
	}
	return
}
1174938
func (s *PublicEndpoint) SetAttributes(v map[string][]*string) *PublicEndpoint {
	s.Attributes = v
	return s
}
536074
func (s *DeletableItem) SetAttributes(v []*DeletableAttribute) *DeletableItem {
	s.Attributes = v
	return s
}
853053
func (a customResourceStrategy) GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error) {
	accessor, err := meta.Accessor(obj)
	if err != nil {
		return nil, nil, err
	}
	return labels.Set(accessor.GetLabels()), objectMetaFieldsSet(accessor, a.namespaceScoped), nil
}
133295
func (m *Mat64Instances) AllAttributes() []Attribute {
	ret := make([]Attribute, len(m.attributes))
	for i, a := range m.attributes {
		ret[i] = a
	}
	return ret
}
1130573
func (base Base) Attrs() string {
	var ret string

	if base.ID != "" {
		ret += " id='" + base.ID + "'"
	}

	//Classes
	if len(base.Classes) != 0 {
		ret += " class='"
		ret += strings.Join(base.Classes, " ")
		ret += "'"
	}

	//Style
	if len(base.Style) != 0 {
		ret += " style='"
		var keys []string
		for key := range base.Style {
			keys = append(keys, key)
		}
		sort.Strings(keys)
		for _, val := range keys {
			ret += val + ":" + base.Style[val] + ";"
		}
		ret += "'"
	}

	var keys []string
	for key := range base.Data {
		keys = append(keys, key)
	}
	sort.Strings(keys)
	for _, key := range keys {
		ret += " " + key + "='" + base.Data[key] + "'"
	}

	return ret
}
53620
func (s *Resource) SetAttributes(v map[string]*string) *Resource {
	s.Attributes = v
	return s
}
143282
func (s *Message) SetAttributes(v map[string]*string) *Message {
	s.Attributes = v
	return s
}