Get attribute value cross-browser. Returns the attribute as string if found,
otherwise returns false
@param  {Object} obj
@param  {String} attr
@return {boolean || string}
6895
function getAttr(obj, attr) {
    if (!obj || !isset(obj)) {
      return false;
    }
    var ret;
    if (obj.getAttribute) {
      ret = obj.getAttribute(attr);
    }
    else
      if (obj.getAttributeNode) {
        ret = obj.getAttributeNode(attr).value;
      }
    if (isset(ret) && ret !== '') {
      return ret;
    }
    return false;
  }
120346
public String getString(Map<String, Object> data, String attr) {
    Object value = data.get(attr);
    if (null == value) { return null; }
    if (!value.getClass().isArray()) { return value.toString(); }
    String[] values = (String[]) value;
    if (values.length == 1) {
      return values[0];
    } else {
      return Strings.join(values, ",");
    }
  }
660973
function assertObject(attr, data) {
  if (data === null || data === undefined) {
    return null;
  }

  if (typeof data !== 'object' || Array.isArray(data)) {
    throw new ParseError(`Attribute ${attr} must be of type "object"`);
  }

  return data;
}
30898
def value_attr(attr_name):
    

    def value_attr(value, context, **_params):
        value = getattr(value, attr_name)
        return _attr(value)

    return value_attr
1001804
def get_attribute(self, obj, attribute):
        
        raw_return = self.send_command_return(obj, attribute, '?')
        if len(raw_return) > 2 and raw_return[0] == '"' and raw_return[-1] == '"':
            return raw_return[1:-1]
        return raw_return
1246434
function getAttribute(element, name) {
  assertType(element, Node, false, 'Invalid element specified');

  if (!element.getAttribute) return null;

  let value = element.getAttribute(name);
  if (value === '') return true;
  if (value === undefined || value === null) return null;
  try {
    return JSON.parse(value);
  }
  catch (err) {
    return value;
  }
}
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
547410
function(attr) {
      var html;
      if (html = this._escapedAttributes[attr]) return html;
      var val = this.get(attr);
      return this._escapedAttributes[attr] = _.escape(val == null ? '' : '' + val);
    }
608800
function getElAttributes(tag,attr) {
        var obj, knownBooleans, attrs, attrName, attrVal;

        obj = {};

        // known boolean attributes
        // we can check for matching boolean properties, but older browsers
        // won't know about HTML5 boolean attributes that we still read from
        knownBooleans = ',' + 'autoplay,controls,loop,muted,default' + ',';

        if (tag && tag.attributes && tag.attributes.length > 0) {
            attrs = tag.attributes;

            for (var i = attrs.length - 1; i >= 0; i--) {
                attrName = attrs[i].name;
                attrVal = attrs[i].value;

                // check for known booleans
                // the matching element property will return a value for typeof
                if (typeof tag[attrName] === 'boolean' || knownBooleans.indexOf(',' + attrName + ',') !== -1) {
                    // the value of an included boolean attribute is typically an empty
                    // string ('') which would equal false if we just check for a false value.
                    // we also don't want support bad code like autoplay='false'
                    attrVal = (attrVal !== null) ? true : false;
                }

                if(attr && attrName == attr){
                    return attrVal;
                }

                obj[attrName] = attrVal;
            }
        }
        if(attr && typeof attr == 'string'){
            return tag[attr];
        }
        return obj;
    }
929453
def _getter(self):
        
        def get_attr_value(obj):
            attr_str_value = obj.get(self._clark_name)
            if attr_str_value is None:
                raise InvalidXmlError(
                    "required '%s' attribute not present on element %s" %
                    (self._attr_name, obj.tag)
                )
            return self._simple_type.from_xml(attr_str_value)
        get_attr_value.__doc__ = self._docstring
        return get_attr_value
1243466
def get_attr(name):
    
    i = name.rfind('.')
    cls = str(name[i+1:])
    module = str(name[:i])

    mod = __import__(module, fromlist=[cls])
    return getattr(mod, cls)
11041
function getAttrMap(attrs)
{
	var i;
	var map = {};
	var numAttrs = attrs.length;
	
	for (i=0; i<numAttrs; i++)
	{
		map[ attrs[i].name ] = attrs[i].value;
	}
	
	return map;
}
643974
public <T> T get(String attr, Object defaultValue) {
		Object result = attrs.get(attr);
		return (T)(result != null ? result : defaultValue);
	}
1344617
function getAttribute(path, attrNode) {
    path.forEach(attrName => {
        if (!(attrNode.attributes && attrNode.attributes[attrName])) {
            throw new ImplementationError(`Result-Builder: Unknown attribute "${path.join('.')}"`);
        }
        attrNode = attrNode.attributes[attrName];
    });
    return attrNode;
}
149782
function(attr) {
      var html = this._escapedAttributes[attr];
      if (html) {
        return html;
      }
      var val = this.attributes[attr];
      var escaped;
      if (Parse._isNullOrUndefined(val)) {
        escaped = '';
      } else {
        escaped = _.escape(val.toString());
      }
      this._escapedAttributes[attr] = escaped;
      return escaped;
    }
821312
function getAttributeSet (attributes) {
  let attrs = {}
  Array.prototype.slice.apply(attributes).forEach(function (attr) {
    attrs[attr.name] = attr.value
  })
  return attrs
}
889370
def resolve_attr(obj, name):
    """"""
    # TODO: setup some hinting, so we can go directly to the correct
    # Maybe it's a dict ? Let's try dict lookup, it's the fastest
    try:
        return obj[name]
    except TypeError:
        pass
    except KeyError:
        raise exceptions.MissingField('Dict {0} has no attribute or key "{1}"'.format(obj, name))

    # Okay, it's not a dict, what if we try to access the value as for a regular object attribute?
    try:
        # Slight hack for better speed, since accessing dict is fast
        return obj.__dict__[name]
    except (KeyError, AttributeError):
        pass

    try:
        # Lookup using regular attribute
        return getattr(obj, name)
    except AttributeError:
        pass

    # Last possible choice, it's an iterable
    if isinstance(obj, collections.Iterable):
        return IterableAttr(obj, name)

    raise exceptions.MissingField('Object {0} has no attribute or key "{1}"'.format(obj, name))