Parse the keys attributes.

@param atts all attributes
960580
private void handleKeysAttr(final Attributes atts) {
        final String attrValue = atts.getValue(ATTRIBUTE_NAME_KEYS);
        if (attrValue != null) {
            URI target = toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
            final URI copyTo = toURI(atts.getValue(ATTRIBUTE_NAME_COPY_TO));
            if (copyTo != null) {
                target = copyTo;
            }

            final String keyRef = atts.getValue(ATTRIBUTE_NAME_KEYREF);

            // Many keys can be defined in a single definition, like
            // keys="a b c", a, b and c are seperated by blank.
            for (final String key : attrValue.trim().split("\\s+")) {
                if (!keysDefMap.containsKey(key)) {
                    if (target != null && !target.toString().isEmpty()) {
                        final String attrScope = atts.getValue(ATTRIBUTE_NAME_SCOPE);
                        final String attrFormat = atts.getValue(ATTRIBUTE_NAME_FORMAT);
                        if (attrScope != null && (attrScope.equals(ATTR_SCOPE_VALUE_EXTERNAL) || attrScope.equals(ATTR_SCOPE_VALUE_PEER))) {
                            keysDefMap.put(key, new KeyDef(key, target, attrScope,  attrFormat, null, null));
                        } else {
                            String tail = null;
                            if (target.getFragment() != null) {
                                tail = target.getFragment();
                                target = stripFragment(target);
                            }
                            if (!target.isAbsolute()) {
                                target = currentDir.resolve(target);
                            }
                            keysDefMap.put(key, new KeyDef(key, setFragment(target, tail), ATTR_SCOPE_VALUE_LOCAL, attrFormat, null, null));
                        }
                    } else if (!StringUtils.isEmptyString(keyRef)) {
                        // store multi-level keys.
                        keysRefMap.put(key, keyRef);
                    } else {
                        // target is null or empty, it is useful in the future
                        // when consider the content of key definition
                        keysDefMap.put(key, new KeyDef(key, null, null, null, null, null));
                    }
                } else {
                    logger.info(MessageUtils.getMessage("DOTJ045I", key).toString());
                }
            }
        }
    }
411152
def add_element_with_atts_to_etree(self, etree, name, atts):
        
        xml_atts = {}
        for att in atts.keys():
            val = atts[att]
            if (val is not None):
                xml_atts[self._xml_att_name(att)] = str(val)
        if (len(xml_atts) > 0):
            e = Element(name, xml_atts)
            if (self.pretty_xml):
                e.tail = "\n"
            etree.append(e)
485049
private function parse_attributes()
    {
        foreach ($this->attributes as $key => $value) {
            if (\is_int($key)) {
                $this->attributes[ $value ] = null;
                unset($this->attributes[ $key ]);
            }
        }

        return $this->attributes;
    }
54030
private function extractKeys($attributes, $keys)
    {
        if (!$keys) {
            $keys = array_keys($attributes);
        }

        if (!is_array($keys)) {
            $keys = (array) $keys;

            return $keys;
        }

        return $keys;
    }
276521
public static void addOrSetAttribute(final AttributesImpl atts, final QName name, final String value) {
        addOrSetAttribute(atts, name.getNamespaceURI(), name.getLocalPart(), name.getPrefix()  + ":" + name.getLocalPart(), "CDATA", value);
    }
530710
private void setAttributes(Map attrs, int offset) {
        if (runCount == 0) {
            createRunAttributeDataVectors();
        }

        int index = ensureRunBreak(offset, false);
        int size;

        if (attrs != null && (size = attrs.size()) > 0) {
            Vector runAttrs = new Vector(size);
            Vector runValues = new Vector(size);
            Iterator iterator = attrs.entrySet().iterator();

            while (iterator.hasNext()) {
                Map.Entry entry = (Map.Entry)iterator.next();

                runAttrs.add(entry.getKey());
                runValues.add(entry.getValue());
            }
            runAttributes[index] = runAttrs;
            runAttributeValues[index] = runValues;
        }
    }
958847
public void setAttrs(String[] attrs, String[] descs) {
    for (int i = 0; i < attrs.length && i < descs.length; i++) {
      descriptions.put(attrs[i], descs[i]);
    }
    this.attrs = attrs;
  }
