attribute(key)
   attribute(namespace, key)

 Returns the attribute of the specified +namespace+ of specified +key+ or +nil+ if not found.
765614
def attribute(namespace, key = nil)
      namespace, key = to_nns namespace, key
      attributes = @attributesByNamespace[namespace]
      return attributes.nil? ? nil : attributes[key]
    end
845724
private String getAttributeKeyValue(String key) {
    String prefix = key + '=';
    String attribute = getAttribute(prefix);
    return attribute != null ? attribute.substring(prefix.length()) : null;
  }
253199
def get_attribute(self, name):
        
        assert isinstance(name, basestring)
        value = None
        if self.__attributes and name in self.__attributes.keys():
            value = self.__attributes[name]
        return value
896323
def _key_for_namespace(namespace, app):
  
  if namespace:
    return db.Key.from_path(metadata.Namespace.KIND_NAME,
                            namespace,
                            _app=app)
  else:
    return db.Key.from_path(metadata.Namespace.KIND_NAME,
                            metadata.Namespace.EMPTY_NAMESPACE_ID,
                            _app=app)
361625
function getAttribute(node, attrName) {
	attrName = attrName.toLowerCase();
	return node && node.open.attributes.find(attr => attr.name.value.toLowerCase() === attrName);
}
444791
def namespace_attributes(ns)
      Hash[ns.map do |prefix, uri|
             if prefix==""
               ["xmlns", uri]
             else
               [["xmlns", prefix].join(":"), uri]
             end
           end]
    end
694876
private String getNamespace(final Attr attribute) {
        final Element parent = attribute.getOwnerElement();
        return parent.getAttribute(NAMESPACE);
    }
613337
Object getAttribute(String name)
    {
        if (attributes.containsKey(name))
            return attributes.get(name);
        return noStroke.get(name);
    }
110425
def get_attribute(self, name):
        
        assert isinstance(name, compat.str_type)
        return self.__attributes.get(name)
1005702
public Object getAttribute(String key) {
        if (attributes != null && !attributes.isEmpty()) {
            return attributes.get(key);
        }
        return null;
    }
902160
def attribute(self, keys):
        
        if self['meta']['prefix'] is None:
            k = keys
        else:
            k = self['meta']['prefix'] + "." + keys
        return self.get(k)
890076
public Attribute getAttribute(String name)
  {
    for (int i = _attributes.size() - 1; i >= 0; i--) {
      Attribute attr = _attributes.get(i);

      if (attr.getName().equals(name))
        return attr;
    }

    return null;
  }
237670
def element_for_attribute(name, namespace='')
      val = instance_values[name]
      return "" if val == nil
      "<%s:%s val='%s'/>" % [namespace, Axlsx::camel(name, false), val]
    end
722032
def has_attribute?(namespace = nil, key = nil)
      namespace, key = to_nns namespace, key

      if namespace or key
        attributes = @attributesByNamespace[namespace]
        return attributes.nil? ? false : attributes.has_key?(key)

      else
        attributes { return true }
        return false
      end
    end
142187
def matches_attributes?(element) # :api: public
      @attributes.all? do |key, value|
        test_attribute(element.attribute(key.to_s), value)
      end
    end
1055296
def attribute_value_object(name)
  
      #Ensure we have a string- this allows us to use symbols as attribute names, as well.
      #This is more idiomatic.
      name = name.to_s

      #Get the node that corresponds to the given attribute, if it exists.
      node = @xml.at_css("symbol attr[name=\"#{name}\"]")

      #If the node exists, return its value; otherwise, return nil.
      return node ? node.attribute('value') : nil

    end
80702
def match_attribute_name(self, el, attr, prefix):
        """"""

        value = None
        if self.supports_namespaces():
            value = None
            # If we have not defined namespaces, we can't very well find them, so don't bother trying.
            if prefix:
                ns = self.namespaces.get(prefix)
                if ns is None and prefix != '*':
                    return None
            else:
                ns = None

            for k, v in self.iter_attributes(el):

                # Get attribute parts
                namespace, name = self.split_namespace(el, k)

                # Can't match a prefix attribute as we haven't specified one to match
                # Try to match it normally as a whole `p:a` as selector may be trying `p\:a`.
                if ns is None:
                    if (self.is_xml and attr == k) or (not self.is_xml and util.lower(attr) == util.lower(k)):
                        value = v
                        break
                    # Coverage is not finding this even though it is executed.
                    # Adding a print statement before this (and erasing coverage) causes coverage to find the line.
                    # Ignore the false positive message.
                    continue  # pragma: no cover

                # We can't match our desired prefix attribute as the attribute doesn't have a prefix
                if namespace is None or ns != namespace and prefix != '*':
                    continue

                # The attribute doesn't match.
                if (util.lower(attr) != util.lower(name)) if not self.is_xml else (attr != name):
                    continue

                value = v
                break
        else:
            for k, v in self.iter_attributes(el):
                if util.lower(attr) != util.lower(k):
                    continue
                value = v
                break
        return value