In: [{attribute: "<attributeName>", ...}] Out: {"<attributeName>": [{attribute: "<attributeName>", ...}]}
970997
function(errors) {
      var ret = {};
      errors.forEach(function(error) {
        var list = ret[error.attribute];
        if (list) {
          list.push(error);
        } else {
          ret[error.attribute] = [error];
        }
      });
      return ret;
    }
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;
}
127608
def attributes(*attributes)
      attributes.each do |attr|
        raise ArgumentError.new("You cannot use #{attr} as an attribute name since it is a reserved method name of Xapian::Document") if reserved_method_name?(attr)
        @attributes_hash[attr] = {}
        @type_map[attr] = :string
        self.index attr
      end
    end
577844
def attributes
      self.class::ATTRIBUTES_NAMES.inject({}) do |attribs, attrib_name|
        value = self.send(attrib_name)
        attribs[attrib_name] = value unless value.nil?
        attribs
      end
    end
831886
private void encodeAttributes(List attributes, PrintStream out,
                                  Indenter indenter) {
        Iterator it = attributes.iterator();
        while (it.hasNext()) {
            Attribute attr = (Attribute)(it.next());
            attr.encode(out, indenter);
        }
    }
274898
function () {
            var self = this, o = {}, a, attrs = self.getAttrs();
            for (a in attrs) {
                o[a] = self.get(a);
            }
            return o;
        }
811752
def attributes=(attributes = {})
      attributes.each_pair { |k, v|
        respond_to?(name = "#{k}=") and send(name, v) or self[k] = v
      }
    end
1019092
function getDataAttributes(attributes) {
  if (!attributes) {
    return {};
  }

  return Object.keys(attributes).reduce((ret, key) => {
    ret[`data-${key.toLowerCase()}`] = attributes[key];
    return ret;
  }, {});
}
420083
function getAttributes(tag) {
        let running = true;
        const attributes = [];
        const regexp = /(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))+.)["']?/g;

        while (running) {
            const match = regexp.exec(tag);

            if (match) {
                attributes.push({
                    key: match[1],
                    value: match[2]
                })
            } else {
                running = false;
            }
        }

        return attributes;
    }
1058427
function(node) {
        var attributes = {};
        var i, len, data, key;
        var dataNodes = node.getElementsByTagName("Data");
        for (i = 0, len = dataNodes.length; i < len; i++) {
            data = dataNodes[i];
            key = data.getAttribute("name");
            var ed = {};
            var valueNode = data.getElementsByTagName("value");
            if (valueNode.length) {
                ed['value'] = this.getChildValue(valueNode[0]);
            }
            if (this.kvpAttributes) {
                attributes[key] = ed['value'];
            } else {
                var nameNode = data.getElementsByTagName("displayName");
                if (nameNode.length) {
                    ed['displayName'] = this.getChildValue(nameNode[0]);
                }
                attributes[key] = ed;
            } 
        }
        var simpleDataNodes = node.getElementsByTagName("SimpleData");
        for (i = 0, len = simpleDataNodes.length; i < len; i++) {
            var ed = {};
            data = simpleDataNodes[i];
            key = data.getAttribute("name");
            ed['value'] = this.getChildValue(data);
            if (this.kvpAttributes) {
                attributes[key] = ed['value'];
            } else {
                ed['displayName'] = key;
                attributes[key] = ed;
            }
        }
        
        return attributes;    
    }
698027
function condenseDataAttrs(attrs) {
		var out = [], data = null;
		var reData = /^data-/i;
		attrs.forEach(function(attr) {
			if (reData.test(attr.name)) {
				if (!data) {
					data = [];
					out.push({
						name: 'data',
						value: data
					});
				}

				data.push(utils.extend({}, attr, {name: attr.name.replace(reData, '')}));
			} else {
				out.push(attr);
			}
		});

		return out;
	}
593959
def _attribs(self, name=None, description=None):
        """"""
        a = {}
        if name:
            a['name'] = name
        if description:
            a['description'] = description
        return a
407110
def flatatt(attrs):
    
    return _flatatt({k.replace('_', '-'): v for k, v in attrs.items()})
648477
def simpleAttrs(self):
        """"""
        simpleAttrs = {}
        for k,v in iteritems(self.attrs):
            if k in ["_matches"]: continue # attributes to specifically ignore
            try:    simpleAttrs[k] = v.type
            except: simpleAttrs[k] = v
        return simpleAttrs
312045
function() {
        var attrNames;
        attrNames = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
        return attrNames.each(function(attrName) {
          return self[attrName] = function(newValue) {
            if (newValue != null) {
              I[attrName] = newValue;
              return self;
            } else {
              return I[attrName];
            }
          };
        });
      }
681097
function formatAttrs(attributes, opts, keyOnlyAttribs = []) {
  if (!attributes) return;

  var output = '',
    value;

  // Loop through the attributes
  for (var key in attributes) {
    value = attributes[key];
    if (output) {
      output += ' ';
    }

    if (!value && booleanAttributes[key] || isExpr(key) || isKeyOnlyAttr(key, keyOnlyAttribs)) {
      output += key;
    } else {
      output += key + `=${isExpr(value) ? '' : '"'}` + (opts.decodeEntities ? entities.encodeXML(value) : value) + (isExpr(value) ? '' : '"');
    }
  }

  return output;
}
683448
def parse_attributes( fields ):
    """"""
    attributes = {}
    for field in fields:
        pair = field.split( '=' )
        attributes[ pair[0] ] = pair[1]
    return attributes