Normalize attr state
10515
def norm_attr(self):
        
        if not self.HAS_ATTR:
            return

        self.HAS_ATTR = False
        self.emit('call', 'COPY_ATTR', 0)
        backend.REQUIRES.add('copy_attr.asm')
551969
function Attr(model, value, mutator) {
        var _this = _super.call(this, model, value, mutator) /* istanbul ignore next */ || this;
        _this.value = value;
        return _this;
    }
1122933
def keybinding(attr):
    """"""
    ks = getattr(QKeySequence, attr)
    return from_qvariant(QKeySequence.keyBindings(ks)[0], str)
737871
def _attr_to_property(self, attr):
        """"""

        # get the property
        prop = self._properties.get(attr)
        if not prop:
            raise PropertyError(attr)

        # found it
        return prop
32434
function attr(obj, key) {
    if (!obj[key]) {
      return '';
    }
    var val = obj[key];
    if (val === true) {
      return key;
    }
    return key + '="' + obj[key] + '"';
  }
745652
def _attr_seq(self, attrs):
        
        attrs = attrs.strip()
        attr_lst = attrs.split()
        return sorted(attr_lst)
387963
def get_attr(item, name, default=None):
    '''  '''
    try:
        val = item[name]
    except (KeyError, TypeError):
        try:
            val = getattr(item, name)
        except AttributeError:
            val = default
    return val
134526
def restore_attribute!(attr_name)
        attr_name = attr_name.to_s
        if attribute_changed?(attr_name)
          __send__("#{attr_name}=", attribute_was(attr_name))
          clear_attribute_change(attr_name)
        end
      end
23013
def set_state(self, state, *, index=0):
        """"""
        return self.set_values({
            ATTR_DEVICE_STATE: int(state)
        }, index=index)
108904
function genAttrs(attrs) {
    return _.reduce(attrs, (acc, v, k) => {
        let attr = ` ${k}`;
        if (v !== true) {
            attr += `="${v}"`;
        }
        return acc + attr;
    }, '');
}
299620
function (attr, attrName) {
            if (_.isObject(attr) && !_.isDate(attr) && !_.isBoolean(attr) && !_.isString(attr) && !_.isNumber(attr) && !_.isFunction(attr) && !_.isRegExp(attr) && !_.isArray(attr)) {
                //attr = _removeAttributes();
                for (var aIndex in attr) {
                    attr[aIndex] = _removeAttributes(attr[aIndex], aIndex);
                }
                return attr;
            }
            else {
                if (_.indexOf(allowedAttributes, attrName) != -1) {
                    if (_.isFunction(attr)) {
                        attr = _functionName(attr);
                    }

                    return attr;
                }
                else {
                    return;
                }
            }
        }
882456
def attr(cls, iterable, attr_name):
    

    return cls(getattr(x, attr_name) for x in iterable)
1116294
function parseAttributes(attrStr) {
    var reAttributes = /([^=<>\"\'\s]+)\s*(?:=\s*["']?([^"']*)["']?)?/g;
    var result = {};
    var match;

    if (attrStr) {
        while (match = reAttributes.exec(attrStr)) {
            result[match[1]] = match[2] || true;
        }
    }

    return result;
}
455887
function normalizeAttributeKey(key) {
  const hyphenIndex = key.indexOf('-');

  if (hyphenIndex !== -1 && key.match(HTML_CUSTOM_ATTR_R) === null) {
    key = key.replace(CAPTURE_LETTER_AFTER_HYPHEN, function(_, letter) {
      return letter.toUpperCase();
    });
  }

  return key;
}
884523
def restore_attr(self, attr_name):
        
        original_attr = self._original_attr(attr_name)
        if self._original_attr(attr_name):
            setattr(self.obj.__class__, attr_name, original_attr)
498200
function Attr(name, value) {
    util.extend(this, {
        name: name,
        localName: name,
        value: value,
        specified: true,
        namespaceURI: null,
        prefix: null
    });
}
784
def setattrdeep(obj, attr, val):
    ''
    attrs = attr.split('.')

    for a in attrs[:-1]:
        obj = getattr(obj, a)
    setattr(obj, attrs[-1], val)