def extract_attrs(attr_string):
 attributes = {}
 for (name, val) in FIND_ATTRS.findall(attr_string):
  attributes[name] = val
 return attributes

def extract_attrs ( attr_string ) : attributes = { } for ( name , val ) in FIND_ATTRS . findall ( attr_string ) : attributes [ name ] = val return attributes
helper method to extract tag attributes as a dict .