// RemoveClassAttribute removes the given Attribute from the set of
// class Attributes.
499379
func (v *InstancesView) RemoveClassAttribute(a Attribute) error {
	v.classAttrs[a] = false
	return nil
}
288923
func SetAttribute(e xml.StartElement, name, value string) xml.StartElement {
	for i := range e.Attr {
		if e.Attr[i].Name.Local == name {
			e.Attr[i].Value = value
			return e
		}
	}
	e.Attr = append(e.Attr, xml.Attr{Name: xml.Name{Local: name}, Value: value})
	return e
}
405597
func NewRemoveAttributeArgs(nodeID NodeID, name string) *RemoveAttributeArgs {
	args := new(RemoveAttributeArgs)
	args.NodeID = nodeID
	args.Name = name
	return args
}
1028421
func ExtractAttributesForFaceting(opts ...interface{}) *opt.AttributesForFacetingOption {
	for _, o := range opts {
		if v, ok := o.(*opt.AttributesForFacetingOption); ok {
			return v
		}
	}
	return nil
}
794916
func (bow *Browser) SetAttribute(a Attribute, v bool) {
	bow.attributes[a] = v
}
1086882
func (e *Element) Remove() {
	if !e.Removed() {
		e.attrs = append(e.attrs, &Attribute{"haikuRemoved", ""})
		e.Mutation.Remove()
	}
}
55509
func (c *Config) Remove(attrs []string) (*Config, error) {
	defined := c.AllAttrs()
	for _, k := range attrs {
		delete(defined, k)
	}
	return New(NoDefaults, defined)
}
1356697
func (web *webAPIHandlers) RemoveObject(r *http.Request, args *RemoveObjectArgs, reply *WebGenericRep) error {
	objectAPI := web.ObjectAPI()
	if objectAPI == nil {
		return toJSONError(errServerNotInitialized)
	}
	listObjects := objectAPI.ListObjects
	if web.CacheAPI() != nil {
		listObjects = web.CacheAPI().ListObjects
	}

	claims, owner, authErr := webRequestAuthenticate(r)
	if authErr != nil {
		if authErr == errNoAuthToken {
			// Check if all objects are allowed to be deleted anonymously
			for _, object := range args.Objects {
				if !globalPolicySys.IsAllowed(policy.Args{
					Action:          policy.DeleteObjectAction,
					BucketName:      args.BucketName,
					ConditionValues: getConditionValues(r, "", ""),
					IsOwner:         false,
					ObjectName:      object,
				}) {
					return toJSONError(errAuthentication)
				}
			}
		} else {
			return toJSONError(authErr)
		}
	}

	if args.BucketName == "" || len(args.Objects) == 0 {
		return toJSONError(errInvalidArgument)
	}

	// Check if bucket is a reserved bucket name or invalid.
	if isReservedOrInvalidBucket(args.BucketName, false) {
		return toJSONError(errInvalidBucketName)
	}

	reply.UIVersion = browser.UIVersion
	if isRemoteCallRequired(context.Background(), args.BucketName, objectAPI) {
		sr, err := globalDNSConfig.Get(args.BucketName)
		if err != nil {
			if err == dns.ErrNoEntriesFound {
				return toJSONError(BucketNotFound{
					Bucket: args.BucketName,
				}, args.BucketName)
			}
			return toJSONError(err, args.BucketName)
		}
		core, err := getRemoteInstanceClient(r, getHostFromSrv(sr))
		if err != nil {
			return toJSONError(err, args.BucketName)
		}
		objectsCh := make(chan string)

		// Send object names that are needed to be removed to objectsCh
		go func() {
			defer close(objectsCh)

			for _, objectName := range args.Objects {
				objectsCh <- objectName
			}
		}()

		for resp := range core.RemoveObjects(args.BucketName, objectsCh) {
			if resp.Err != nil {
				return toJSONError(resp.Err, args.BucketName, resp.ObjectName)
			}
		}
		return nil
	}

	var err error
next:
	for _, objectName := range args.Objects {
		// If not a directory, remove the object.
		if !hasSuffix(objectName, slashSeparator) && objectName != "" {
			// Deny if WORM is enabled
			if globalWORMEnabled {
				if _, err = objectAPI.GetObjectInfo(context.Background(), args.BucketName, objectName, ObjectOptions{}); err == nil {
					return toJSONError(errMethodNotAllowed)
				}
			}
			// Check for permissions only in the case of
			// non-anonymous login. For anonymous login, policy has already
			// been checked.
			if authErr != errNoAuthToken {
				if !globalIAMSys.IsAllowed(iampolicy.Args{
					AccountName:     claims.Subject,
					Action:          iampolicy.DeleteObjectAction,
					BucketName:      args.BucketName,
					ConditionValues: getConditionValues(r, "", claims.Subject),
					IsOwner:         owner,
					ObjectName:      objectName,
				}) {
					return toJSONError(errAccessDenied)
				}
			}

			if err = deleteObject(context.Background(), objectAPI, web.CacheAPI(), args.BucketName, objectName, r); err != nil {
				break next
			}
			continue
		}

		if !globalIAMSys.IsAllowed(iampolicy.Args{
			AccountName:     claims.Subject,
			Action:          iampolicy.DeleteObjectAction,
			BucketName:      args.BucketName,
			ConditionValues: getConditionValues(r, "", claims.Subject),
			IsOwner:         owner,
			ObjectName:      objectName,
		}) {
			return toJSONError(errAccessDenied)
		}

		// For directories, list the contents recursively and remove.
		marker := ""
		for {
			var lo ListObjectsInfo
			lo, err = listObjects(context.Background(), args.BucketName, objectName, marker, "", 1000)
			if err != nil {
				break next
			}
			marker = lo.NextMarker
			for _, obj := range lo.Objects {
				err = deleteObject(context.Background(), objectAPI, web.CacheAPI(), args.BucketName, obj.Name, r)
				if err != nil {
					break next
				}
			}
			if !lo.IsTruncated {
				break
			}
		}
	}

	if err != nil && !isErrObjectNotFound(err) {
		// Ignore object not found error.
		return toJSONError(err, args.BucketName, "")
	}

	return nil
}
206366
func (s Session) AddAttribute(attribute string, values ...string) Session {
	if len(values) == 0 {
		return s.AddFlag(attribute)
	}
	v := make([]byte, 0, 512)
	v = append(v, attribute...)
	v = appendRune(v, attributesDelimiter)
	v = appendJoinStrings(v, values...)
	return s.append(TypeAttribute, v)
}
1056908
func GetAttribute(o *js.Object, key string) string {
	return o.Call("getAttribute", key).String()
}
563482
func (b *BinaryConvertFilter) AddAttribute(a base.Attribute) error {
	b.attrs = append(b.attrs, a)
	return nil
}
925030
func (s *Selection) RemoveClass(class ...string) *Selection {
	var rclasses []string

	classStr := strings.TrimSpace(strings.Join(class, " "))
	remove := classStr == ""

	if !remove {
		rclasses = getClassesSlice(classStr)
	}

	for _, n := range s.Nodes {
		if remove {
			removeAttr(n, "class")
		} else {
			classes, attr := getClassesAndAttr(n, true)
			for _, rcl := range rclasses {
				classes = strings.Replace(classes, " "+rcl+" ", " ", -1)
			}

			setClasses(n, attr, classes)
		}
	}

	return s
}
713222
func (t *Table) AddAttribute(attr Attribute) error {
	t.attributes = append(t.attributes, attr)
	return nil
}
304364
func (_class SubjectClass) RemoveFromRoles(sessionID SessionRef, self SubjectRef, role RoleRef) (_err error) {
	_method := "subject.remove_from_roles"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertSubjectRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_roleArg, _err := convertRoleRefToXen(fmt.Sprintf("%s(%s)", _method, "role"), role)
	if _err != nil {
		return
	}
	_, _err =  _class.client.APICall(_method, _sessionIDArg, _selfArg, _roleArg)
	return
}
498105
func (client *Client) ModifyVpcAttribute(args *ModifyVpcAttributeArgs) error {
	response := ModifyVpcAttributeResponse{}
	return client.Invoke("ModifyVpcAttribute", args, &response)
}
1374463
func GetAttribute(e xml.StartElement, name xml.Name) string {
	for _, a := range e.Attr {
		if NameEquals(a.Name, name) {
			return a.Value
		}
	}
	return ""
}
486500
func RemoveImage(ctx context.Context, client client.ImageAPIClient, image string) error {
	_, err := client.ImageRemove(ctx, image, types.ImageRemoveOptions{})
	return err
}