Find the attribute value for a specific attribute.

        :param attr: string of attribute name
        :returns: string of attribute value
356701
def _get_template_attr(self, attr):
        '''
        '''

        attr_re = r'{0}\s+.*'.format(attr)

        attr_found = re.search(attr_re, self.template_str)
        if attr_found:
            attr_value = attr_found.group(0).replace(attr, '', 1)
            return attr_value.strip()
444612
def findViewWithAttribute(self, attr, val, root="ROOT"):
        '''
        
        '''
        if DEBUG:
            try:
                print >> sys.stderr, u'findViewWithAttribute({0}, {1}, {2})'.format(attr, unicode(val, encoding='utf-8', errors='replace'), root)
            except:
                pass
            print >> sys.stderr, "    findViewWithAttribute: type(val)=", type(val)


        return self.__findViewWithAttributeInTree(attr, val, root)
125498
def _find_attrNS(E, namespaceURI, localName):
    '''
    '''
    try:
        v = E.getAttributeNS(namespaceURI, localName)
        if v: return v
    except: pass
    return None
46762
function getAttribute(node, attr) {
	return (node.$ && node.$[attr] && node.$[attr].value) || null;
}
31606
def _set_attr(self, attr):
        
        if attr in text:
            self._text_attr(attr)
        elif attr in colors["foreground"]:
            self._color_attr("foreground", attr)
        elif attr in colors["background"]:
            self._color_attr("background", attr)
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
494193
def field_attribute(attr)
      return 'id'           if attr == :_id
      # default, simply return name
      return attr           unless attr.is_a? Hash
      # else, Hash
      return attr[:object]  if attr.has_key? :object
      return attr[:array]   if attr.has_key? :array
      return attr[:value]   if attr.has_key? :value
      return attr[:link]    if attr.has_key? :link

      attr.keys[0]
    end
425020
private static function getAttributes($attr)
    {
        $html = "";
        foreach ($attr as $key => $value) {
            $html .= $key . '="' . $value . '" ';
        }

        return $html;
    }
568751
def attr_name(self):
        ""
        return self.schema.name if self.schema else self.field.name
895118
def getAttribute(self, attribute):
        
        if type(attribute) in (list, tuple):
            if len(attribute) != 2:
                raise LookupError, 'To access attributes must use name or (namespace,name)'

            ns_dict = self.attributes.get(attribute[0])
            if ns_dict is None:
                return None

            return ns_dict.get(attribute[1])

        return self.attributes.get(attribute)
755732
public Object getAttrVal(String attr) throws NamingException {
    if (attr.equalsIgnoreCase("dn")) {
      return getDn();
    }

    Attribute a = findAttr(attr);

    if (a == null) {
      return null;
    }

    return a.get();
  }
729512
def get_attr(obj, attr, default=None):
    
    if '.' not in attr:
        return getattr(obj, attr, default)
    else:
        L = attr.split('.')
        return get_attr(getattr(obj, L[0], default), '.'.join(L[1:]), default)
556171
def get_attribute_by_name(el, name, default=None):
        """"""

        value = default
        if el._is_xml:
            try:
                value = el.attrs[name]
            except KeyError:
                pass
        else:
            for k, v in el.attrs.items():
                if util.lower(k) == name:
                    value = v
                    break
        return value
213891
function(attr) {
      var startIndex, newAttr,
        i = 0,
        hasEndBracket = true;
      startIndex = attr.indexOf('[', i);
      if (startIndex < 0) {
        return attr;
      }
      newAttr = attr.substring(0, startIndex + 1);
      while (startIndex > 0 && hasEndBracket) {
         i = attr.indexOf(']', i) + 1;
         hasEndBracket = i > 0;
         startIndex = attr.indexOf('[', i);
         if (startIndex > 0) {
           newAttr = newAttr + attr.substring(i - 1, startIndex + 1);
         }
      }
      newAttr = newAttr + attr.substring(i - 1);
      return newAttr;
    }
1328697
function (attr) {
            var value = typeof attr === 'string' && !! ~attr.indexOf('.') && this.__get(attr);
            if (value) {
                return value;
            }

            // break up the attr (`"foo.bar"`) into `["foo","bar"]`
            var parts = attrParts(attr),
                // get the value of the first attr name (`"foo"`)
                current = this.__get(parts.shift());
            // if there are other attributes to read
            return parts.length ?
            // and current has a value
            current ?
            // lookup the remaining attrs on current
            current._get(parts) :
            // or if there's no current, return undefined
            undefined :
            // if there are no more parts, return current
            current;
        }
695271
function(el, attrName) {
                    var prop = attr.map[attrName];
                    if (typeof prop === "string" && el[prop]) {
                        return el[prop];
                    }

                    return el.getAttribute(attrName);
                }
328881
public int locate(Attribute attr) {
        List lst;
        int i;
        int max;

        if (attr.symbol < attrs.size()) {
            lst = (List) attrs.get(attr.symbol);
            max = lst.size();
            for (i = 0; i < max; i++) {
                if (attr == lst.get(i)) {
                    return i;
                }
            }
        }
        return -1;
    }