MCPcopy Index your code
hub / github.com/clips/pattern / _normalize_attributes

Method _normalize_attributes

pattern/web/feed/feedparser.py:591–601  ·  view source on GitHub ↗
(self, kv)

Source from the content-addressed store, hash-verified

589 self.property_depth_map = {}
590
591 def _normalize_attributes(self, kv):
592 k = kv[0].lower()
593 v = k in ('rel', 'type') and kv[1].lower() or kv[1]
594 # the sgml parser doesn't handle entities in attributes, nor
595 # does it pass the attribute values through as unicode, while
596 # strict xml parsers do -- account for this difference
597 if isinstance(self, _LooseFeedParser):
598 v = v.replace('&', '&')
599 if not isinstance(v, unicode):
600 v = v.decode('utf-8')
601 return (k, v)
602
603 def unknown_starttag(self, tag, attrs):
604 # increment depth counter

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected