/*
Clear attributes
979245
function(options) {
            options = _.defaults(options || {}, {
                silent: false
            });
            this.attributes = {};
            if (!options.silent) {
                this.trigger("clear");
                this.trigger("change");
            }
            return this;
        }
976027
def remove_on_change(self, attr, *callbacks):
        '''  '''
        if len(callbacks) == 0:
            raise ValueError("remove_on_change takes an attribute name and one or more callbacks, got only one parameter")
        _callbacks = self._callbacks.setdefault(attr, [])
        for callback in callbacks:
            _callbacks.remove(callback)
193754
function(value, attr) {
          if (!self._pending[attr] && !self._silent[attr]) {
            delete self.changed[attr];
          }
        }
970205
def clear_attribute(attribute)
      # the current value to clear
      current = send(attribute)
      return if current.nil?
      # call the current value clear if possible.
      # otherwise, set the attribute to the empty value.
      if current.respond_to?(:clear) then
        current.clear
      else
        writer = self.class.property(attribute).writer
        value = self.class.empty_value(attribute)
        send(writer, value)
      end
    end
1355918
public function removeAttribute($attributes)
    {
        if (is_string($attributes)) {
            $attributes = explode(',', $attributes);
        }

        $attributes = array_map('trim', $attributes);
        $attributes = array_filter($attributes);

        foreach ($attributes as $attribute) {
            if (array_key_exists($attribute, $this->storage)) {
                unset($this->storage[ $attribute ]);
            } elseif (strpos($attribute, '*') !== false) {
                $attribute = str_replace('*', '', $attribute);
                foreach ($this->storage as $key => $value) {
                    if (preg_match("/\b$attribute\b/i", $key)) {
                        unset($this->storage[ $key ]);
                    }
                }
            }
        }
    }
500207
private void removeAttribute(int list, TreeHtmlAttributeInfo attr, RemoveInfo removes)
    {
        assert(attr != null);

        // get the correct array list
        ArrayList al = _lists[list];
        assert(al != null);

        // remove the attributes from the array list -- this should never fail
        boolean removed = al.remove(attr);
        assert(removed) : "Unable to remove attribute:" + attr.getAttribute() + "=" + attr.getValue();

        // if there was a list of removed attributes we need to possibly add one back
        // We do this by walking the removes list and when we find an attribute with the
        // same name and supporting the same list type, we add it to the list.
        if (removes != null) {

            // walk the remove list looking for an attribute with the same name
            int cnt = removes.removes.size();
            for (int i = 0; i < cnt; i++) {
                TreeHtmlAttributeInfo a = (TreeHtmlAttributeInfo) removes.removes.get(i);
                if (attr.getAttribute().equals(a.getAttribute())) {

                    // based upon the type we are removing, if the matching attribute supports the type
                    // then we add it back.
                    switch (list) {
                        case TreeHtmlAttributeInfo.HTML_LOCATION_DIV:
                            if (a.isOnDiv() && !al.contains(a))
                                al.add(a);
                            break;
                        case TreeHtmlAttributeInfo.HTML_LOCATION_ICON:
                            if (a.isOnIcon() && !al.contains(a))
                                al.add(a);
                            break;
                        case TreeHtmlAttributeInfo.HTML_LOCATION_SELECTION_LINK:
                            if (a.isOnSelectionLink() && !al.contains(a))
                                al.add(a);
                            break;
                    }
                }
            }
        }
    }
1092470
function setElAttributes(el, attributes) {
  Object.getOwnPropertyNames(attributes).forEach(function (attrName) {
    var attrValue = attributes[attrName];

    if (attrValue === null || typeof attrValue === 'undefined' || attrValue === false) {
      el.removeAttribute(attrName);
    } else {
      el.setAttribute(attrName, attrValue === true ? '' : attrValue);
    }
  });
}
739878
def reset_attributes(self):
        "  "
        self._winapi(windll.kernel32.SetConsoleTextAttribute, self.hconsole,
                     self.default_attrs)
1363335
private void cleanMixedAttributes() {
        currentFieldAttributes.remove(HttpHeaderValues.CHARSET);
        currentFieldAttributes.remove(HttpHeaderNames.CONTENT_LENGTH);
        currentFieldAttributes.remove(HttpHeaderNames.CONTENT_TRANSFER_ENCODING);
        currentFieldAttributes.remove(HttpHeaderNames.CONTENT_TYPE);
        currentFieldAttributes.remove(HttpHeaderValues.FILENAME);
    }
418109
public void clear() {
        this.attributes.clear();
        this.queryParameters = null;
        this.inReader = null;
        this.streamActive = false;
        this.inStream = null;
        this.encoding = null;
        this.sessionData = null;
        this.strippedURI = null;
        this.srvContext = null;
        this.srvPath = null;
        this.pathInfo = null;
        this.pathInfoComputed = false;
        this.filters = null;
    }
1333332
function () {
        var enabledAttributes = this.getEnabledAttributes();
        for (var i = 0; i < enabledAttributes.length; i++) {
            this.dirtyAttribute(enabledAttributes[i]);
        }
        this.dirtyIndices();
        this._enabledAttributes = null;

        this._cache.dirty('any');
    }
229558
protected static function clearAttributes(array $attributes, array $clear): array
    {
        foreach ($clear as $attributeName) {
            if (array_key_exists($attributeName, $attributes)) {
                unset($attributes[$attributeName]);
            }
        }
        return $attributes;
    }
392553
function removeAttribute(element, name) {
    element = getComponentNode(element) || element;
    let oldValue = element.getAttribute(name);
    element.removeAttribute(name);
    return update(element, name, oldValue, null);
}
689020
protected function _cleanAttributes($attributes)
    {
        foreach ($attributes as $key => $value) {
            if (is_int($key) || in_array($key, $this->_config['ignored'])) {
                unset($attributes[$key]);
            } else if ($key != 'memberof' && is_array($value) && count($value) == 1) {
                $attributes[$key] = $value[0];
            }
        }

        return $attributes;
    }
476342
public function purgeAttributes()
    {
        // Get the attribute keys
        $keys = array_keys($this->getAttributes());

        // Filter out keys that should purged
        $attributes = array_filter($keys, function ($key) {
            // Remove attributes that should be purged
            if (in_array($key, $this->getPurgeable())) {
                return false;
            }

            // Remove attributes ending with _confirmation
            if (Str::endsWith($key, '_confirmation')) {
                return false;
            }

            // Remove attributes starting with _ prefix
            if (Str::startsWith($key, '_')) {
                return false;
            }

            return true;
        });

        // Keep only the attributes that were not purged
        $this->attributes = array_intersect_key($this->getAttributes(), array_flip($attributes));
    }
830450
function(options) {
      (options || (options = {})).unset = true;
      return this.set(_.clone(this.attributes), options);
    }
441775
public function clear()
    {
        $this->id = null;
        $this->slug = null;
        $this->has_attribute_av_value = null;
        $this->is_multilingual_attribute_av_value = null;
        $this->pattern = null;
        $this->css_class = null;
        $this->input_type = null;
        $this->max = null;
        $this->min = null;
        $this->step = null;
        $this->image_max_width = null;
        $this->image_max_height = null;
        $this->image_ratio = null;
        $this->created_at = null;
        $this->updated_at = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->applyDefaultValues();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }