Set or remove "data-" attributes
@param {HTMLElement} domElement
@param {Object} dataset
@param {Boolean} remove if false or undefined, attributes will be set instead
776294
function (domElement, dataset, remove) {
            var fullKey, stringUtil = ariaUtilsString;
            for (var dataKey in dataset) {
                if (dataset.hasOwnProperty(dataKey) && !ariaUtilsJson.isMetadata(dataKey)) {
                    if (this.datasetRegex.test(dataKey)) {
                        fullKey = "data-" + stringUtil.camelToDashed(dataKey);
                        if (remove) {
                            domElement.removeAttribute(fullKey);
                        } else {
                            domElement.setAttribute(fullKey, dataset[dataKey]);
                        }
                    } else {
                        this.$logError(this.INVALID_DATASET_KEY, dataKey);
                    }
                }
            }
        }
1327948
def removeDataset(self, dataset):
        
        for datasetRecord in models.Dataset.select().where(
                        models.Dataset.id == dataset.getId()):
            datasetRecord.delete_instance(recursive=True)
235936
function (domElement, event) {
            var label;
            var domUtil = ariaUtilsDom;
            label = domElement.textContent || domElement.innerText;
            domUtil.replaceDomElement(domElement.parentNode, this._textInputField);
            var removedSuggestionInfo = this._removeValue(label);
            var removedSuggestion = removedSuggestionInfo.removedSuggestion;
            var removedSuggestionIndex = removedSuggestionInfo.removedSuggestionIndex;
            this._keepFocus = true;
            this._textInputField.focus();
            if (removedSuggestion) {
                var report = this.controller.editValue(removedSuggestion, removedSuggestionIndex);
                this._reactToControllerReport(report);
            }
            this._restoreKeepFocus();
        }
260125
function removeAllAttributes( DOMElement $element )
    {
        $attribs = $element->attributes;
        for ( $i = $attribs->length - 1; $i >= 0; $i-- )
        {
            $element->removeAttributeNode( $attribs->item( $i ) );
        }
    }
1312459
function(element, key, value, writeToDom) {

			// DELETE
			if (value === null) { // delete this property
				var dataObject = getDataObject(element, key);
				if (!dataObject) {
					return;
				}

				var dataCount = element.getAggregation("customData").length;
				if (dataCount == 1) {
					element.destroyAggregation("customData", true); // destroy if there is no other data
				} else {
					element.removeAggregation("customData", dataObject, true);
					dataObject.destroy();
				}

				// ADD or CHANGE
			} else {
				var CustomData = sap.ui.requireSync('sap/ui/core/CustomData');
				var dataObject = getDataObject(element, key);
				if (dataObject) {
					dataObject.setValue(value);
					dataObject.setWriteToDom(writeToDom);
				} else {
					var dataObject = new CustomData({key:key,value:value, writeToDom:writeToDom});
					element.addAggregation("customData", dataObject, true);
				}
			}
		}
1248416
function getData(element, name) {
  if (isObject(element[name])) {
    return element[name];
  } else if (element.dataset) {
    return element.dataset[name];
  }

  return element.getAttribute('data-' + hyphenate(name));
}
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);
    }
  });
}
316404
def _fix_data_select(self):
        

        elements = self.document.select('*')
        for element in elements:
            attributes = element.attrs.keys()
            data_attributes = list()
            for attribute in attributes:
                if bool(re.findall('^data-', attribute)):
                    data_attributes.append({
                        'original': attribute,
                        'modified': re.sub('data-', 'dataaaaaa', attribute),
                        'value': element[attribute]
                    })
            if data_attributes:
                auxiliar_element = BeautifulSoupHTMLDOMElement(element)
                for data_attribute in data_attributes:
                    auxiliar_element.remove_attribute(
                        data_attribute['original']
                    )
                    auxiliar_element.set_attribute(
                        data_attribute['modified'],
                        data_attribute['value']
                    )
526771
public void setAttributeSet(ElemAttributeSet attrSet)
  {

    if (null == m_attributeSets)
    {
      m_attributeSets = new Vector();
    }

    m_attributeSets.addElement(attrSet);
  }
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)
833161
function setDomAttrs(attrs, el) {
	for (let attr in attrs) {
		if (!attrs.hasOwnProperty(attr)) { continue; }
		switch (attr) {
			case 'className':
			case 'id':
				el[attr] = attrs[attr];
				break;
			default:
				el.setAttribute(attr, attrs[attr]);
				break;
		}
	}

	return el;
}
1363314
def delete_dataset(self, dataset, delete_nonempty=True):
        

        if not self.dataset_exists(dataset):
            return

        self.client.datasets().delete(projectId=dataset.project_id,
                                      datasetId=dataset.dataset_id,
                                      deleteContents=delete_nonempty).execute()
1163539
public void addDataElement(String elemName, String content, Attributes attrs) {
        writeDataElement(elemName, attrs, content);
    }
710523
function (attrName, attrVal) {
            if (!attrName) {
                delete this.attrs;
                return;
            }
            if(!this.attrs){
                this.attrs = {};
            }
            if (utils.isObject(attrName)) {
                for (var a in attrName) {
                    if (!attrName[a]) {
                        delete this.attrs[a]
                    } else {
                        this.attrs[a.toLowerCase()] = attrName[a];
                    }
                }
            } else {
                if (!attrVal) {
                    delete this.attrs[attrName]
                } else {
                    this.attrs[attrName.toLowerCase()] = attrVal;
                }

            }
        }
691944
function data(element) {
            var options = {}
            Util.each(element.attributes, function(attribute) {
                var ma = /data-(.+)/.exec(attribute.name)
                if (!ma) return

                var value = attribute.value
                try {
                    /* jshint evil:true */
                    options[ma[1]] = /^\s*[\[{]/.test(value) ?
                        eval('(function(){ return Array.prototype.slice.call(arguments)[0] })(' + value + ')') :
                        value
                } catch (error) {
                    options[ma[1]] = value
                }

                if (options[ma[1]] === 'true') options[ma[1]] = true
                if (options[ma[1]] === 'false') options[ma[1]] = false
            })
            return options
        }
366123
function (el, attrName, oldValue) {
			if (setData.get.call(el, "canHasAttributesBindings")) {
				attrName = attrName.toLowerCase();
				return setImmediate(function () {
					domDispatch.call(el, {
						type: "attributes",
						attributeName: attrName,
						target: el,
						oldValue: oldValue,
						bubbles: false
					}, []);
				});
			}
		}
858014
function setAttributeToElement(element, attributeName, value) {
  if (value === null || typeof value === 'undefined') {
    element.removeAttribute(attributeName);
  } else {
    const text = String(value);
    // Avoid recursive attributeChangedCallback calls.
    if (element.getAttribute(attributeName) !== text) {
      element.setAttribute(attributeName, value);
    }
  }
}