374134
private void extractAttributes(String attributes)
	{
		String s = attributes.trim();
		if (s.length() > 0 && s.charAt(s.length() - 1) == '/')
			elem.setEmptyElementTag(true);

		while (s.length() != 0) {
			final int equal = s.indexOf('=');
			if (equal == -1 || equal == s.length() - 1)
				break;
			// cut off attribute name
			final String att = s.substring(0, equal).trim();
			s = s.substring(equal + 1).trim();
			if (s.length() == 0)
				break;
			final boolean quote = s.charAt(0) == '\'' || s.charAt(0) == '\"';
			if (att.length() > 0 && quote) {
				String value = s.substring(1);
				final int end = value.indexOf(s.charAt(0));
				if (end >= 0)
					value = value.substring(0, end);
				elem
					.addAttribute(new Attribute(att, References.replace(value, false)));
			}
			final int i = s.indexOf(quote ? s.charAt(0) : ' ', 1);
			s = i == -1 ? "" : s.substring(i + 1);
		}
	}
788107
protected function _cleanAttrs(array $attrs = array())
    {
        foreach ($attrs as $key => $val) {
            if (Arr::in($key, $this->_disallowAttr)) {
                unset($attrs[$key]);
            }
        }

        return $attrs;
    }
683448
def parse_attributes( fields ):
    """"""
    attributes = {}
    for field in fields:
        pair = field.split( '=' )
        attributes[ pair[0] ] = pair[1]
    return attributes
489629
private Map<String, String> parseAttributes() throws IOException {
        if (jsonParser.nextToken() != JsonToken.START_OBJECT) {
            throw new JsonParseException("Not a Attributes object", jsonParser.getCurrentLocation());
        }

        Map<String, String> attributes = new HashMap<>();

        while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
            String key = jsonParser.getCurrentName();
            String value = jsonParser.nextTextValue();
            attributes.put(key, value);
        }

        return attributes;
    }
915212
def parse_special_attributes(raw_attrs)
      return {} if raw_attrs.blank?
      items = raw_attrs.split(/\s+/)

      id      = items.select { |i| i =~ /^#.+/ }.first.gsub('#', '')
      classes = items.select { |i| i =~ /^\..+/ }.map { |c| c.gsub('.', '') }
      attrs   = Hash[items.select { |i| i.include?('=') }.map { |i| i.split('=') }]

      attrs.merge({
        'id' => id,
        'class' => classes.join(' ')
      })
    end
451673
private function appendAttributes(array $attrs)
    {
        foreach ($attrs as $key => $value) {
            $this->appendAttribute($key, $value);
        }
    }
403520
protected function addValidAttributes( $attrs ) {
        foreach( $attrs as $attr ) {
            //add if string
            if( is_string( $attr ) ) {
                $this->validAttributes[] = $attr;
            }
        }
    }
732757
private void extractAttributes(final String attributes)
	{
		String s = attributes.trim();
		if (s.length() > 0 && s.charAt(s.length() - 1) == '/')
			emptyTag = true;

		while (s.length() != 0) {
			final int equal = s.indexOf('=');
			if (equal == -1 || equal == s.length() - 1)
				break;
			// cut off attribute name
			final String att = s.substring(0, equal).trim();
			s = s.substring(equal + 1).trim();
			if (s.length() == 0)
				break;
			final boolean quote = s.charAt(0) == '\'' || s.charAt(0) == '\"';
			if (att.length() > 0 && quote) {
				String value = s.substring(1);
				final int end = value.indexOf(s.charAt(0));
				if (end >= 0)
					value = value.substring(0, end);
				attributeName.add(att);
				attributeValue.add(References.replace(value, false));
			}
			final int i = s.indexOf(quote ? s.charAt(0) : ' ', 1);
			s = i == -1 ? "" : s.substring(i + 1);
		}
	}
1216039
private static Map<String, String> parseAttributes(String attrString) throws ParseException {

      AttributeString str = new AttributeString(attrString);
      Map<String, String> attributes = Maps.newLinkedHashMapWithExpectedSize(4); //Preserve order...
      AttrState state = AttrState.NAME;
      String currName = "";
      String currString = "";
      int currPos = 0;
      while((currString = str.nextString()) != null) {
         switch(state) {
            case NAME:
               if(str.ch == '=') {
                  currName = currString;
                  state = AttrState.VALUE;
               } else {
                  attributes.put(String.format("$%d", currPos++), currString);
               }
               break;
            case VALUE:
               attributes.put(currName.toLowerCase(), currString);
               state = AttrState.NAME;
               break;
         }
      }
      return attributes;
   }
699243
def _update_known_atts(self, **kwargs):
        
        for k, v in kwargs.items():
            if k not in ATTR_KEYS:
                # Warn if passed in unknown kwargs
                raise SyntaxWarning('Unknown argument: {}'.format(k))
            elif not v: # Delete attributes with falsey values
                delattr(self, k)
            else:
                setattr(self, k, v)