// Attr sets the fuse attribute for the file
335623
func (f *File) Attr(ctx context.Context, attr *fuse.Attr) (err error) {
	// Set attributes from resource metadata
	attr.Mode = f.resource.Mode()
	attr.Uid = f.uid
	attr.Gid = f.gid

	if rf, ok := f.resource.(continuity.RegularFile); ok {
		attr.Nlink = uint32(len(rf.Paths()))
		attr.Size = uint64(rf.Size())
	} else {
		attr.Nlink = 1
	}

	attr.Inode = f.inode

	return nil
}
1145131
func (s *DB) Attrs(attrs ...interface{}) *DB {
	return s.clone().search.Attrs(attrs...).db
}
593841
func (ProfileList) Attr(_ context.Context, a *fuse.Attr) error {
	a.Mode = os.ModeDir | 0755
	return nil
}
1229574
func AttrContains(e Markup, f, val string) bool {
	for _, as := range e.Attributes() {
		if !strings.Contains(as.Name, f) {
			continue
		}

		if val != "" {
			if !strings.Contains(as.Value, val) {
				continue
			}
		}

		return true
	}

	return false
}
905682
func (h *XMLElement) ChildAttr(xpathQuery, attrName string) string {
	if h.isHTML {
		child := htmlquery.FindOne(h.DOM.(*html.Node), xpathQuery)
		if child != nil {
			for _, attr := range child.Attr {
				if attr.Key == attrName {
					return strings.TrimSpace(attr.Val)
				}
			}
		}
	} else {
		child := xmlquery.FindOne(h.DOM.(*xmlquery.Node), xpathQuery)
		if child != nil {
			for _, attr := range child.Attr {
				if attr.Name.Local == attrName {
					return strings.TrimSpace(attr.Value)
				}
			}
		}
	}

	return ""
}
1224145
func (r *Request) Attributes() *FileStat {
	fs, _ := getFileStat(r.Flags, r.Attrs)
	return fs
}
1247873
func (fl *FolderList) Attr(ctx context.Context, a *fuse.Attr) error {
	a.Mode = os.ModeDir | 0500
	a.Uid = uint32(os.Getuid())
	a.Inode = fl.inode
	return nil
}
1110075
func (n *Closure) Attributes() map[string]interface{} {
	return map[string]interface{}{
		"ReturnsRef":    n.ReturnsRef,
		"Static":        n.Static,
		"PhpDocComment": n.PhpDocComment,
	}
}
624936
func (cmd *Command) AttrsList(startKey string) ([]Attrs, error) {
	id, err := cmd.client.cmd(cmd.cmd)
	if err != nil {
		return nil, err
	}
	cmd.client.text.StartResponse(id)
	defer cmd.client.text.EndResponse(id)
	return cmd.client.readAttrsList(startKey)
}
1186798
func (o *Object) Attrs(attr string) []string {
	o.mu.RLock()
	defer o.mu.RUnlock()
	return o.attr[attr]
}
342990
func (r *DB) at(h uint16) (a *attr, ok bool) {
	i := r.idx(int(h))
	if i < 0 {
		return nil, false
	}
	return r.attrs[i], true
}
523896
func (c *ServiceCurve) Attrs() (uint32, uint32, uint32) {
	return c.m1, c.d, c.m2
}
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
}
1124611
func (in *inode) SetAttributes(
	size *uint64,
	mode *os.FileMode,
	mtime *time.Time) {
	// Update the modification time.
	in.attrs.Mtime = time.Now()

	// Truncate?
	if size != nil {
		intSize := int(*size)

		// Update contents.
		if intSize <= len(in.contents) {
			in.contents = in.contents[:intSize]
		} else {
			padding := make([]byte, intSize-len(in.contents))
			in.contents = append(in.contents, padding...)
		}

		// Update attributes.
		in.attrs.Size = *size
	}

	// Change mode?
	if mode != nil {
		in.attrs.Mode = *mode
	}

	// Change mtime?
	if mtime != nil {
		in.attrs.Mtime = *mtime
	}
}
1275852
func Attr(node *html.Node, key string) string {
	for _, a := range node.Attr {
		if a.Key == key {
			return a.Val
		}
	}
	return ""
}
1317020
func (c *connector) GetAttr(key string) interface{} {
	c.RLock()
	v := c.attrs[key]
	c.RUnlock()
	return v
}
1129426
func SetAttribute(o *js.Object, key string, value string) {
	o.Call("setAttribute", key, value)
}