:type attrs: List[Tuple[str, str]] :rtype: List[Tuple[str, str]]
(attrs)
| 158 | |
| 159 | @staticmethod |
| 160 | def normalize_attrs(attrs): |
| 161 | """ |
| 162 | :type attrs: List[Tuple[str, str]] |
| 163 | :rtype: List[Tuple[str, str]] |
| 164 | """ |
| 165 | |
| 166 | if not attrs: |
| 167 | return attrs |
| 168 | # utility method to be called by descendants |
| 169 | # Collapse any duplicate attribute names and values by converting |
| 170 | # *attrs* into a dictionary, then convert it back to a list. |
| 171 | attrs_d = {k.lower(): v for k, v in attrs} |
| 172 | attrs = [ |
| 173 | (k, k in ('rel', 'type') and v.lower() or v) |
| 174 | for k, v in attrs_d.items() |
| 175 | ] |
| 176 | attrs.sort() |
| 177 | return attrs |
| 178 | |
| 179 | def unknown_starttag(self, tag, attrs): |
| 180 | """ |
no outgoing calls
no test coverage detected