def parse_attrs(self, tag):
if tag.name in ATTR_WHITELIST.keys():<EOL><INDENT>attrs = copy(tag.attrs)<EOL>for attr, value in attrs.items():<EOL><INDENT>if attr in ATTR_WHITELIST[tag.name]:<EOL><INDENT>tag.attrs[attr] = self._parse_attr(tag.name, attr, value)<EOL><DEDENT>else:<EOL><INDENT>del tag.attrs[attr]<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>tag.attrs = {}<EOL><DEDENT>
Reject attributes not defined in ATTR_WHITELIST.