def resolve_property(style_map, elem, name):
 inheritable = (name in INHERITED)
 q = elem
 while (q is not None):
  s = style_map.get(q)
  if (s is not None):
   val = s.get(name)
   if (val is not None):
    return val
  q = (q.getparent() if inheritable else None)
 return defvals().get(name)

def resolve_property ( style_map , elem , name ) : inheritable = ( name in INHERITED ) q = elem while ( q is not None ) : s = style_map . get ( q ) if ( s is not None ) : val = s . get ( name ) if ( val is not None ) : return val q = ( q . getparent ( ) if inheritable else None ) return defvals ( ) . get ( name )
given a style_map previously generated by :func:resolve_styles() and a property name .