def linkHasRel(link_attrs, target_rel):
 rel_attr = link_attrs.get('rel')
 return (rel_attr and relMatches(rel_attr, target_rel))

def linkHasRel ( link_attrs , target_rel ) : rel_attr = link_attrs . get ( 'rel' ) return ( rel_attr and relMatches ( rel_attr , target_rel ) )
does this link have target_rel as a relationship? .