Find out the local name of an attribute

        :param attr: An Attribute dictionary
        :return: The local attribute name or "" if no mapping could be made
330290
def d_from_format(self, attr):
        
        if attr["name_format"]:
            if self.name_format == attr["name_format"]:
                try:
                    return self._fro[attr["name"].lower()]
                except KeyError:
                    pass
        else:  # don't know the name format so try all I have
            try:
                return self._fro[attr["name"].lower()]
            except KeyError:
                pass

        return ""
727522
def static_get_type_attr(t, name):
    
    for type_ in t.mro():
        try:
            return vars(type_)[name]
        except KeyError:
            pass
    raise AttributeError(name)
299653
def model_attr(attr_name):
    

    def model_attr(_value, context, **_params):
        value = getattr(context["model"], attr_name)
        return _attr(value)

    return model_attr
711883
public Attribute getAttributeByLocalName(CharSequence name) {
		for (Attribute attr : event.attributes)
			if (attr.localName.equals(name))
				return attr;
		return null;
	}
1143614
def attribute_name(self, attribute_name):
        

        if attribute_name is None:
            raise ValueError("Invalid value for `attribute_name`, must not be `None`")
        if len(attribute_name) < 1:
            raise ValueError("Invalid value for `attribute_name`, length must be greater than or equal to `1`")

        self._attribute_name = attribute_name
330002
static final String attr(Element element, String name, boolean ignoreNamespace) {
        NamedNodeMap attributes = element.getAttributes();

        for (int i = 0; i < attributes.getLength(); i++) {
            String localName = attributes.item(i).getNodeName();

            // [#103] If namespaces are ignored, consider only local
            // part of possibly namespace-unaware Element
            if (ignoreNamespace)
                localName = stripNamespace(localName);

            if (name.equals(localName))
                return attributes.item(i).getNodeValue();
        }

        return null;
    }
1299497
def attr(obj, attr):
    
    if not obj or not hasattr(obj, attr):
        return ''

    return getattr(obj, attr, '')
1334199
def get_attrs(self):
        
        self.encoding = _ensure_encoding(getattr(self.attrs, 'encoding', None))
        self.errors = _ensure_decoded(getattr(self.attrs, 'errors', 'strict'))
        for n in self.attributes:
            setattr(self, n, _ensure_decoded(getattr(self.attrs, n, None)))
444163
def view_attr(attr_name):
    

    def view_attr(_value, context, **_params):
        value = getattr(context["view"], attr_name)
        return _attr(value)

    return view_attr
639104
def _getAttr(self, attr):
        
        meth = "_get_%s" % attr
        if not hasattr(self, meth):
            raise AttributeError("No getter for attribute '%s'." % attr)
        meth = getattr(self, meth)
        value = meth()
        return value
1220399
def from_format(self, attr):
        
        if attr.name_format:
            if self.name_format == attr.name_format:
                try:
                    return self._fro[attr.name.lower()]
                except KeyError:
                    pass
        else:  # don't know the name format so try all I have
            try:
                return self._fro[attr.name.lower()]
            except KeyError:
                pass

        return ""
669072
def from_local_name(acs, attr, name_format):
    
    for aconv in acs:
        #print(ac.format, name_format)
        if aconv.name_format == name_format:
            #print("Found a name_form converter")
            return aconv.to_format(attr)
    return attr
702043
function findAttrIndexInNode(name, attrs) {
    if (attrs === null)
        return -1;
    var selectOnlyMode = false;
    var i = 0;
    while (i < attrs.length) {
        var maybeAttrName = attrs[i];
        if (maybeAttrName === name) {
            return i;
        }
        else if (maybeAttrName === 0 /* NamespaceURI */) {
            // NOTE(benlesh): will not find namespaced attributes. This is by design.
            i += 4;
        }
        else {
            if (maybeAttrName === 1 /* SelectOnly */) {
                selectOnlyMode = true;
            }
            i += selectOnlyMode ? 1 : 2;
        }
    }
    return -1;
}
813710
def name(self):
        """"""
        return (
            self._raw_data.get(ATTR_NAME_UNICODE)
            or self._raw_data.get(ATTR_NAME)
            or ""
        )
721227
def _convert_to_standard_attr(attr):
    '''
    
    '''
    ret_attr = ATTR_MAP.get(attr, None)
    if ret_attr is None:
        # All others convert to lowercase
        return attr.lower()
    return ret_attr
382478
@Override
    public String getLocalName(int index) {
        if (index < 0 || index >= attributesList.size()) {
            return null;
        }
        Attribute attr = attributesList.get(index);
        // FIXME attr.localName is sometimes null, why?
        if (namespaces && attr.localName == null) {
            // XXX fix this here for now
            int ci = attr.name.indexOf(':');
            attr.localName = (ci == -1) ? attr.name
                    : attr.name.substring(ci + 1);
        }
        return (attr.localName == null) ? "" : attr.localName;
    }
631000
private Mode getModeAttribute(Attributes attributes, String localName) {
    return lookupCreateMode(attributes.getValue("", localName));
  }